-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Fix Livolo state handling #4550
Conversation
Thanks! |
This update cause switch status change - it was switched, but apple home app flaps status back to off (switch stays on). |
@sanychonline, this update doesn't affect the logic of sending status updates. It only fixes state properties, e.g. instead of
the correct state message is generated.
Do you use MQTT-Thing Homebridge plug-in? I also noticed the behavior you mentioned with MQTT-Thing. I'll investigate that further. |
I use "homebridge-z2m": "^1.9.0" as a communication between homebridge and zigbee2mqtt |
@sanychonline I see, anyways the number of consequent duplicated updates shouldn't cause status changes on the Homebridge side. I suggest you to update your original issue Koenkk/zigbee2mqtt#13531 and provide logs. |
@sanychonline I can confirm the behavior you described with homebridge-z2m 1.9.0. I can also confirm that Zigbee2MQTT reports status updates correctly. It looks like the issue is on the homebridge/plugin side. I'll try to troubleshoot that. For example, initial state_left is ON, on iOS device I switched left endpoint to OFF, lights went off, the corresponding accessorry on iOS device went off, and then on again.
My debugging command line MQTT client received the following:
It looks like frequently repeated OFF state updates are triggering some debouncing logic on the homebridge side. Or possibly the state values are ignored and status update events act as a toggle instead of explicit on/off commands. For now, as a workaround, you can enable debounce for Livolo switches, e.g.
|
@ashway83 Yeah. It works. The status flaps one time, but then goes back to actual. So the behavior on home app looks like: The same scenario when we want to switch it off. Status flaps, but it works. Config part for device: devices: Zigbee2mqtt log part: homebridge log: |
Anyway, I wonder: zigbee2mqtt version 1.24.0 has no such issues and does not require any special config update, so as per my understanding something changed right in 1.25.0 and later builds. |
While investigating this issue, I've found a bug on the Homebridge side - in HAP-NodeJS homebridge/HAP-NodeJS#964 @sanychonline It looks like the version of zigbee-herdsman-converters which is used in zigbee2mqtt 1.24.0 was sending an extra state update and that served as a workaround. |
The toZigbee livolo_socket_switch_on_off convertSet converter was returning
state_<endpoint>
which results in new state errorneous values where endpoint suffix is appended twice, e.g.{"linkquality":94,"state_left":"OFF","state_right":"OFF","state_right_right":"OFF","state_left_left":"OFF"}
This trivial fix resolves the issue.
It should also address Koenkk/zigbee2mqtt#13531
I've built Docker images for convenient and quick testing:
https://hub.docker.com/r/ashway83/zigbee2mqtt/tags