[Edge Drivers] Issue with Zigbee Switch driver (status in the app)

hi im having an issue with the zigbee switch driver
the issue is the sonoff zbmini has a conection for a switch on it when the switch is used the device works but does not show the change in status in the smartthings app ,
even the physical switch on the mini didnt change the status in the app.
here is a log
thanks
martin
│ 21 │ f2e891c6-00cc-446c-9192-8ebda63d9898 │ Zigbee Switch │
? Select a driver. 21
2022-07-25T16:34:48.142621607+00:00 DEBUG Zigbee Switch driver device thread event handled
2022-07-25T16:34:48.691889482+00:00 TRACE Zigbee Switch Received event with handler zigbee
2022-07-25T16:34:48.697089649+00:00 INFO Zigbee Switch <ZigbeeDevice: 63da800a-1c98-43a7-8e3a-122180c5fa5d [0xDD27] (SONOFF Switch)> received Zigbee message: < ZigbeeMessageRx || type: 0x00, < AddressHeader || src_addr: 0xDD27, src_endpoint: 0x01, dest_addr: 0x0000, dest_endpoint: 0x01, profile: 0x0104, cluster: OnOff >, lqi: 0xFF, rssi: -72, body_length: 0x0007, < ZCLMessageBody || < ZCLHeader || frame_ctrl: 0x08, seqno: 0x65, ZCLCommandId: 0x0A >, < ReportAttribute || < AttributeRecord || AttributeId: 0x0000, DataType: Uint8, OnOff: true > > > >
2022-07-25T16:34:48.710578941+00:00 TRACE Zigbee Switch Found ZigbeeMessageDispatcher handler in zigbee_switch
2022-07-25T16:34:48.713606232+00:00 INFO Zigbee Switch Executing ZclClusterAttributeValueHandler: cluster: OnOff, attribute: OnOff
2022-07-25T16:34:48.717511732+00:00 INFO Zigbee Switch <ZigbeeDevice: 63da800a-1c98-43a7-8e3a-122180c5fa5d [0xDD27] (SONOFF Switch)> emitting event: {“attribute_id”:“switch”,“capability_id”:“switch”,“component_id”:“main”,“state”:{“value”:“on”}}
2022-07-25T16:34:48.727634649+00:00 DEBUG Zigbee Switch SONOFF Switch device thread event handled
2022-07-25T16:34:51.740331066+00:00 TRACE Zigbee Switch Received event with handler zigbee
2022-07-25T16:34:51.747761149+00:00 INFO Zigbee Switch <ZigbeeDevice: 63da800a-1c98-43a7-8e3a-122180c5fa5d [0xDD27] (SONOFF Switch)> received Zigbee message: < ZigbeeMessageRx || type: 0x00, < AddressHeader || src_addr: 0xDD27, src_endpoint: 0x01, dest_addr: 0x0000, dest_endpoint: 0x01, profile: 0x0104, cluster: OnOff >, lqi: 0xFF, rssi: -75, body_length: 0x0007, < ZCLMessageBody || < ZCLHeader || frame_ctrl: 0x08, seqno: 0x66, ZCLCommandId: 0x0A >, < ReportAttribute || < AttributeRecord || AttributeId: 0x0000, DataType: Uint8, OnOff: true > > > >
2022-07-25T16:34:51.760094441+00:00 TRACE Zigbee Switch Found ZigbeeMessageDispatcher handler in zigbee_switch
2022-07-25T16:34:51.763167774+00:00 INFO Zigbee Switch Executing ZclClusterAttributeValueHandler: cluster: OnOff, attribute: OnOff
2022-07-25T16:34:51.767124941+00:00 INFO Zigbee Switch <ZigbeeDevice: 63da800a-1c98-43a7-8e3a-122180c5fa5d [0xDD27] (SONOFF Switch)> emitting event: {“attribute_id”:“switch”,“capability_id”:“switch”,“component_id”:“main”,“state”:{“value”:“on”}}
2022-07-25T16:34:51.777168524+00:00 DEBUG Zigbee Switch SONOFF Switch device thread event handled
listening for logs… do

thanks in advance for any help

Hi, @montyfert!
Can you provide more details, please?

In the logs, I see two “on” events:

  1. At 2022-07-25T16:34:48 which sent the event to the main component.
  2. At 2022-07-25T16:34:51 and another event to the main component was sent

In those times, which action did you perform?
When you click on the on/off button in the app, is the device turned on/off?

in those times i pressed the physical button on the zbmini turning it on and off ,
and yes when i press the button in the app the zbmini turns on and off

thanks
martin

here is another thread that may offer more details: https://community.smartthings.com/t/issue-with-driver-not-sure-how-to-report-it/245322

hope this helps (with zigbee switch driver)
on with physical switch on device changes status in smartthings app

2022-07-26T15:02:34.896383252+00:00 TRACE Zigbee Switch Received event with handler zigbee
2022-07-26T15:02:34.902606127+00:00 INFO Zigbee Switch <ZigbeeDevice: 7d2b3a91-f1fe-40b3-bf45-5d8049ac6702 [0x9692] (SONOFF Switch)> received Zigbee message: < ZigbeeMessageRx || type: 0x00, < AddressHeader || src_addr: 0x9692, src_endpoint: 0x01, dest_addr: 0x0000, dest_endpoint: 0x01, profile: 0x0104, cluster: OnOff >, lqi: 0xFF, rssi: -45, body_length: 0x0007, < ZCLMessageBody || < ZCLHeader || frame_ctrl: 0x08, seqno: 0x0F, ZCLCommandId: 0x0A >, < ReportAttribute || < AttributeRecord || AttributeId: 0x0000, DataType: Uint8, OnOff: true > > > >
2022-07-26T15:02:34.916543002+00:00 TRACE Zigbee Switch Found ZigbeeMessageDispatcher handler in zigbee_switch
2022-07-26T15:02:34.919945377+00:00 INFO Zigbee Switch Executing ZclClusterAttributeValueHandler: cluster: OnOff, attribute: OnOff
2022-07-26T15:02:34.923854335+00:00 INFO Zigbee Switch <ZigbeeDevice: 7d2b3a91-f1fe-40b3-bf45-5d8049ac6702 [0x9692] (SONOFF Switch)> emitting event: {“attribute_id”:“switch”,“capability_id”:“switch”,“component_id”:“main”,“state”:{“value”:“on”}}
2022-07-26T15:02:34.936310293+00:00 DEBUG Zigbee Switch SONOFF Switch device thread event handled
2022-07-26T15:02:50.666180093+00:00 DEBUG Zigbee Switch driver device thread event handled
2022-07-26T15:03:20.676161190+00:00 DEBUG Zigbee Switch driver device thread event handled
listening for logs… -

off with physical switch on device does not change status in app

2022-07-26T15:03:50.676189246+00:00 DEBUG Zigbee Switch driver device thread event handled
2022-07-26T15:04:20.686192594+00:00 DEBUG Zigbee Switch driver device thread event handled
2022-07-26T15:04:29.170861140+00:00 TRACE Zigbee Switch Received event with handler zigbee
2022-07-26T15:04:29.176401681+00:00 INFO Zigbee Switch <ZigbeeDevice: 7d2b3a91-f1fe-40b3-bf45-5d8049ac6702 [0x9692] (SONOFF Switch)> received Zigbee message: < ZigbeeMessageRx || type: 0x00, < AddressHeader || src_addr: 0x9692, src_endpoint: 0x01, dest_addr: 0x0000, dest_endpoint: 0x01, profile: 0x0104, cluster: OnOff >, lqi: 0xFF, rssi: -46, body_length: 0x0007, < ZCLMessageBody || < ZCLHeader || frame_ctrl: 0x08, seqno: 0x10, ZCLCommandId: 0x0A >, < ReportAttribute || < AttributeRecord || AttributeId: 0x0000, DataType: Uint8, OnOff: true > > > >
2022-07-26T15:04:29.194435306+00:00 TRACE Zigbee Switch Found ZigbeeMessageDispatcher handler in zigbee_switch
2022-07-26T15:04:29.197887806+00:00 INFO Zigbee Switch Executing ZclClusterAttributeValueHandler: cluster: OnOff, attribute: OnOff
2022-07-26T15:04:29.202178556+00:00 INFO Zigbee Switch <ZigbeeDevice: 7d2b3a91-f1fe-40b3-bf45-5d8049ac6702 [0x9692] (SONOFF Switch)> emitting event: {“attribute_id”:“switch”,“capability_id”:“switch”,“component_id”:“main”,“state”:{“value”:“on”}}
2022-07-26T15:04:29.216392806+00:00 DEBUG Zigbee Switch SONOFF Switch device thread event handled
2022-07-26T15:04:50.686192817+00:00 DEBUG Zigbee Switch driver device thread event handled
listening for logs… -

on with extra switch connected changes status in app

2022-07-26T15:07:44.360864242+00:00 TRACE Zigbee Switch Received event with handler zigbee
2022-07-26T15:07:44.366390909+00:00 INFO Zigbee Switch <ZigbeeDevice: 7d2b3a91-f1fe-40b3-bf45-5d8049ac6702 [0x9692] (SONOFF Switch)> received Zigbee message: < ZigbeeMessageRx || type: 0x00, < AddressHeader || src_addr: 0x9692, src_endpoint: 0x01, dest_addr: 0x0000, dest_endpoint: 0x01, profile: 0x0104, cluster: OnOff >, lqi: 0xFF, rssi: -52, body_length: 0x0007, < ZCLMessageBody || < ZCLHeader || frame_ctrl: 0x08, seqno: 0x18, ZCLCommandId: 0x0A >, < ReportAttribute || < AttributeRecord || AttributeId: 0x0000, DataType: Uint8, OnOff: true > > > >
2022-07-26T15:07:44.384486159+00:00 TRACE Zigbee Switch Found ZigbeeMessageDispatcher handler in zigbee_switch
2022-07-26T15:07:44.387950242+00:00 INFO Zigbee Switch Executing ZclClusterAttributeValueHandler: cluster: OnOff, attribute: OnOff
2022-07-26T15:07:44.391939909+00:00 INFO Zigbee Switch <ZigbeeDevice: 7d2b3a91-f1fe-40b3-bf45-5d8049ac6702 [0x9692] (SONOFF Switch)> emitting event: {“attribute_id”:“switch”,“capability_id”:“switch”,“component_id”:“main”,“state”:{“value”:“on”}}
2022-07-26T15:07:44.406405076+00:00 DEBUG Zigbee Switch SONOFF Switch device thread event handled
listening for logs… done

off with extra switch connected does not change status in app

2022-07-26T15:09:19.670546234+00:00 TRACE Zigbee Switch Received event with handler zigbee
2022-07-26T15:09:19.676413216+00:00 INFO Zigbee Switch <ZigbeeDevice: 7d2b3a91-f1fe-40b3-bf45-5d8049ac6702 [0x9692] (SONOFF Switch)> received Zigbee message: < ZigbeeMessageRx || type: 0x00, < AddressHeader || src_addr: 0x9692, src_endpoint: 0x01, dest_addr: 0x0000, dest_endpoint: 0x01, profile: 0x0104, cluster: OnOff >, lqi: 0xFF, rssi: -47, body_length: 0x0007, < ZCLMessageBody || < ZCLHeader || frame_ctrl: 0x08, seqno: 0x1B, ZCLCommandId: 0x0A >, < ReportAttribute || < AttributeRecord || AttributeId: 0x0000, DataType: Uint8, OnOff: true > > > >
2022-07-26T15:09:19.690655966+00:00 TRACE Zigbee Switch Found ZigbeeMessageDispatcher handler in zigbee_switch
2022-07-26T15:09:19.693856906+00:00 INFO Zigbee Switch Executing ZclClusterAttributeValueHandler: cluster: OnOff, attribute: OnOff
2022-07-26T15:09:19.697974430+00:00 INFO Zigbee Switch <ZigbeeDevice: 7d2b3a91-f1fe-40b3-bf45-5d8049ac6702 [0x9692] (SONOFF Switch)> emitting event: {“attribute_id”:“switch”,“capability_id”:“switch”,“component_id”:“main”,“state”:{“value”:“on”}}
2022-07-26T15:09:19.714668912+00:00 DEBUG Zigbee Switch SONOFF Switch device thread event handled
2022-07-26T15:09:20.751137377+00:00 DEBUG Zigbee Switch driver device thread event handled
listening for logs… done

355016f43df2b85e9433ef1c0e4e83d9778157f2_2_689x500

Thank you for the info, @montyfert
I keep seeing the device is always reporting OnOff: true which translates to an “ON” event`, that’s why it seems the status isn’t being updated, because it’s the same event every time.

We cannot verify what can be happening with the device as we don’t control the content of their reports and we don’t own one.
What we can do, is ask if there’s another Community member with this device and compare both behaviors…
I know a post where we can ask, so I’ll tag you there.

Hello, do you have a fix? I have the same problem here. Thanks

Welcome to the SmartThings Community, @Denz_Modz!

Do you mean your device reports the status as “on” when it’s “off”? Have you verified the following?

  • It’s using an Edge driver
  • Is it receiving another message that can help us identify this is a “false” true?

The issue here is that the device itself is sending this value:

The value OnOff: true identifies the current status of the device and “true” is known as being the value for “on”.

We need your help to make more tests and observations about the device’s behavior, so we can know how we can identify this “true” value isn’t real. Otherwise, the device in the app will continue reporting this because that’s what the driver receives and we’ll have to find another workaround.

@nayelyz I don’t really speak Zigbee but shouldn’t the OnOff attribute have a boolean type and not a Uint8?

Might this confuse the Edge driver because 0 and 1 are both true in Lua, whereas Groovy sees them as false and true? Or is that nonsense?

2 Likes

I also got it sometimes. , and with groovy handler also. The status on the tile is wrong, but in the tile its ok most of the time.

Hi @nayelyz

In my zigbee switch Mc driver I put some marks to print the value of the on-off attribute received in the handler and to be able to analyze what was happening with the @Paul_Oliver sonoff zigbee mini last January.

In this posts everything is explained and the solution I did.

The sonoff of @Paul_Oliver still working fine with my driver.

The problem they have now with these devices of @montyfert is that only a value of 0 or 1 is received, I do not know why, and therefore my driver intentionally does not emit on-off events and the stock driver does not work because the default on-off handler does not correctly interpret the value 0 and 1.
@orangebucket may have given a solid hint

@Mariano_Colmenarejo

Yes my Sonoff ZBMinis are still working good with your driver.

1 Like

Thank you for this, @orangebucket.
Yes, the Zigbee cluster specification says this attribute must be boolean type:

This means the device is sending an incorrect data type, so, to get it working, we need your help, @Mariano_Colmenarejo to define custom handlers in a sub-driver so you don’t affect the functionality of other devices as you mentioned to “translate” the status according to the data sent by the device.
The team will investigate more details about this case and see what we can do.

i tried my zbmini the other day and its working fine now with either the stock edge driver or the mc edge driver.

the problem i had originally was when using the physical switch on the zbmini or a wired switch connected to s1 and s2 when they were switched on or off via the physican and the wired switch the status of the switch in the app was not changing .
thats working fine now dont know whats changed but it works great .

1 Like

I dont know so much about this. I just want to link my sonoff zbmini :sweat_smile:

Hi @Paul_Oliver, @montyfert, @Denz_Modz

Please can you try this test version zigbee Switch Mc-Test?

┌─────────────┬──────────────────────────────────────┐
│ Name        │ Zigbee Switch Mc-Test                │
│ Version     │ 2022-08-09T09:42:23.075092181        │
└─────────────┴──────────────────────────────────────┘

The on_off handler has been corrected so that it works well with true (1), false (0) values of the sonoff Mini, which devices send all the values as @Paul_Oliver devices and those that send only values 0 and 1.

I have tried with a Lidl switch, which does not have that problem and everything continues to work fine.

I hope it works well for sonoff mini too

If you can provide a log with on-off off-on changes we can see if the conversion from 0 to false and 1 to true is working. I put print mark to see it.

Hi @nayelyz

The only thing I did was add this code to the on_off default handler before emitting the event.

It should work for all switches.

If value.value == 1 then
  value.value = true
elseif value.value == 0 then
  value.value == false
end

local attr = capabilities.switch.switch
  device:emit_event_for_endpoint(zb_rx.address_header.src_endpoint.value, value.value and attr.on() or attr.off())
2 Likes

Mariano, Do you have a tutorial how i can do this? I’m not a prof in this stuff :sweat_smile: sorry

Hi @Denz_Modz

I could tell you but the other day I bothered to write you a step by step procedure so that you could solve your problem and reconnect your switch to a DTH and I did not receive any response from you.

I think the best thing I can do in this case is you search the forum for how to do it, it’s everywhere and it’s very easy.

Open the forum search and type: SmartThings Edge Device Drivers and it will show you the official tutorial and many more.

The invitation to my shared channel in case you want to use it

https://api.smartthings.com/invitation-web/accept?id=6b68563b-1905-4654-8d2b-e677a2997424

2 Likes

Hi!
Here are the instructions to accept a channel invitation and install drivers:

In the case of drivers created by Community members like the incredible @Mariano_Colmenarejo, you need to find the original post of their Release because there’s where they share the invitation link.

Please, let me know if you need help, you can send a DM as well.

1 Like