[Edge drivers] Driver for TCPi A19 Zigbee smart bulbs

Hi @nayelyz,

It wouldn’t surprise me that these bulbs might behave outside the spec - they were used on a now-defunct Zigbee home automation system from several years ago, and don’t seem to be supported by the manufacturer (TCP) for updates. Thousands were manufactured, and are still sold on places like ebay, usually with the “SAGE” name attached. There are A19, BR30, and PAR38 versions, all have the same firmware issues.

It looks like the “old” groovy/DTH architecture was slightly more forgiving for devices like this, even if the device is not implemented correctly.

In any event, @Mariano_Colmenarejo has been very helpful in getting a test driver available that does work for setting dimming levels - which really is the only thing I was hoping to get back. The transition-time “extra” features are a fun thing to try out, but in the end not as important as supporting the dimming feature (at least for me).

@Mariano_Colmenarejo,

I tried the progressive setting of 1 minute, that works better (no network/server error). It does even show OFF after being a while at 0%, which is good!

I am not surprised that these bulbs might be zll (or non-standard zigbee), but I had never heard of that until you mentioned it. The firmware is from around 2015, not updated since around that time.

I got excited that the transition feature might work, as I had only had that on some (newer) GE Z-wave dimmers. In the end, it’s a neat feature, but if transition times don’t work with these old, orphaned, unsupported zll bulbs, I would certainly never complain! :slight_smile:

I applied your -TEST driver to a group of 3 A19 bulbs with a group dimmer, and they work perfectly! This is actually a big use case for me, I have many groups of these lights that dim for things like low outdoor lighting, watching TV, etc.

Thanks once again for your very kind help, I very much appreciate both you and @nayelyz looking into my very small use case!

Hi @scasagrande

Try with this driver version

───────────────────────────────────────────────────
Name Zigbee Light Multifunction Mc-TEST
Version 2023-08-11T10:02:31.749546283
───────────────────────────────────────────────────

@Mariano_Colmenarejo,

Not sure what you’ve done with this, but it’s getting more stable!

ON/OFF (transition=0), Dimmer (transition =0)
Seems to work weel, except for one strange case. Moving the dimmer to 0% correctly sets the On/Off switch to OFF, which is nice! However, when trying to turn ON again (from switch) brings it just to 1%, not to the previous setting (whatever it was). Using On/Off to OFF instead of dimmer to 0% correctly brings the light back to it’s previous setting when hitting ON again. So, it looks like using the dimmer to set to 0% somehow loses the previous dimmer level, which may be understandable. It may also explain some of what I mention below.

Dimmer (transition=3s)
Everything works perfectly for dimmer transitions.

ON/OFF (transition=3s)
This doesn’t seem to work for the ON case. For example, I set ON/OFF transition to 3s. Turn OFF works fine, but if I go to turn ON again, bulb appears to go to 1%, dimmer display stays at 0%, switch shows ON. Similar to when I had used the dimmer to set to 0% above.

Looking at the logs, it appears to process a heartbeat/status message every 30s to a few minutes, but I’m not sure what is going on.

Progressive ON/OFF (1m)
Progressive on/off (1m) seem to work well for the OFF case, but when turning ON, I did get the “network/server” error after about 30s, bulb continues to 100%, dimmer shows 100%, but switch incorrectly shows OFF. Moving the dimmer still works, but switch remains in OFF setting, although the bulb is on and changing levels. Hitting the ON/OFF button to turn it on runs the progressive ON sequence again (from 0% to 100%). The only way I can get back to correct status is to turn off the progressive feature, turn on/off the light (it seems to re-sync ok), otherwise the app is stuck in a state where the switch shows OFF, the bulb is at 100%, dimmer at 100%, and hitting the ON/OFF button just goes through the progressive ON sequence again. I don’t know if there is a race condition with a 30s heartbeat/polling mentioned above.

If there’s any other use cases you want me to test (or logs to capture), please let me know.

When you press Off, the driver saves the current value of level to use as the target level for the next turn On.

When you set the slider to 0% the current level is not saved and 1% is saved as the minimum level for the next turn On. I changed this and save the current level as when Off is pressed in this driver version

───────────────────────────────────────────────────
 Name         Zigbee Light Multifunction Mc-TEST   
 Version      2023-08-11T17:00:24.71424042
───────────────────────────────────────────────────

This could be because he has saved the value 1% as the target of the next turn On

I don’t see any sense in this, if the values level on start, level on end and dimming time are well configured.

When you have Progressive On and Off activated at the same time, then depending on what you have selected in preference “If Switch Pushed when Running” behaviors may occur that may seem unexpected, but have their logic, what should not happen are errors.

By the way, when the turn on, off or level change with transition times is performed, do you see in the level slider any intermediate level through which the dispositive is informed?

If in preferences active “Show Logs Debug Prints in CLI” then in the CLI logs more data is shown for debugging

@Mariano_Colmenarejo,

When you set the slider to 0% the current level is not saved and 1% is saved as the minimum level for the next turn On. I changed this and save the current level as when Off is pressed in this driver version

Yes, this seems to have made this better, but it’s still a little strange. I’ve seen it work perfectly many times, and then I’ve seen it go back to the 1% level on turn on case. This is with transition to new level=0s, and on/off=3s. It almost seems like there is a race condition here, sometimes it works, sometimes it doesn’t.

As for Progressive on/off, I seem to still have some problems.

Progressive settings are =1m, start at 1%, end at 100% (for ON case), =1m and end at 0% for OFF case. I haven’t changed these since you told me that 0.1m could be too short.

Turning OFF, it goes down to 0%, but I’ve seen a couple of random behaviors. Sometimes the ON/OFF button turns OFF immediately when I initially push the button to turn it off, then it turns itself back on as the slider goes from 100-0 (it goes to ON right away). Sometimes it stays OFF until it goes to 0%.

If I hit the ON button, it goes from 0% to 100% over one minute. Sometimes it does it successfully, sometimes it gives the network/server error about 1/2 way through. If I get the error, it will continue to 100%, but the ON/OFF switch stays at OFF position, and this is a strange state - pushing the ON/OFF button again (turning it on) brings you immedately back to 0% and then ramps up to 100% over a minute (usually with the error, so you’re caught in a loop again). I can get out of this state by sliding the dimmer all the way to 0%, or disabling the progressive feature.

When you have Progressive On and Off activated at the same time, then depending on what you have selected in preference “If Switch Pushed when Running” behaviors may occur that may seem unexpected, but have their logic, what should not happen are errors.

During these progressive tests, I’m not pushing any buttons during the minute it transitions from 0-100 or 100-0 over the minute.

By the way, when the turn on, off or level change with transition times is performed, do you see in the level slider any intermediate level through which the dispositive is informed?

Yes, I see the level slider move. If I have progressive =1m, it steps about 1% per second (quite smooth). If I use the transition times of a few seconds, it might only update once or twice per second as it moves to 0 (going off) or the previous setting (going on).

We may be fighting a losing battle here. I’m very happy without the transition times or progressive features working if that’s where we need to go, but it seems to becoming a crusade (for both of us) to get the last strange behavior squashed! :slight_smile: Those features are very cool, and making them work for my case may help others, and I’m happy to help test it.
But if you don’t think it is possible, I will certainly not complain. Having it work as a normal light/dimmer (as it does now), with no transition times or progressive features, is fine with me if that’s what it takes.

Hi @nayelyz @scasagrande

I was also looking at an outdated zigbee documentation.

Should be ignored on legacy devices with defaults =0 options arguments sent

It seems that this device does not meet that requirement.



@nayelyz, @Mariano_Colmenarejo,

Thanks very much for your research and efforts to get these bulbs to work again. It is possible that they may have been implemented from a time before this latest Zigbee specification. Certainly, a newer or better supported device would have followed this spec!

It is interesting that transitions almost works, certainly the (direct) level setting works fine with your -TEST driver. I had never tried the transition features before (not even available to try), so of course I’m not upset if they don’t work now.

Where does that leave me? Can I just use this -TEST driver for my case, or perhaps publish this driver for others who use these bulbs? Modify the “normal” driver with a special case or setting/option for non-compliant bulbs? (There are at least 3 different TCPi bulb types, A19, BR30, PAR38, and perhaps other old Zigbee/ZLL bulbs may also have the issue, just unreported).

Thank you!

Steve Casagrande

I can leave this TEST driver in my channel and rename it to TCPi instead of TEST or leave the code on github and you modify it to your liking.

I have tested an OSRAM classic bulb with the options for TCPi and it works exactly the same as with the Mc driver.
There is nothing that I see that can improve the operation of the driver for your light bulbs, but if you send me a log with the CLI of what does not work, I could analyze what is happening

@Mariano_Colmenarejo,

If it’s easy enough to have both options (a TCPi driver in your channel as well as availability on Github), I’d appreciate that. I haven’t done any edge driver development yet, but it might be something I’d like to try. I did do DTHs and apps with groovy, and found it interesting, but the Edge environment is a little different. (The apps I previously wrote have now been “dumbed down” using standard smartthings capabilites, and implemented with a variety of virtual switches and timed actions.)

I’m trying to reproduce the various errors I’ve seen with both transitions and progressive; they appear to be random (race conditions, perhaps), so I’ll work a bit to see if I can nail down exactly where the errors occur. The log files can get pretty big when trying to reproduce it, and I want to see exactly where it is happening, and figure out how to reproduce it consistently.

@Mariano_Colmenarejo,

OK, spent a minute to capture logs for one error case. Set ON/OFF transition=5s, bulb started ON at 100% when I started capturing logs. Turn off, then when bulb is off and app switch shows OFF, I hit ON. It goes to 1%, switch shows ON, dimmer shows 0% (but bulb looks like it’s at 1%).

Sorry for the long logs, it’s everything I have from turning OFF to turning ON.

This feature works some of the time, it really does seem random.

? Select a driver. 30
2023-08-14T21:18:51.815923802+00:00 TRACE Zigbee Light Multifunction Mc-TEST Received event with handler zigbee
2023-08-14T21:18:51.816826136+00:00 INFO Zigbee Light Multifunction Mc-TEST <ZigbeeDevice: c4a22c93-be5d-4209-af4d-a5cbcf10478f [0xAEB5] (TCPi Bulb)> received Zigbee message: < ZigbeeMessageRx || type: 0x02, < AddressHeader || src_addr: 0xAEB5, src_endpoint: 0x00, dest_addr: 0x0000, dest_endpoint: 0x00, profile: 0x0000, cluster: OnOff >, lqi: 0xFD, rssi: -64, body_length: 0x0009, < ZDOMessageBody || < ZDOHeader || seqno: 0x68 >, GenericBody: FD FF 04 01 01 19 00 00 > >
2023-08-14T21:18:51.823122427+00:00 PRINT Zigbee Light Multifunction Mc-TEST zll_xy >>>>>> no
2023-08-14T21:18:51.823678094+00:00 DEBUG Zigbee Light Multifunction Mc-TEST TCPi Bulb device thread event handled
2023-08-14T21:18:51.865432969+00:00 TRACE Zigbee Light Multifunction Mc-TEST Received event with handler zigbee
2023-08-14T21:18:51.866248261+00:00 INFO Zigbee Light Multifunction Mc-TEST <ZigbeeDevice: c4a22c93-be5d-4209-af4d-a5cbcf10478f [0xAEB5] (TCPi Bulb)> received Zigbee message: < ZigbeeMessageRx || type: 0x00, < AddressHeader || src_addr: 0xAEB5, src_endpoint: 0x00, dest_addr: 0x0000, dest_endpoint: 0x00, profile: 0x0000, cluster: PowerConfiguration >, lqi: 0xFF, rssi: -65, body_length: 0x0005, < ZDOMessageBody || < ZDOHeader || seqno: 0x69 >, GenericBody: 00 00 00 00 > >
2023-08-14T21:18:51.872499636+00:00 PRINT Zigbee Light Multifunction Mc-TEST zll_xy >>>>>> no
2023-08-14T21:18:51.873057969+00:00 DEBUG Zigbee Light Multifunction Mc-TEST TCPi Bulb device thread event handled
2023-08-14T21:18:59.254939259+00:00 TRACE Zigbee Light Multifunction Mc-TEST Received event with handler capability
2023-08-14T21:18:59.269263884+00:00 INFO Zigbee Light Multifunction Mc-TEST <ZigbeeDevice: c4a22c93-be5d-4209-af4d-a5cbcf10478f [0xAEB5] (TCPi Bulb)> received command: {“command”:“off”,“args”:{},“capability”:“switch”,“positional_args”:{},“component”:“main”}
2023-08-14T21:18:59.270364634+00:00 PRINT Zigbee Light Multifunction Mc-TEST zll_xy >>>>>> no
2023-08-14T21:18:59.271059384+00:00 PRINT Zigbee Light Multifunction Mc-TEST zll_xy >>>>>> no
2023-08-14T21:18:59.271906217+00:00 TRACE Zigbee Light Multifunction Mc-TEST Found CapabilityCommandDispatcher handler in zigbee_light_multifunctions
2023-08-14T21:18:59.272617217+00:00 PRINT Zigbee Light Multifunction Mc-TEST Turn Off handler >>>>>>>>>>>
2023-08-14T21:18:59.273486092+00:00 PRINT Zigbee Light Multifunction Mc-TEST Turn OFF >>>>>>>>>>>>>>>>
2023-08-14T21:18:59.274372467+00:00 INFO Zigbee Light Multifunction Mc-TEST <ZigbeeDevice: c4a22c93-be5d-4209-af4d-a5cbcf10478f [0xAEB5] (TCPi Bulb)> sending Zigbee message: < ZigbeeMessageTx || Uint16: 0x0000, < AddressHeader || src_addr: 0x0000, src_endpoint: 0x01, dest_addr: 0xAEB5, dest_endpoint: 0x01, profile: 0x0104, cluster: Level >, < ZCLMessageBody || < ZCLHeader || frame_ctrl: 0x01, seqno: 0x00, ZCLCommandId: 0x04 >, < MoveToLevelWithOnOff || level: 0x00, transition_time: 0x001E > > >
2023-08-14T21:18:59.295272384+00:00 DEBUG Zigbee Light Multifunction Mc-TEST TCPi Bulb device thread event handled
2023-08-14T21:18:59.307982425+00:00 DEBUG Zigbee Light Multifunction Mc-TEST TCPi Bulb device thread event handled
2023-08-14T21:18:59.311530134+00:00 DEBUG Zigbee Light Multifunction Mc-TEST TCPi Bulb device thread event handled
2023-08-14T21:18:59.357176259+00:00 TRACE Zigbee Light Multifunction Mc-TEST Received event with handler zigbee
2023-08-14T21:18:59.358002050+00:00 INFO Zigbee Light Multifunction Mc-TEST <ZigbeeDevice: c4a22c93-be5d-4209-af4d-a5cbcf10478f [0xAEB5] (TCPi Bulb)> received Zigbee message: < ZigbeeMessageRx || type: 0x00, < AddressHeader || src_addr: 0xAEB5, src_endpoint: 0x01, dest_addr: 0x0000, dest_endpoint: 0x01, profile: 0x0104, cluster: Level >, lqi: 0xFC, rssi: -65, body_length: 0x0005, < ZCLMessageBody || < ZCLHeader || frame_ctrl: 0x18, seqno: 0x34, ZCLCommandId: 0x0B >, < DefaultResponse || cmd: 0x04, ZclStatus: SUCCESS > > >
2023-08-14T21:18:59.370085134+00:00 PRINT Zigbee Light Multifunction Mc-TEST zll_xy >>>>>> no
2023-08-14T21:18:59.377848134+00:00 DEBUG Zigbee Light Multifunction Mc-TEST TCPi Bulb device thread event handled
2023-08-14T21:18:59.405669175+00:00 TRACE Zigbee Light Multifunction Mc-TEST Received event with handler zigbee
2023-08-14T21:18:59.408594092+00:00 INFO Zigbee Light Multifunction Mc-TEST <ZigbeeDevice: c4a22c93-be5d-4209-af4d-a5cbcf10478f [0xAEB5] (TCPi Bulb)> received Zigbee message: < ZigbeeMessageRx || type: 0x00, < AddressHeader || src_addr: 0xAEB5, src_endpoint: 0x01, dest_addr: 0x0000, dest_endpoint: 0x01, profile: 0x0104, cluster: Level >, lqi: 0xFC, rssi: -65, body_length: 0x0007, < ZCLMessageBody || < ZCLHeader || frame_ctrl: 0x18, seqno: 0xB9, ZCLCommandId: 0x0A >, < ReportAttribute || < AttributeRecord || AttributeId: 0x0000, DataType: Uint8, CurrentLevel: 0xF5 > > > >
2023-08-14T21:18:59.426721759+00:00 PRINT Zigbee Light Multifunction Mc-TEST zll_xy >>>>>> no
2023-08-14T21:18:59.427686300+00:00 PRINT Zigbee Light Multifunction Mc-TEST zll_xy >>>>>> no
2023-08-14T21:18:59.428573384+00:00 TRACE Zigbee Light Multifunction Mc-TEST Found ZigbeeMessageDispatcher handler in zigbee_light_multifunctions
2023-08-14T21:18:59.429265259+00:00 INFO Zigbee Light Multifunction Mc-TEST Executing ZclClusterAttributeValueHandler: cluster: Level, attribute: CurrentLevel
2023-08-14T21:18:59.432736550+00:00 PRINT Zigbee Light Multifunction Mc-TEST <<<< emit Level >>>>
2023-08-14T21:18:59.433425509+00:00 INFO Zigbee Light Multifunction Mc-TEST <ZigbeeDevice: c4a22c93-be5d-4209-af4d-a5cbcf10478f [0xAEB5] (TCPi Bulb)> emitting event: {“capability_id”:“switchLevel”,“component_id”:“main”,“attribute_id”:“level”,“state”:{“value”:96}}
2023-08-14T21:18:59.436266384+00:00 DEBUG Zigbee Light Multifunction Mc-TEST TCPi Bulb device thread event handled
2023-08-14T21:19:00.816609175+00:00 TRACE Zigbee Light Multifunction Mc-TEST Received event with handler zigbee
2023-08-14T21:19:00.817587675+00:00 INFO Zigbee Light Multifunction Mc-TEST <ZigbeeDevice: c4a22c93-be5d-4209-af4d-a5cbcf10478f [0xAEB5] (TCPi Bulb)> received Zigbee message: < ZigbeeMessageRx || type: 0x00, < AddressHeader || src_addr: 0xAEB5, src_endpoint: 0x01, dest_addr: 0x0000, dest_endpoint: 0x01, profile: 0x0104, cluster: Level >, lqi: 0xFF, rssi: -66, body_length: 0x0007, < ZCLMessageBody || < ZCLHeader || frame_ctrl: 0x18, seqno: 0x46, ZCLCommandId: 0x0A >, < ReportAttribute || < AttributeRecord || AttributeId: 0x0000, DataType: Uint8, CurrentLevel: 0x7F > > > >
2023-08-14T21:19:00.835339967+00:00 PRINT Zigbee Light Multifunction Mc-TEST zll_xy >>>>>> no
2023-08-14T21:19:00.836171050+00:00 PRINT Zigbee Light Multifunction Mc-TEST zll_xy >>>>>> no
2023-08-14T21:19:00.837102800+00:00 TRACE Zigbee Light Multifunction Mc-TEST Found ZigbeeMessageDispatcher handler in zigbee_light_multifunctions
2023-08-14T21:19:00.837997508+00:00 INFO Zigbee Light Multifunction Mc-TEST Executing ZclClusterAttributeValueHandler: cluster: Level, attribute: CurrentLevel
2023-08-14T21:19:00.841227967+00:00 PRINT Zigbee Light Multifunction Mc-TEST <<<< emit Level >>>>
2023-08-14T21:19:00.842125717+00:00 INFO Zigbee Light Multifunction Mc-TEST <ZigbeeDevice: c4a22c93-be5d-4209-af4d-a5cbcf10478f [0xAEB5] (TCPi Bulb)> emitting event: {“capability_id”:“switchLevel”,“component_id”:“main”,“attribute_id”:“level”,“state”:{“value”:50}}
2023-08-14T21:19:00.844676008+00:00 DEBUG Zigbee Light Multifunction Mc-TEST TCPi Bulb device thread event handled
2023-08-14T21:19:02.816716925+00:00 TRACE Zigbee Light Multifunction Mc-TEST Received event with handler zigbee
2023-08-14T21:19:02.817705675+00:00 INFO Zigbee Light Multifunction Mc-TEST <ZigbeeDevice: c4a22c93-be5d-4209-af4d-a5cbcf10478f [0xAEB5] (TCPi Bulb)> received Zigbee message: < ZigbeeMessageRx || type: 0x00, < AddressHeader || src_addr: 0xAEB5, src_endpoint: 0x01, dest_addr: 0x0000, dest_endpoint: 0x01, profile: 0x0104, cluster: Level >, lqi: 0xFF, rssi: -65, body_length: 0x0007, < ZCLMessageBody || < ZCLHeader || frame_ctrl: 0x18, seqno: 0x0F, ZCLCommandId: 0x0A >, < ReportAttribute || < AttributeRecord || AttributeId: 0x0000, DataType: Uint8, CurrentLevel: 0x01 > > > >
2023-08-14T21:19:02.834737716+00:00 PRINT Zigbee Light Multifunction Mc-TEST zll_xy >>>>>> no
2023-08-14T21:19:02.835568050+00:00 PRINT Zigbee Light Multifunction Mc-TEST zll_xy >>>>>> no
2023-08-14T21:19:02.836445550+00:00 TRACE Zigbee Light Multifunction Mc-TEST Found ZigbeeMessageDispatcher handler in zigbee_light_multifunctions
2023-08-14T21:19:02.839428633+00:00 INFO Zigbee Light Multifunction Mc-TEST Executing ZclClusterAttributeValueHandler: cluster: Level, attribute: CurrentLevel
2023-08-14T21:19:02.840671341+00:00 PRINT Zigbee Light Multifunction Mc-TEST <<<< emit Level >>>>
2023-08-14T21:19:02.841541383+00:00 INFO Zigbee Light Multifunction Mc-TEST <ZigbeeDevice: c4a22c93-be5d-4209-af4d-a5cbcf10478f [0xAEB5] (TCPi Bulb)> emitting event: {“capability_id”:“switchLevel”,“component_id”:“main”,“attribute_id”:“level”,“state”:{“value”:0}}
2023-08-14T21:19:02.845183008+00:00 DEBUG Zigbee Light Multifunction Mc-TEST TCPi Bulb device thread event handled
2023-08-14T21:19:06.303203590+00:00 INFO Zigbee Light Multifunction Mc-TEST <ZigbeeDevice: c4a22c93-be5d-4209-af4d-a5cbcf10478f [0xAEB5] (TCPi Bulb)> emitting event: {“capability_id”:“switch”,“component_id”:“main”,“attribute_id”:“switch”,“state”:{“value”:“off”}}
2023-08-14T21:19:06.313152590+00:00 INFO Zigbee Light Multifunction Mc-TEST <ZigbeeDevice: c4a22c93-be5d-4209-af4d-a5cbcf10478f [0xAEB5] (TCPi Bulb)> emitting event: {“capability_id”:“switchLevel”,“component_id”:“main”,“attribute_id”:“level”,“state”:{“value”:0}}
2023-08-14T21:19:06.330363424+00:00 DEBUG Zigbee Light Multifunction Mc-TEST TCPi Bulb device thread event handled
2023-08-14T21:19:06.331828757+00:00 INFO Zigbee Light Multifunction Mc-TEST <ZigbeeDevice: c4a22c93-be5d-4209-af4d-a5cbcf10478f [0xAEB5] (TCPi Bulb)> sending Zigbee message: < ZigbeeMessageTx || Uint16: 0x0000, < AddressHeader || src_addr: 0x0000, src_endpoint: 0x01, dest_addr: 0xAEB5, dest_endpoint: 0x01, profile: 0x0104, cluster: Level >, < ZCLMessageBody || < ZCLHeader || frame_ctrl: 0x00, seqno: 0x00, ZCLCommandId: 0x00 >, < ReadAttribute || AttributeId: 0x0000 > > >
2023-08-14T21:19:06.377956799+00:00 INFO Zigbee Light Multifunction Mc-TEST <ZigbeeDevice: c4a22c93-be5d-4209-af4d-a5cbcf10478f [0xAEB5] (TCPi Bulb)> sending Zigbee message: < ZigbeeMessageTx || Uint16: 0x0000, < AddressHeader || src_addr: 0x0000, src_endpoint: 0x01, dest_addr: 0xAEB5, dest_endpoint: 0x01, profile: 0x0104, cluster: OnOff >, < ZCLMessageBody || < ZCLHeader || frame_ctrl: 0x00, seqno: 0x00, ZCLCommandId: 0x00 >, < ReadAttribute || AttributeId: 0x0000 > > >
2023-08-14T21:19:06.392167132+00:00 DEBUG Zigbee Light Multifunction Mc-TEST TCPi Bulb device thread event handled
2023-08-14T21:19:06.448081882+00:00 TRACE Zigbee Light Multifunction Mc-TEST Received event with handler zigbee
2023-08-14T21:19:06.448912757+00:00 INFO Zigbee Light Multifunction Mc-TEST <ZigbeeDevice: c4a22c93-be5d-4209-af4d-a5cbcf10478f [0xAEB5] (TCPi Bulb)> received Zigbee message: < ZigbeeMessageRx || type: 0x00, < AddressHeader || src_addr: 0xAEB5, src_endpoint: 0x01, dest_addr: 0x0000, dest_endpoint: 0x01, profile: 0x0104, cluster: Level >, lqi: 0xFF, rssi: -65, body_length: 0x0008, < ZCLMessageBody || < ZCLHeader || frame_ctrl: 0x18, seqno: 0x35, ZCLCommandId: 0x01 >, < ReadAttributeResponse || < AttributeRecord || AttributeId: 0x0000, ZclStatus: SUCCESS, DataType: Uint8, CurrentLevel: 0x01 > > > >
2023-08-14T21:19:06.459986715+00:00 PRINT Zigbee Light Multifunction Mc-TEST zll_xy >>>>>> no
2023-08-14T21:19:06.461968840+00:00 PRINT Zigbee Light Multifunction Mc-TEST zll_xy >>>>>> no
2023-08-14T21:19:06.462906715+00:00 TRACE Zigbee Light Multifunction Mc-TEST Found ZigbeeMessageDispatcher handler in zigbee_light_multifunctions
2023-08-14T21:19:06.463600799+00:00 INFO Zigbee Light Multifunction Mc-TEST Executing ZclClusterAttributeValueHandler: cluster: Level, attribute: CurrentLevel
2023-08-14T21:19:06.468620507+00:00 PRINT Zigbee Light Multifunction Mc-TEST <<<< emit Level >>>>
2023-08-14T21:19:06.469310382+00:00 INFO Zigbee Light Multifunction Mc-TEST <ZigbeeDevice: c4a22c93-be5d-4209-af4d-a5cbcf10478f [0xAEB5] (TCPi Bulb)> emitting event: {“capability_id”:“switchLevel”,“component_id”:“main”,“attribute_id”:“level”,“state”:{“value”:0}}
2023-08-14T21:19:06.481612882+00:00 DEBUG Zigbee Light Multifunction Mc-TEST TCPi Bulb device thread event handled
2023-08-14T21:19:06.487632382+00:00 TRACE Zigbee Light Multifunction Mc-TEST Received event with handler zigbee
2023-08-14T21:19:06.488083007+00:00 INFO Zigbee Light Multifunction Mc-TEST <ZigbeeDevice: c4a22c93-be5d-4209-af4d-a5cbcf10478f [0xAEB5] (TCPi Bulb)> received Zigbee message: < ZigbeeMessageRx || type: 0x00, < AddressHeader || src_addr: 0xAEB5, src_endpoint: 0x01, dest_addr: 0x0000, dest_endpoint: 0x01, profile: 0x0104, cluster: OnOff >, lqi: 0xFF, rssi: -65, body_length: 0x0008, < ZCLMessageBody || < ZCLHeader || frame_ctrl: 0x18, seqno: 0x36, ZCLCommandId: 0x01 >, < ReadAttributeResponse || < AttributeRecord || AttributeId: 0x0000, ZclStatus: SUCCESS, DataType: Boolean, OnOff: false > > > >
2023-08-14T21:19:06.498814924+00:00 PRINT Zigbee Light Multifunction Mc-TEST zll_xy >>>>>> no
2023-08-14T21:19:06.499279049+00:00 PRINT Zigbee Light Multifunction Mc-TEST zll_xy >>>>>> no
2023-08-14T21:19:06.499961299+00:00 TRACE Zigbee Light Multifunction Mc-TEST Found ZigbeeMessageDispatcher handler in zigbee_light_multifunctions
2023-08-14T21:19:06.500626965+00:00 INFO Zigbee Light Multifunction Mc-TEST Executing ZclClusterAttributeValueHandler: cluster: OnOff, attribute: OnOff
2023-08-14T21:19:06.506040257+00:00 PRINT Zigbee Light Multifunction Mc-TEST <<<<< Emit on_off >>>>>>
2023-08-14T21:19:06.506709715+00:00 INFO Zigbee Light Multifunction Mc-TEST <ZigbeeDevice: c4a22c93-be5d-4209-af4d-a5cbcf10478f [0xAEB5] (TCPi Bulb)> emitting event: {“capability_id”:“legendabsolute60149.signalMetrics”,“visibility”:{“displayed”:false},“component_id”:“main”,“attribute_id”:“signalMetrics”,“state”:{“value”:“<em table style=‘font-size:75%’;‘font-weight: bold’GMT: 2023/08/14 Time: 21:19
DNI: 0xAEB5 LQI: 255 RSSI: -65dbm
”}}
2023-08-14T21:19:06.512076965+00:00 INFO Zigbee Light Multifunction Mc-TEST <ZigbeeDevice: c4a22c93-be5d-4209-af4d-a5cbcf10478f [0xAEB5] (TCPi Bulb)> emitting event: {“capability_id”:“switch”,“component_id”:“main”,“attribute_id”:“switch”,“state”:{“value”:“off”}}
2023-08-14T21:19:06.520108965+00:00 DEBUG Zigbee Light Multifunction Mc-TEST TCPi Bulb device thread event handled
2023-08-14T21:19:07.781031715+00:00 TRACE Zigbee Light Multifunction Mc-TEST Received event with handler capability
2023-08-14T21:19:07.793052965+00:00 INFO Zigbee Light Multifunction Mc-TEST <ZigbeeDevice: c4a22c93-be5d-4209-af4d-a5cbcf10478f [0xAEB5] (TCPi Bulb)> received command: {“command”:“on”,“args”:{},“capability”:“switch”,“positional_args”:{},“component”:“main”}
2023-08-14T21:19:07.794153340+00:00 PRINT Zigbee Light Multifunction Mc-TEST zll_xy >>>>>> no
2023-08-14T21:19:07.794849923+00:00 PRINT Zigbee Light Multifunction Mc-TEST zll_xy >>>>>> no
2023-08-14T21:19:07.795508007+00:00 TRACE Zigbee Light Multifunction Mc-TEST Found CapabilityCommandDispatcher handler in zigbee_light_multifunctions
2023-08-14T21:19:07.796393882+00:00 PRINT Zigbee Light Multifunction Mc-TEST Turn On handler >>>>>>>>>>>
2023-08-14T21:19:07.797143882+00:00 PRINT Zigbee Light Multifunction Mc-TEST Turn On >>>>>>>>>>>>>>>>
2023-08-14T21:19:07.798027507+00:00 INFO Zigbee Light Multifunction Mc-TEST <ZigbeeDevice: c4a22c93-be5d-4209-af4d-a5cbcf10478f [0xAEB5] (TCPi Bulb)> sending Zigbee message: < ZigbeeMessageTx || Uint16: 0x0000, < AddressHeader || src_addr: 0x0000, src_endpoint: 0x01, dest_addr: 0xAEB5, dest_endpoint: 0x01, profile: 0x0104, cluster: Level >, < ZCLMessageBody || < ZCLHeader || frame_ctrl: 0x01, seqno: 0x00, ZCLCommandId: 0x04 >, < MoveToLevelWithOnOff || level: 0xFE, transition_time: 0x001E > > >
2023-08-14T21:19:07.807951965+00:00 INFO Zigbee Light Multifunction Mc-TEST <ZigbeeDevice: c4a22c93-be5d-4209-af4d-a5cbcf10478f [0xAEB5] (TCPi Bulb)> sending Zigbee message: < ZigbeeMessageTx || Uint16: 0x0000, < AddressHeader || src_addr: 0x0000, src_endpoint: 0x01, dest_addr: 0xAEB5, dest_endpoint: 0x01, profile: 0x0104, cluster: OnOff >, < ZCLMessageBody || < ZCLHeader || frame_ctrl: 0x01, seqno: 0x00, ZCLCommandId: 0x01 >, < On || > > >
2023-08-14T21:19:07.870200132+00:00 INFO Zigbee Light Multifunction Mc-TEST <ZigbeeDevice: c4a22c93-be5d-4209-af4d-a5cbcf10478f [0xAEB5] (TCPi Bulb)> emitting event: {“capability_id”:“switch”,“component_id”:“main”,“attribute_id”:“switch”,“state”:{“value”:“on”}}
2023-08-14T21:19:07.884322507+00:00 PRINT Zigbee Light Multifunction Mc-TEST <<<<<<<<<< device <ZigbeeDevice: c4a22c93-be5d-4209-af4d-a5cbcf10478f [0xAEB5] (TCPi Bulb)>
2023-08-14T21:19:07.884899090+00:00 PRINT Zigbee Light Multifunction Mc-TEST <<<<<<<<<< circadian[device] Inactive
2023-08-14T21:19:07.886187715+00:00 DEBUG Zigbee Light Multifunction Mc-TEST TCPi Bulb device thread event handled
2023-08-14T21:19:07.887135548+00:00 DEBUG Zigbee Light Multifunction Mc-TEST TCPi Bulb device thread event handled
2023-08-14T21:19:07.906928215+00:00 TRACE Zigbee Light Multifunction Mc-TEST Received event with handler zigbee
2023-08-14T21:19:07.907741132+00:00 INFO Zigbee Light Multifunction Mc-TEST <ZigbeeDevice: c4a22c93-be5d-4209-af4d-a5cbcf10478f [0xAEB5] (TCPi Bulb)> received Zigbee message: < ZigbeeMessageRx || type: 0x00, < AddressHeader || src_addr: 0xAEB5, src_endpoint: 0x01, dest_addr: 0x0000, dest_endpoint: 0x01, profile: 0x0104, cluster: Level >, lqi: 0xFE, rssi: -64, body_length: 0x0005, < ZCLMessageBody || < ZCLHeader || frame_ctrl: 0x18, seqno: 0x37, ZCLCommandId: 0x0B >, < DefaultResponse || cmd: 0x04, ZclStatus: SUCCESS > > >
2023-08-14T21:19:07.918524257+00:00 PRINT Zigbee Light Multifunction Mc-TEST zll_xy >>>>>> no
2023-08-14T21:19:07.919356132+00:00 DEBUG Zigbee Light Multifunction Mc-TEST TCPi Bulb device thread event handled
2023-08-14T21:19:07.920048048+00:00 TRACE Zigbee Light Multifunction Mc-TEST Received event with handler zigbee
2023-08-14T21:19:07.920938757+00:00 INFO Zigbee Light Multifunction Mc-TEST <ZigbeeDevice: c4a22c93-be5d-4209-af4d-a5cbcf10478f [0xAEB5] (TCPi Bulb)> received Zigbee message: < ZigbeeMessageRx || type: 0x00, < AddressHeader || src_addr: 0xAEB5, src_endpoint: 0x01, dest_addr: 0x0000, dest_endpoint: 0x01, profile: 0x0104, cluster: OnOff >, lqi: 0xF7, rssi: -74, body_length: 0x0005, < ZCLMessageBody || < ZCLHeader || frame_ctrl: 0x18, seqno: 0x38, ZCLCommandId: 0x0B >, < DefaultResponse || cmd: 0x01, ZclStatus: SUCCESS > > >
2023-08-14T21:19:07.937336423+00:00 PRINT Zigbee Light Multifunction Mc-TEST zll_xy >>>>>> no
2023-08-14T21:19:07.937908715+00:00 PRINT Zigbee Light Multifunction Mc-TEST zll_xy >>>>>> no
2023-08-14T21:19:07.938901507+00:00 TRACE Zigbee Light Multifunction Mc-TEST Found ZigbeeMessageDispatcher handler in zigbee_light_multifunctions
2023-08-14T21:19:07.939786173+00:00 INFO Zigbee Light Multifunction Mc-TEST Executing ZclGlobalCommandHandler: cluster: OnOff, command: DefaultResponse
2023-08-14T21:19:07.940990840+00:00 INFO Zigbee Light Multifunction Mc-TEST <ZigbeeDevice: c4a22c93-be5d-4209-af4d-a5cbcf10478f [0xAEB5] (TCPi Bulb)> emitting event: {“capability_id”:“switch”,“component_id”:“main”,“attribute_id”:“switch”,“state”:{“value”:“on”}}
2023-08-14T21:19:07.942218340+00:00 DEBUG Zigbee Light Multifunction Mc-TEST TCPi Bulb device thread event handled
2023-08-14T21:19:14.907678297+00:00 INFO Zigbee Light Multifunction Mc-TEST <ZigbeeDevice: c4a22c93-be5d-4209-af4d-a5cbcf10478f [0xAEB5] (TCPi Bulb)> sending Zigbee message: < ZigbeeMessageTx || Uint16: 0x0000, < AddressHeader || src_addr: 0x0000, src_endpoint: 0x01, dest_addr: 0xAEB5, dest_endpoint: 0x01, profile: 0x0104, cluster: Level >, < ZCLMessageBody || < ZCLHeader || frame_ctrl: 0x00, seqno: 0x00, ZCLCommandId: 0x00 >, < ReadAttribute || AttributeId: 0x0000 > > >
2023-08-14T21:19:14.913244172+00:00 INFO Zigbee Light Multifunction Mc-TEST <ZigbeeDevice: c4a22c93-be5d-4209-af4d-a5cbcf10478f [0xAEB5] (TCPi Bulb)> sending Zigbee message: < ZigbeeMessageTx || Uint16: 0x0000, < AddressHeader || src_addr: 0x0000, src_endpoint: 0x01, dest_addr: 0xAEB5, dest_endpoint: 0x01, profile: 0x0104, cluster: OnOff >, < ZCLMessageBody || < ZCLHeader || frame_ctrl: 0x00, seqno: 0x00, ZCLCommandId: 0x00 >, < ReadAttribute || AttributeId: 0x0000 > > >
2023-08-14T21:19:14.917469922+00:00 DEBUG Zigbee Light Multifunction Mc-TEST TCPi Bulb device thread event handled
2023-08-14T21:19:15.016843672+00:00 TRACE Zigbee Light Multifunction Mc-TEST Received event with handler zigbee
2023-08-14T21:19:15.017669088+00:00 INFO Zigbee Light Multifunction Mc-TEST <ZigbeeDevice: c4a22c93-be5d-4209-af4d-a5cbcf10478f [0xAEB5] (TCPi Bulb)> received Zigbee message: < ZigbeeMessageRx || type: 0x00, < AddressHeader || src_addr: 0xAEB5, src_endpoint: 0x01, dest_addr: 0x0000, dest_endpoint: 0x01, profile: 0x0104, cluster: Level >, lqi: 0xFB, rssi: -73, body_length: 0x0008, < ZCLMessageBody || < ZCLHeader || frame_ctrl: 0x18, seqno: 0x39, ZCLCommandId: 0x01 >, < ReadAttributeResponse || < AttributeRecord || AttributeId: 0x0000, ZclStatus: SUCCESS, DataType: Uint8, CurrentLevel: 0x01 > > > >
2023-08-14T21:19:15.030941630+00:00 PRINT Zigbee Light Multifunction Mc-TEST zll_xy >>>>>> no
2023-08-14T21:19:15.036141213+00:00 PRINT Zigbee Light Multifunction Mc-TEST zll_xy >>>>>> no
2023-08-14T21:19:15.036954547+00:00 TRACE Zigbee Light Multifunction Mc-TEST Found ZigbeeMessageDispatcher handler in zigbee_light_multifunctions
2023-08-14T21:19:15.037646213+00:00 INFO Zigbee Light Multifunction Mc-TEST Executing ZclClusterAttributeValueHandler: cluster: Level, attribute: CurrentLevel
2023-08-14T21:19:15.039199172+00:00 PRINT Zigbee Light Multifunction Mc-TEST <<<< emit Level >>>>
2023-08-14T21:19:15.039864713+00:00 INFO Zigbee Light Multifunction Mc-TEST <ZigbeeDevice: c4a22c93-be5d-4209-af4d-a5cbcf10478f [0xAEB5] (TCPi Bulb)> emitting event: {“capability_id”:“switchLevel”,“component_id”:“main”,“attribute_id”:“level”,“state”:{“value”:0}}
2023-08-14T21:19:15.053113922+00:00 DEBUG Zigbee Light Multifunction Mc-TEST TCPi Bulb device thread event handled
2023-08-14T21:19:15.053948547+00:00 TRACE Zigbee Light Multifunction Mc-TEST Received event with handler zigbee
2023-08-14T21:19:15.054625797+00:00 INFO Zigbee Light Multifunction Mc-TEST <ZigbeeDevice: c4a22c93-be5d-4209-af4d-a5cbcf10478f [0xAEB5] (TCPi Bulb)> received Zigbee message: < ZigbeeMessageRx || type: 0x00, < AddressHeader || src_addr: 0xAEB5, src_endpoint: 0x01, dest_addr: 0x0000, dest_endpoint: 0x01, profile: 0x0104, cluster: OnOff >, lqi: 0xFE, rssi: -64, body_length: 0x0008, < ZCLMessageBody || < ZCLHeader || frame_ctrl: 0x18, seqno: 0x3A, ZCLCommandId: 0x01 >, < ReadAttributeResponse || < AttributeRecord || AttributeId: 0x0000, ZclStatus: SUCCESS, DataType: Boolean, OnOff: true > > > >
2023-08-14T21:19:15.065984047+00:00 PRINT Zigbee Light Multifunction Mc-TEST zll_xy >>>>>> no
2023-08-14T21:19:15.068022422+00:00 PRINT Zigbee Light Multifunction Mc-TEST zll_xy >>>>>> no
2023-08-14T21:19:15.068950088+00:00 TRACE Zigbee Light Multifunction Mc-TEST Found ZigbeeMessageDispatcher handler in zigbee_light_multifunctions
2023-08-14T21:19:15.069827255+00:00 INFO Zigbee Light Multifunction Mc-TEST Executing ZclClusterAttributeValueHandler: cluster: OnOff, attribute: OnOff
2023-08-14T21:19:15.074569838+00:00 PRINT Zigbee Light Multifunction Mc-TEST <<<<< Emit on_off >>>>>>
2023-08-14T21:19:15.075270713+00:00 INFO Zigbee Light Multifunction Mc-TEST <ZigbeeDevice: c4a22c93-be5d-4209-af4d-a5cbcf10478f [0xAEB5] (TCPi Bulb)> emitting event: {“capability_id”:“switch”,“component_id”:“main”,“attribute_id”:“switch”,“state”:{“value”:“on”}}
2023-08-14T21:19:15.082380713+00:00 DEBUG Zigbee Light Multifunction Mc-TEST TCPi Bulb device thread event handled
2023-08-14T21:19:16.053693921+00:00 DEBUG Zigbee Light Multifunction Mc-TEST driver device thread event handled

The driver sends the command with the level of the last shutdown 100% (0xFE) but the device does not execute the command and answers that it accepts it (SUCCESS), but when the attribute is read 6 seconds later (transition_time +1 sec) it has the minimum value 0x01(0%) and is the one that is emitted

You can try limiting the max level to 99% and min level in preferences to 1% see if it works better.

There have been cases of devices not supporting the value level 100% y 0%

I think I set the correct settings - I thought the “Turn (ON) Start Level %” and “Turn (OFF) End Level %” were for the progressive settings, but I set them to 1% and 99%. It still fails the same way. Is there another setting I should use? (Note - the progressive on/off are turned off, transition on/off=5s.)

@scasagrande
I was not referring to these limits, but the maximum level limit is not in that profile.

Try turning off with values less than 100%, that value will be saved and then turn on, the command will be sent with the last value < 100%

I’m going to sleep

@Mariano_Colmenarejo,

The only percentage value in the settings I have appears to be for the progressive feature. Do the settings go away with features not reported by the device?

I did try setting it to 99%, as well as the turn-off level to 1%, but the transition time feature will still randomly set the level to 1% on turn-on, rather than 99 or 100%. (logs example below)

Finally, yet another strange thing - the progressive feature switches (which I wasn’t trying to test) seem to be gone from my app screen! Still using the original 2023-08-11T22xxx driver, but on the Controls tab for the light, progressive ON and OFF is missing! I tried swapping drivers back and forth, still missing.

(I miss groovy, it seemed pretty straightforward!)

Anyway, here’s a long set of logs for testing the transition time=3s. It succeeds several times, then fails at the end (turns on to 1%, not 100%). Using pastebin as it won’t fit in this forum.

This is a issue with new app version. I think

Do not change the driver, the bulb you change will stop working until you pair again.

Tomorrow I will see the logs, but what I saw yesterday does not seem to have to do with the driver and with the fact that the device does not execute the received command.

Have you tried a different bulb?

Try to start at a higher % level 5%, 10% for progressive on.
test with > 7 sec transition time.

For this to work well the device has to have a variable frequency electronics driver to be able to adjust the transition times to different ranges of level increase.
If you put a short time 3 sec, for a high level range, 1% to 100%, your device hardware may not be able to adapt the frequency of the dimmer’s PCM modulator.
In this the quality of the hardware of the bulbs matters.

The tests I do with an OSRAM work very well, however TUYA bulbs are not able to work with transition times, the price is something!

The Zigbee specification for the transition time says that it will comply with the time sent in the command as tightly as the device can.

In this most up-to-date documentation I have seen that the units to be sent are tenths of a sec.
The documentation that I used when I made this part of the driver did not say this so clearly and it was the result of trial and error. The driver is sending times that are almost half the correct ones.
I will modify it by multiplying the value in preferences by 10, instead of multiplying by 6 now

device:send(zcl_clusters.Level.commands.MoveToLevelWithOnOff(device, math.floor(on_Level/100.0 * 254), math.floor((device.preferences.levelTransTime * 10))))

I will also set a higher limit of 10 sec, it can be set up to 6553 sec. as long as the device supports it.

I leave it for today

@scasagrande

I have seen the logs and I have come to the same conclusion as yesterday.
When it fails, the driver sends the command as usual, the device replies SUCCESS to the command and then does not execute the command.
When the attribute is read 5 seconds after it was sent (3 sec transition time + 2 sec) the device answers current level= 0x01 because it has not been turned on

All this after sending 8 commands followed in 1 minute for on, off (4 on and 4 off) and it fails at 8 on command! Isn’t it a device protection due to temperature or a device failure something like that? since the device is turned on with a level 0x01 and the OnOff attribute answers that it is On

Now if I go to sleep

Hi, @Mariano_Colmenarejo @nayelyz

I‘m a newbie in Smartthings. :grinning:

I met same issue with you that I can’t control SwitchLevel
when I migrate a bulb from DTH to EdgeDriver.

@Mariano_Colmenarejo Your codes are different with @nayelyz
I have also tried to set the parameters nil before, it really doesn’t work.

     local options_mask = nil
     local options_override = nil
     device:send(zcl_clusters.Level.commands.MoveToLevelWithOnOff(device, math.floor(on_Level/100.0 * 254), 0xFFFF, options_mask ,options_override)

But @nayelyz 's way works on my device.

local command = Level.commands.MoveToLevelWithOnOff(device, level, dimming_rate)
command.body.zcl_body.options_mask = nil
command.body.zcl_body.options_override = nil

Please refer to

Hope this help.

BTW. May I ask how you share the drivers.
I saw a lot of drivers shared between you guys but I didn’t see any channels were shared.

Hi @liuyd96

I have tested your code and it works fine.

It is shorter and simpler than what I had done, which also works.

Thank you

And don’t you have the same problem for the commands MoveToColorTemperature?, also send the optional arguments

local args = {color_temperature_mireds, transition_time, options_mask, options_override}

I share my compiled drivers on this channel

@Mariano_Colmenarejo,

The example I sent in the logs above were trying to get it to both succeed and fail in the same logs (to show any differences). It didn’t always take a lot of on/off commands to fail, sometimes it would happen on the first try. The bulb could be having a failure, but it’s probably not temperature related in this case, the bulb isn’t very hot, and sometimes would fail on first try after being off for a while.

I can’t try to test with different values for transition, unfortunately - the other (new) ST app bug that takes away the ability to change some custom values (like turn on/off the progressive mode) is stopping me. It’s currently got the progressive mode ON (I seem to have it get set that way by itself sometimes, another thing I can’t reproduce easily), so I can’t turn it OFF to go back for transition time tests.

I’m finding it interesting that @liuyd96 sees a similar problem with the DuraGreen lights. I wonder how many other bulbs/devices might have the same issue as the TCPi and now DuraGreen - and we just haven’t found them yet. I would think it would take a while before we find them all - not everyone uses the dimmer/level, and even fewer know where to ask for help when they do notice the issue.

While the TCPi and DuraGreen bulbs may not technically be within spec, it’s confusing to those of us who had devices that worked fine with the old DTH architecture. (Heads up @nayelyz, in case there’s a better way to do this outside custom edge drivers.)