Closed AkshayRao27 closed 9 months ago
Zigbee2MQTT version 1.34.0-dev (commit #299b37a7)
Adapter firmware version 7.3.1.0 build 0
Adapter SONOFF ZBDongle-E and SONOFF ZBDongle-P
Still having this issue too. The issue is not resolved by commit 392ad722. I completely rebuilt z2m yesterday after it was fixed, and again today to make sure. It DOES work in z2m version 1.31. database.db.json
Commit 392ad722 fixes this for xiaomi_switch_operation_mode_basic
. My device seems to run xiaomi_switch_operation_mode_opple
where the check is still utils.assertObject(value);
https://github.com/Koenkk/zigbee-herdsman-converters/blob/master/src/converters/toZigbee.ts#L2501C30-L2501C30
I have no running dev version so I can't test the fix but perhaps @Koenkk can take another look?
Commit 392ad722 fixes this for
xiaomi_switch_operation_mode_basic
. My device seems to runxiaomi_switch_operation_mode_opple
where the check is stillutils.assertObject(value);
https://github.com/Koenkk/zigbee-herdsman-converters/blob/master/src/converters/toZigbee.ts#L2501C30-L2501C30I have no running dev version so I can't test the fix but perhaps @Koenkk can take another look?
I replaced this line https://github.com/Koenkk/zigbee-herdsman-converters/commit/392ad722e0f9ad9f151b9bfacab433f3492904f1#diff-cdc7c627220d02e6995b7fa52a0056b8650198a9850fc9f61c3eee7365fb8698R2487
with let targetValue = utils.isObject(value) && value.hasOwnProperty('state') ? value.state : value;
and it fixed it.
Already fixed in the dev branch
Already fixed in the dev branch
Not fixed for 0pple devices. Please read thread and see that the dev branch is being used.
Im running the latest commit and i still have the same issue (below is the error from the log)
Zigbee2MQTT:debug 2023-12-05 22:59:20: Received MQTT message on 'zigbee2mqtt/Switch_Light Toilet Down/set' with data '{"operation_mode_left":"decoupled"}'
Zigbee2MQTT:debug 2023-12-05 22:59:20: Publishing 'set' 'operation_mode' to 'Switch_Light Toilet Down'
Zigbee2MQTT:error 2023-12-05 22:59:20: Publish 'set' 'operation_mode' to 'Switch_Light Toilet Down' failed: 'Error: undefined is not a object, got string ("decoupled")'
Zigbee2MQTT:debug 2023-12-05 22:59:20: Error: undefined is not a object, got string ("decoupled")
at Object.assertObject (/app/node_modules/zigbee-herdsman-converters/src/lib/utils.ts:517:15)
at Object.convertSet (/app/node_modules/zigbee-herdsman-converters/src/converters/toZigbee.ts:2501:19)
at Publish.onMQTTMessage (/app/lib/extension/publish.ts:249:52)
at EventEmitter.emit (node:events:525:35)
at EventBus.emitMQTTMessage (/app/lib/eventBus.ts:109:22)
at MQTT.onMessage (/app/lib/mqtt.ts:141:27)
at WebSocket.<anonymous> (/app/lib/extension/frontend.ts:130:27)
at WebSocket.emit (node:events:513:28)
at Receiver.receiverOnMessage (/app/node_modules/ws/lib/websocket.js:1192:20)
at Receiver.emit (node:events:513:28)
Availability: Online Device type: Router Zigbee Model: lumi.switch.n2aeu1 Zigbee Manufacturer: LUMI Description: Aqara smart wall switch H1 EU (with neutral, double rocker) Support status: Supported Firmware build date: 11-10-2021 Manufacturer: Xiaomi Model: WS-EUK04 Interview completed: True
Already fixed in the dev branch
I just tried this again on the dev branch by installing Zigbee2MQTT Edge in Home Assistant. The issue doesn't seem to be fixed. See screenshots:
I have the same issue!
+1 same issue here
Pushed another fix, please try again.
Changes will be available in the dev branch in a few hours from now.
Pushed another fix, please try again.
Changes will be available in the dev branch in a few hours from now.
Tested with : 1.34.0-dev commit: f11eb24
Error:
Zigbee2MQTT:debug 2023-12-06 21:47:45: Received MQTT message on 'zigbee2mqtt/Switch_Light Toilet Down/set' with data '{"operation_mode_left":"decoupled"}'
Zigbee2MQTT:debug 2023-12-06 21:47:45: Publishing 'set' 'operation_mode' to 'Switch_Light Toilet Down'
Zigbee2MQTT:error 2023-12-06 21:47:45: Publish 'set' 'operation_mode' to 'Switch_Light Toilet Down' failed: 'Error: undefined is not a object, got string ("decoupled")'
Zigbee2MQTT:debug 2023-12-06 21:47:45: Error: undefined is not a object, got string ("decoupled")
at Object.assertObject (/app/node_modules/zigbee-herdsman-converters/src/lib/utils.ts:517:15)
at Object.convertSet (/app/node_modules/zigbee-herdsman-converters/src/converters/toZigbee.ts:2501:19)
at Publish.onMQTTMessage (/app/lib/extension/publish.ts:249:52)
at EventEmitter.emit (node:events:525:35)
at EventBus.emitMQTTMessage (/app/lib/eventBus.ts:109:22)
at MQTT.onMessage (/app/lib/mqtt.ts:141:27)
at WebSocket.
Having the same issue still.
@AkshayRao27 Try again after version 16.2.0 is released later today. https://github.com/Koenkk/zigbee-herdsman-converters/releases
@AkshayRao27 Try again after version 16.2.0 is released later today. https://github.com/Koenkk/zigbee-herdsman-converters/releases
I've reinstall Z2M Edge, but only the commit got updated. How do you force 16.2 update with HA ?
Thank you
Just did a quick test with 16.2 The error message has gone away now and I can set the switch to decoupled Mode. However, even after setting it to decoupled it is still behaving like a relay - how can I figure out why exactly this may be happening? What troubleshooting info would be helpful?
@AkshayRao27 Try again after version 16.2.0 is released later today. https://github.com/Koenkk/zigbee-herdsman-converters/releases
I've reinstall Z2M Edge, but only the commit got updated. How do you force 16.2 update with HA ?
Thank you
The 16.2.0 release is for the converters library. The latest commit on the Z2M Edge (dev) updates the dependency of said library to 16.2.0. If you are in 1.34.0-dev commit: cb50942 on Edge, you are good to go.
I was able to set decoupled mode, but I'm not physically next to the switch (yet) to confirm is not working as a relay. @AkshayRao27 can you confirm you have "Mode switch": "fast_mode"? I think you have to have it on fast_mode (I've read it in some Reddit thread, so take it with a grain of salt).
can you confirm you have "Mode switch": "fast_mode"?
There's no option in the frontend for checking this. I tried using MQTT Explorer to issue {"mode_switch": ""}
to zigbee2mqtt/Bedroom Switch/get
but it doesn't do anything in MQTT Explorer.
can you confirm you have "Mode switch": "fast_mode"?
There's no option in the frontend for checking this. I tried using MQTT Explorer to issue
{"mode_switch": ""}
tozigbee2mqtt/Bedroom Switch/get
but it doesn't do anything in MQTT Explorer.
Yes, there is.
I've been able to test and decoupled mode works in the sense that it no longer acts as a physical switch, but now when I bind the switch to a group (can't do it directly to a device for some reason), does not work.
If someone knows a workaround for the binding, I'll appreciate it. Otherwise, I get the event so I can in the meantime create an automation in Home Assistant (although I prefer binding a thousand times).
Strange. Your layout looks different from mine:
I restarted HA, and now pressing the switch seems to not trigger the relay. I can run automations with the "single left" action.
If I use the state switch either in the Zigbee2MQTT or in the MQTT integration in Home Assistant then the switch continues to act like a relay. Is this intended behaviour?
With the switch in decoupled mode, the LED on the switch never turns off. If I toggle the "Flip indicator light" option, then the LED never turns on at all - is this intended behaviour too?
one more here from me: (Aqara smart wall switch H1 EU (with neutral, double rocker) (WS-EUK04))
and this for the power:
@KMTsvetanov Can you check if your Edge build has updated correctly? I have the same switch ("Bedroom Switch" from the screenshot in my previous reply) and decoupled mode is working for me on this version of edge: I had to reinstall the Edge addon twice (including the whole "check for updates" thing in the addon store in HA) and then restart HA completely before decoupled mode started working for me.
@AkshayRao27 for me it's this:
I'm new to this and don't know how to switch to dev version (if this is what you are asking) If yes, I'm all ears.
Clicking on "unknown" redirects me to: https://github.com/Koenkk/zigbee2mqtt/commit/unknown 404 page not found
for me it's this:
Yup, that's the issue then. The 'operation_mode' thing isn't working on the release branch right now and has only been fixed on the latest version of the dev branch.
don't know how to switch to dev version
It's VERY easy! If you're running Home Assistant:
Verify that you are on the version that I posted above - the decoupled mode should ideally work for you then :)
@KMTsvetanov assuming you are using a home assistant addon:
You are using the 'normal' addon of Z2M, you need to stop that addon and install Zigbee2Mqtt Edge one. To do so, go to the addons store in HomeAssistant, click on 'Check for Updates' and the right top corner menu, give a few seconds and install the Edge addon.
edit: AkshayRao27 instructions are better than mine, we published our comments at the same time.
@AkshayRao27 ok tested. Now:
1 ### Question (maybe bug): I can't make trigger for clicking
Regarding the trigger for clicking:
You are using the action of the physical switch (that won't work when clicking because is on decoupled mode). That will only trigger when you manually, from the UI, switch the relay on/off.
I have created this automation, sharing in case it helps:
alias: Control interruptores (temporal)
description: ""
trigger:
- platform: state
entity_id:
- sensor.playroom_interruptor_action
- sensor.cuarto_interruptor_action
- sensor.bano_interruptor_action
- sensor.vestidor_interruptor_action
- sensor.aseo_interruptor_action
to: single
condition: []
action:
- service: light.toggle
target:
entity_id: >-
{{ 'light.' ~
trigger.to_state.entity_id.split('.')[1].split('_')[0].replace('ñ', 'n')
~ '_techo' }}
mode: queued
max: 10
The important take away here is that you have to use as trigger for your automation the state of your_name_action when changes to 'single' (there are other options, I'm only using the single click).
My automation reuses code for multiple switches because the lights they are turning on follows the same pattern: name of light to change: light.{name}techo name of the event that operates the light: switch.interruptor{name}_action
I want to emphasize that for me, this automation should be temporal.
Binding to lights directly is not working for me at the moment, don't know the why (it looks like they bind, but then doesn't work, no logs no nothing). I don't know if someone can report that happening to them and if I should open a ticket.
@gloaysa when on 'decoupled' or 'control_relay' mode there are no logs (in HA) when pressing buttons (Light still turns on on control_relay). Still can't get the trigger to work: Tried the entry "sensor.0x54ef44100096461e_action" for single click, even tried for any change... Even in the Developer Tools I can't see the sate change on click for all my testing:
@KMTsvetanov it could be that the device is not responsive or not properly paired? I would try disconnecting it from the zigbee network and connecting it again.
I can say much more than that, my experience with all this is also only at user level.
@gloaysa @AkshayRao27
Maybe a bug?
I found that I need to manually change the state of entity: sensor.0x54ef44100096461e_action to "single_right" in Developer Tools to make it work.. Clicking on the buttons doesn't change the state. Even in the logs you can't see them.
I found what is the problem but now I need a help on how to do it:
https://github.com/Koenkk/zigbee2mqtt/discussions/16573
I need to update my firmware.
I use Zigbee 3.0 USB Dongle Plus. Can you point me to the link with the firmwares for it ?
I'm using the Zigbee 3.0 USB Dongle Plus ZBDONGLE-E (the 5cm in length)
If you are like me this is the way (works):
https://github.com/Koenkk/zigbee2mqtt/discussions/16573#discussioncomment-7807494
Ok it seems its working now. However it only accept to setup controlled our decoupled trough the HA device view instead of Z2M device view. However the behavior is as expected. Thx
When will be released the version with this correction (normal not edge) ?
I'm runing the last edge version , i'm abel to go to decoupled or to relay , howerver on decoupled i can not triger anything ... this is ruining all my routines :/
@Ajhomepn
In case it helps, I'm sharing my automation on Home Assistant. To me, decoupled mode does not allow me to bind the switch to a bulb (or group, for that matter), so I ended using Home Assistant to control it:
alias: Switches Controller (temporal)
description: "Manages all Aqara switches, toggling lights if they haven't been recently turned on."
trigger:
- platform: state
entity_id:
- sensor.playroom_interruptor_action
- sensor.cuarto_interruptor_action
- sensor.bano_interruptor_action
- sensor.aseo_interruptor_action
- sensor.vestidor_interruptor_action
to: single
condition: []
action:
- variables:
room: >-
{{ trigger.to_state.entity_id.split('.')[1].split('_')[0].replace('ñ',
'n') }}
light: "{{ 'light.' ~ room ~ '_techo' }}"
light_last_changed: "{{ (as_timestamp(now()) - as_timestamp(states[light].last_changed)) }}"
- alias: >-
Avoid turning off a light that has just turned on (due to delay of switch
and occupation triggering faster)
if:
- alias: Light hasn't changed in the last second
condition: template
value_template: "{{ light_last_changed > 1 }}"
then:
- service: light.toggle
target:
entity_id: "{{ 'light.' ~ room ~ '_techo' }}"
mode: queued
max: 10
I don't like to repeat myself, so this automation control all switches. The trick here is to follow a pattern on the naming of your switches and lights.
for example, all my switches follow this pattern: sensor.ROOM_SWITCH_action
.
all my lights follow this pattern:light.ROOM_techo
.
Because of that, I'm able to toggle a light by reading the ROOM part of the switch.
If you want something simpler, you could do this for each switch instead:
alias: Switch Controller for YOUR SWITCH
description: "Manages A SWITCH, toggling lights on user input."
trigger:
- platform: state
entity_id:
- sensor.YOUR_SWITCH_action # notice the _action part, that's what you are looking for.
to: single # and also notice this single. This is a single click event
condition: []
action:
- service: light.toggle
target:
entity_id: light.your_light
mode: single
Sorry to reopen the thread, has this been fixed in the latest Z2MQTT version or I still need to install the dev version? Having similar issue using latest firmware Sky connect zigbee dongle, thank you. Zigbee2MQTT version 1.36.0 commit: 2a53b8e5 Coordinator type EZSP v12 Coordinator revision 7.3.2.0 build 212
I confirm, it doesn’t work for me on the stable version either Zigbee2MQTT 1.36.1
EZSP v8
6.10.3.0 build 297
Error 2024-04-14 01:43:12Publish 'set' 'operation_mode' to 'Выключатель прихожая ' failed: 'Error: ZCL command 0x54ef4410008b7064/1 manuSpecificLumi.write({"512":{"value":0,"type":32}}, {"timeout":10000,"disableResponse":false,"disableRecovery":false,"disableDefaultResponse":true,"direction":0,"srcEndpoint":null,"reservedBits":0,"manufacturerCode":4447,"transactionSequenceNumber":null,"writeUndiv":false}) failed (Timeout - 8792 - 1 - 82 - 64704 - 4 after 10000ms)'
Sorry I am new to this, can someone confirm what the desired result is of setting the switch as decoupled.
I have just installed the 3 switch version and set as relay and all lights work fine. I now want to install more switches but need one to toggle on and off in HA but not physically switch the relay and therefore turn the light on. I assume this is decoupled mode.
I'm running z2m not the dev branch and have tried changing the setting in mqtt and checking it in z2m and regardless of what the mode is set to I don't see any changes in the operation.
Are my assumptions correct and is this an ongoing issue?
I could buy a battery powered smart switch instead of the single light switch or wait for it to be fixed.
What happened?
Trying to change the Operation mode on three different models of Aqara H1 switches (Xiaomi WS-EUK01, WS-EUK02, & WS-EUK04) results in an error: WS-EUK01:
Publish 'set' 'operation_mode' to 'Wardrobe Switch' failed: 'Error: undefined is not a object, got string ("decoupled")'
WS-EUK02:Publish 'set' 'operation_mode' to 'Toilet Switch' failed: 'Error: undefined is not a object, got string ("decoupled")''
WS-EUK04:Publish 'set' 'operation_mode' to 'Bathroom Switch' failed: 'Error: undefined is not a object, got string ("decoupled")'
None of the methods that I have tried so far have been able to change the operation mode. I have tried:
zigbee2mqtt/Bathroom Switch/operation_mode/set
&{"operation_mode_left": "decoupled"}
zigbee2mqtt/Bathroom Switch/set
&{"operation_mode_left": "decoupled"}
This may be related to #19960, #19964, and/or #19478, but I'm not sure because those issues were about other models
What did you expect to happen?
When the Operation Mode for a switch is changed in the front end or by manually sending an MQTT Payload, there is no error & the Operation Mode changes to the specified value.
How to reproduce it (minimal and precise)
Via Z2M:
Via MQTT:
Via MQTT Explorer:
{"operation_mode_left": "decoupled"}
tozigbee2mqtt/<Switch_Name>/operation_mode/set
{"operation_mode_left": "decoupled"}
tozigbee2mqtt/<Switch_Name>/set
Zigbee2MQTT version
1.34.0
Adapter firmware version
7.3.1.0 build 0
Adapter
SONOFF ZBDongle-E
Debug log
log.txt