Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Osram outlet and Tradfri light - On/Off State not updated #58

Closed
philibertc opened this issue Mar 9, 2021 · 9 comments
Closed

Osram outlet and Tradfri light - On/Off State not updated #58

philibertc opened this issue Mar 9, 2021 · 9 comments

Comments

@philibertc
Copy link

philibertc commented Mar 9, 2021

Description of problem:
On/Off State is not updated until the corresponding button is clicked. This is annoying because on the home assistant interface it is also desynchronized. The outlet is currently switched on: to switch it off, I have to click On, then Off. The status can be changed with a button on the outlet that communicates directly with the socket without using zigbee. (Same problem with a tradfri light with the remote directly connected on the light.) Is there any solution to force updating every 30sec for example?
image

Zigbee2mqtt add-on version (if edge, please report commit hash):

> zigbee2mqtt@1.18.1-1

Your entire configuration from the frontend (with sensitive fields redacted):

data_path: /config/zigbee2mqtt
external_converters: []
devices: devices.yaml
groups: groups.yaml
homeassistant: true
permit_join: false
mqtt:
  base_topic: zigbee2mqtt
serial:
  port: /dev/serial/by-id/usb-1a86_USB_Serial-if00-port0
advanced:
  log_level: warn
  pan_id: 6754
  channel: 11
  network_key:
    - 1
    - 3
    - 5
    - 7
    - 9
    - 11
    - 13
    - 15
    - 0
    - 2
    - 4
    - 6
    - 8
    - 10
    - 12
    - 13
  availability_blocklist: []
  availability_passlist: []
device_options: {}
blocklist: []
passlist: []
queue: {}
frontend:
  port: 8099
experimental: {}
socat:
  enabled: false
  master: 'pty,raw,echo=0,link=/dev/ttyZ2M,mode=777'
  slave: 'tcp-listen:8485,keepalive,nodelay,reuseaddr,keepidle=1,keepintvl=1,keepcnt=5'
  options: '-d -d'
  log: false
}

Running platform (details from Supervisor > System)

Core: core-2021.3.1
Supervisor: supervisor-2021.03.4
Operating System: HassOS 5.12

Your logs from Home Assistant Supervisor

[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] socat.sh: executing... 
[18:39:11] INFO: Socat not enabled, marking service as down
[cont-init.d] socat.sh: exited 0.
[cont-init.d] zigbee2mqtt.sh: executing... 
[18:39:12] INFO: MQTT available, fetching server detail ...
[18:39:12] INFO: MQTT server settings not configured, trying to auto-discovering ...
[18:39:13] INFO: Configuring 'mqtt://core-mosquitto:1883' mqtt server
[18:39:13] INFO: MQTT credentials not configured, trying to auto-discovering ...
[18:39:13] INFO: Configuring'addons' mqtt user
[18:39:13] INFO: Previous config file found, checking backup
[18:39:13] INFO: Creating backup config in '/config/zigbee2mqtt/.configuration.yaml.bk'
[18:39:13] INFO: Adjusting Zigbee2mqtt core yaml config with add-on quirks ...
[cont-init.d] zigbee2mqtt.sh: exited 0.
[cont-init.d] done.
[services.d] starting services
[services.d] done.
[18:39:14] INFO: Handing over control to Zigbee2mqtt Core ...
> zigbee2mqtt@1.18.1 start /app
> node index.js
@ciotlosm ciotlosm changed the title On/Off State isn't updated. Osram outlet - On/Off State not updated Mar 9, 2021
@ciotlosm
Copy link
Contributor

ciotlosm commented Mar 9, 2021

Was this working before? It depends from device to device, but usually wired devices publish a state periodically that updates their on / off state.

@philibertc
Copy link
Author

philibertc commented Mar 9, 2021

I don't know if it worked before: I recently received the osram outlets and for the ikea lamp I was passing the commands of the remote control via zigbee2mqtt.

This happens also on tradfri light : the lamp is connected to zigbee2mqtt and the remote control directly to the lamp. When I toggle via the remote control the status in zigbee2mqtt is updated only when I press the corresponding button in the interface.

In short: the lamp and the outlet don't send their On/Off status until I ask for it. Is there a way in zigbee2mqtt parameters to define regular updates? @ciotlosm

@philibertc philibertc changed the title Osram outlet - On/Off State not updated Osram outlet and Tradfri light - On/Off State not updated Mar 9, 2021
@philibertc
Copy link
Author

I will try this when a button on the remote is pressed:

action:
  - delay:
      hours: 0
      minutes: 0
      seconds: 1
      milliseconds: 0
  - service: mqtt.publish
    data:
      topic: zigbee2mqtt/tradfri_light_1/get
      payload: '{"state": ""}'

@philibertc
Copy link
Author

Okay, it's a quick fix that works for the lamp since I always control it via a remote control.
But it doesn't solve the problem for the outlet because the integrated button only communicates with the outler.

@netweaver1970
Copy link

You're looking for the Zigbee 'reporting' (and/or 'binding') functionality. (https://www.zigbee2mqtt.io/information/binding.html)
For the light & remote, using the full Build-in Z2M GUI you can easily bind the remote to the lamp. Also, at that time automatically Z2M will set up the reporting, so when someone presses the on/off on the remote (or whatever, like dimming) that the coordinator (and HA) is alerted of the state change.

You can also setup alerting (using lots of tunable parameters if you want) directly on the socket, so it reports always it's status back.
Easiest to set it up is using the Z2M GUI. there's currently quite some thinking going on on how to support/integrate the Z2M GUI function in the Z2M Add-on, to allow changes to be persistent, as there are now 3 possible ways of configuring the add-on (and devices). Only 1 can win... So things might not work straight away.

Doing it in config files using text-only might also be possible, using the existing Z2M Add-on syntax. But surely the GUI makes it effortless.

@philibertc
Copy link
Author

philibertc commented Mar 9, 2021

Hello, I tried several times the binding but each time I got a timeout error (I woke up the remote control by pressing a button). I gave up, so I paired the remote directly to the lamp (15 sec press on the button next to the battery) and the remote control stays on the zigbee2mqtt network also.
@netweaver1970

@philibertc
Copy link
Author

philibertc commented Mar 9, 2021

To retrieve the state of the lamp I created an automation that makes zigbee2mqtt/tradfri_light_1/get as soon as I press a button.
And for the outlet I do the same thing every thirty seconds. It's certainly not the best solution but I don't have dozens of outlets so that's fine.

@philibertc
Copy link
Author

philibertc commented Mar 9, 2021

I’m gonna try this: Koenkk/zigbee2mqtt#4230

@philibertc
Copy link
Author

Okay, that work for the outlet but for the light it does nothing. That's not a problem related to the addon so I close this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants