[Edge drivers] Driver for TCPi A19 Zigbee smart bulbs

Trying to control TCPi A19 zigbee smart bulbs. Works for ON/OFF fine with Edge drivers “Zigbee Switch” and “Zigbee Light Multifunction Mc”, but dimming doesn’t work for either driver.

Using “Zigbee Thing Mc” to get fingerprint info:

Manufacturer: TCPi
Model: 60W_A19_2700K

Thanks!

I need all clusters device data

Hi Mariano;

Here’s everything that is reported on your “Zigbee Thing Mc” Device:

Manufacturer: TCPi
Model: 60W_A19_2700K
FingerPrinted_EndPoint.Id: 0x01
App Version: 0x0C
ZCL Version: 0x01
Network ID: 0xD8DB
Zigbee EUI_ 00158D000057B6B3
Device ID: 3ce04158-3e56-402a-9eB6-ef978ebb338a

Server Cluster:
Ep: 0x01={0000,0004,0003,0006,0008,0005}

Client Clusters:
Ep: 0x01={0019}

Signal Metrics:
LQI: 255 RSSI: -63dbm

Edit: it looks like I was mistaken - your “Zigbee Light Multifunction Mc” only works to turn the light ON, but not OFF, or change dimmer level. (At least that’s what I’m seeing now. “Zigbee Switch” allows ON/OFF, but not change of dimmer level.)

Hi @scasagrande
Added to this driver version.

Try uninstalling old driver version and install the new driver version in your Hub

───────────────────────────────────────────────────
 Name         Zigbee Light Multifunction Mc
 Version      2023-08-02T20:40:40.684408064
───────────────────────────────────────────────────
- id: "TCPi/60W_A19_2700K"
    deviceLabel: TCPi Bulb
    manufacturer: TCPi
    model: 60W_A19_2700K
    deviceProfileName: switch-level

Mariano;

Thanks for the quick response. It appears to work well for ON/OFF now, but still won’t control the dimmer level (only stays at 100%, no matter what the slider says).

Driver does show version dated today (2023-08-02…), so I assume I reloaded the driver correctly.

Any other ideas?

Hi @scasagrande

Slider stays spinning?
Try to pair it directly with the driver from scratch?
Have you tried restarting the hub?

To see what happens, you would have to see the logs with the CLI of when you change the level

Slider doesn’t spin, looks like it is working “correctly” (as it used to work).
I tried rebooting the hub, re-pairing the device from scratch (it picked your driver).

I installed the smartthings CLI (linux), and when running the command to change levels, it looks like it “succeeds” without any errors. I can turn on/off the light with the CLI (switch:on, switch:off), but trying the ‘switchLevel:setLevel(50)’ command doesn’t do anything, and seems to think it “executed successfully” (but the light level doesn’t change). I don’t know how to turn up the logging level (new to the CLI); if there’s a way I can get more info from the CLI, please point me in the right direction.

$ smartthings devices:commands c4a22c93-be5d-4209-af4d-a5cbcf10478f ‘switchLevel:setLevel(50)’
Command executed successfully
$

Execute the command smartthings edge:drivers:logcat
Next, it will ask you for the IP address of your Hub

Next it will show you all the drivers installed in your Hub, then choose the Zigbee Light Multifunction Mc driver number

This will show you all the activity of the driver and its devices.

Run the change level command in the app and you will see the logs of execution and responses from the device.

Copy and paste those logs

Thanks for the instructions, Mariano.

Here’s the log trace:

? Select a driver. 30
connecting… connected
2023-08-03T20:04:50.404724824+00:00 DEBUG Zigbee Light Multifunction Mc driver device thread event handled
2023-08-03T20:04:50.737991482+00:00 TRACE Zigbee Light Multifunction Mc Received event with handler capability
2023-08-03T20:04:50.739553534+00:00 INFO Zigbee Light Multifunction Mc <ZigbeeDevice: c4a22c93-be5d-4209-af4d-a5cbcf10478f [0xAEB5] (TCPi Bulb)> received command: {“command”:“setLevel”,“component”:“main”,“capability”:“switchLevel”,“positional_args”:[41],“args”:{“level”:41}}
2023-08-03T20:04:50.740665644+00:00 TRACE Zigbee Light Multifunction Mc Found CapabilityCommandDispatcher handler in zigbee_light_multifunctions
2023-08-03T20:04:50.741541040+00:00 INFO Zigbee Light Multifunction Mc <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: 0x68, transition_time: 0xFFFF, options_mask: 0x00, options_override: 0x00 > > >
2023-08-03T20:04:50.756447333+00:00 DEBUG Zigbee Light Multifunction Mc TCPi Bulb device thread event handled
2023-08-03T20:04:50.759790827+00:00 DEBUG Zigbee Light Multifunction Mc TCPi Bulb device thread event handled
2023-08-03T20:04:52.265235228+00:00 DEBUG Zigbee Light Multifunction Mc TCPi Bulb device thread event handled
2023-08-03T20:04:52.386571738+00:00 TRACE Zigbee Light Multifunction Mc Received event with handler zigbee
2023-08-03T20:04:52.387454713+00:00 INFO Zigbee Light Multifunction Mc <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: 0xD7, rssi: -82, body_length: 0x0008, < ZCLMessageBody || < ZCLHeader || frame_ctrl: 0x18, seqno: 0x50, ZCLCommandId: 0x01 >, < ReadAttributeResponse || < AttributeRecord || AttributeId: 0x0000, ZclStatus: SUCCESS, DataType: Uint8, CurrentLevel: 0xFE > > > >
2023-08-03T20:04:52.397088143+00:00 TRACE Zigbee Light Multifunction Mc Found ZigbeeMessageDispatcher handler in zigbee_light_multifunctions
2023-08-03T20:04:52.402057449+00:00 INFO Zigbee Light Multifunction Mc Executing ZclClusterAttributeValueHandler: cluster: Level, attribute: CurrentLevel
2023-08-03T20:04:52.403302743+00:00 INFO Zigbee Light Multifunction Mc <ZigbeeDevice: c4a22c93-be5d-4209-af4d-a5cbcf10478f [0xAEB5] (TCPi Bulb)> emitting event: {“capability_id”:“switchLevel”,“state”:{“value”:100},“component_id”:“main”,“attribute_id”:“level”}
2023-08-03T20:04:52.469448279+00:00 DEBUG Zigbee Light Multifunction Mc TCPi Bulb device thread event handled
2023-08-03T20:04:54.397064113+00:00 TRACE Zigbee Light Multifunction Mc Received event with handler zigbee
2023-08-03T20:04:54.398005934+00:00 INFO Zigbee Light Multifunction Mc <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: 0xFD, rssi: -79, body_length: 0x0005, < ZCLMessageBody || < ZCLHeader || frame_ctrl: 0x18, seqno: 0x4F, ZCLCommandId: 0x0B >, < DefaultResponse || cmd: 0x04, ZclStatus: MALFORMED_COMMAND > > >
2023-08-03T20:04:54.407397944+00:00 DEBUG Zigbee Light Multifunction Mc TCPi Bulb device thread event handled
2023-08-03T20:05:20.404727502+00:00 DEBUG Zigbee Light Multifunction Mc driver device thread event handled
2023-08-03T20:05:23.273261211+00:00 TRACE Zigbee Light Multifunction Mc Received event with handler zigbee
2023-08-03T20:05:23.274104919+00:00 INFO Zigbee Light Multifunction Mc <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: 0x75, rssi: -76, body_length: 0x0009, < ZDOMessageBody || < ZDOHeader || seqno: 0x2D >, GenericBody: FD FF 04 01 01 19 00 00 > >
2023-08-03T20:05:23.311506544+00:00 TRACE Zigbee Light Multifunction Mc Received event with handler zigbee
2023-08-03T20:05:23.316367961+00:00 INFO Zigbee Light Multifunction Mc <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: -77, body_length: 0x0005, < ZDOMessageBody || < ZDOHeader || seqno: 0x2E >, GenericBody: 00 00 00 00 > >
2023-08-03T20:05:23.317348836+00:00 DEBUG Zigbee Light Multifunction Mc TCPi Bulb device thread event handled
2023-08-03T20:05:23.335542544+00:00 DEBUG Zigbee Light Multifunction Mc TCPi Bulb device thread event handled
2023-08-03T20:05:50.404711172+00:00 DEBUG Zigbee Light Multifunction Mc driver device thread event handled

This is the command that comes to driver from the app to command a level 41%.

The driver issues the MoveToLevelWithOnOff command.

It then reads the status of the level and outputs the value 100%.

2023-08-03T20:04:50.740665644+00:00 TRACE Zigbee Light Multifunction Mc Found CapabilityCommandDispatcher handler in zigbee_light_multifunctions
2023-08-03T20:04:50.741541040+00:00 INFO Zigbee Light Multifunction Mc <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: 0x68, transition_time: 0xFFFF, options_mask: 0x00, options_override: 0x00 > > >

Driver then reads the status of the level and outputs the value 100%

2023-08-03T20:04:52.387454713+00:00 INFO Zigbee Light Multifunction Mc <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: 0xD7, rssi: -82, body_length: 0x0008, < ZCLMessageBody || < ZCLHeader || frame_ctrl: 0x18, seqno: 0x50, ZCLCommandId: 0x01 >, < ReadAttributeResponse || < AttributeRecord || AttributeId: 0x0000, ZclStatus: SUCCESS, DataType: Uint8, CurrentLevel: 0xFE > > > >
2023-08-03T20:04:52.397088143+00:00 TRACE Zigbee Light Multifunction Mc Found ZigbeeMessageDispatcher handler in zigbee_light_multifunctions
2023-08-03T20:04:52.402057449+00:00 INFO Zigbee Light Multifunction Mc Executing ZclClusterAttributeValueHandler: cluster: Level, attribute: CurrentLevel
2023-08-03T20:04:52.403302743+00:00 INFO Zigbee Light Multifunction Mc <ZigbeeDevice: c4a22c93-be5d-4209-af4d-a5cbcf10478f [0xAEB5] (TCPi Bulb)> emitting event: {“capability_id”:“switchLevel”,“state”:{“value”:100},“component_id”:“main”,“attribute_id”:“level”}

The response from the device is that the MoveToLevelWithOnOff command is malformed.

2023-08-03T20:04:54.398005934+00:00 INFO Zigbee Light Multifunction Mc <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: 0xFD, rssi: -79, body_length: 0x0005, < ZCLMessageBody || < ZCLHeader || frame_ctrl: 0x18, seqno: 0x4F, ZCLCommandId: 0x0B >, < DefaultResponse || cmd: 0x04, ZclStatus: MALFORMED_COMMAND > > >

The command is formed correctly, I don’t know if your device doesn’t support that command or does not follow the zigbee standard.

What old DTH did you use before?

I used the old SmartThings Zigbee Switch DTH, I believe (it’s been in use since 2015 at least). The recent change to remove the old DTH types moved it to a non-dimmable state. The bulbs were originally sold with the SAGE home automation system, but I’ve been using them with SmartThings hubs.

For a while, I had my own DTH just for the fingerprint, it worked fine as well. It is located here in case this helps (but it was just using the standard zigbee.setLevel() function).

https://github.com/smcasagrande/SteveC_SmartThings/blob/master/devicetypes/smcasagrande/tcp-bulb.src/tcp-bulb.groovy

@scasagrande

In App preferences, Try to put a transition time for level of 1 second, to see if it does not admit the value 0xFFFF.

- name: "levelTransTime"
    title: "Transition Time to New Level(sec)"
    description: "Select Transition Time to Move New Level (0 to 10 sec, Default: 0)"
    required: false
    preferenceType: number
    definition:
      minimum: 0
      maximum: 10
      default: 0

I set the “Settings → Transition time to New Level (sec)” setting to 1 in the app for this device. Here’s the logs from that attempt (still getting MALFORMED_COMMAND):

2023-08-03T21:03:05.425263926+00:00 TRACE Zigbee Light Multifunction Mc Received event with handler capability
2023-08-03T21:03:05.428179551+00:00 INFO Zigbee Light Multifunction Mc <ZigbeeDevice: c4a22c93-be5d-4209-af4d-a5cbcf10478f [0xAEB5] (TCPi Bulb)> received command: {“command”:“setLevel”,“component”:“main”,“capability”:“switchLevel”,“positional_args”:[33],“args”:{“level”:33}}
2023-08-03T21:03:05.429836509+00:00 TRACE Zigbee Light Multifunction Mc Found CapabilityCommandDispatcher handler in zigbee_light_multifunctions
2023-08-03T21:03:05.430721593+00:00 INFO Zigbee Light Multifunction Mc <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: 0x53, transition_time: 0x0006, options_mask: 0x00, options_override: 0x00 > > >
2023-08-03T21:03:05.447083509+00:00 DEBUG Zigbee Light Multifunction Mc TCPi Bulb device thread event handled
2023-08-03T21:03:05.447650843+00:00 DEBUG Zigbee Light Multifunction Mc TCPi Bulb device thread event handled
2023-08-03T21:03:05.516176426+00:00 TRACE Zigbee Light Multifunction Mc Received event with handler zigbee
2023-08-03T21:03:05.517049134+00:00 INFO Zigbee Light Multifunction Mc <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: 0xFA, rssi: -83, body_length: 0x0005, < ZCLMessageBody || < ZCLHeader || frame_ctrl: 0x18, seqno: 0x1C, ZCLCommandId: 0x0B >, < DefaultResponse || cmd: 0x04, ZclStatus: MALFORMED_COMMAND > > >
2023-08-03T21:03:05.522615843+00:00 DEBUG Zigbee Light Multifunction Mc TCPi Bulb device thread event handled
2023-08-03T21:03:07.944799760+00:00 DEBUG Zigbee Light Multifunction Mc TCPi Bulb device thread event handled
2023-08-03T21:03:08.036136218+00:00 TRACE Zigbee Light Multifunction Mc Received event with handler zigbee
2023-08-03T21:03:08.037003760+00:00 INFO Zigbee Light Multifunction Mc <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: 0xE1, rssi: -81, body_length: 0x0008, < ZCLMessageBody || < ZCLHeader || frame_ctrl: 0x18, seqno: 0x1D, ZCLCommandId: 0x01 >, < ReadAttributeResponse || < AttributeRecord || AttributeId: 0x0000, ZclStatus: SUCCESS, DataType: Uint8, CurrentLevel: 0xFE > > > >
2023-08-03T21:03:08.048606260+00:00 TRACE Zigbee Light Multifunction Mc Found ZigbeeMessageDispatcher handler in zigbee_light_multifunctions
2023-08-03T21:03:08.049163468+00:00 INFO Zigbee Light Multifunction Mc Executing ZclClusterAttributeValueHandler: cluster: Level, attribute: CurrentLevel
2023-08-03T21:03:08.053251593+00:00 INFO Zigbee Light Multifunction Mc <ZigbeeDevice: c4a22c93-be5d-4209-af4d-a5cbcf10478f [0xAEB5] (TCPi Bulb)> emitting event: {“capability_id”:“switchLevel”,“state”:{“value”:100},“component_id”:“main”,“attribute_id”:“level”}
2023-08-03T21:03:08.059804176+00:00 DEBUG Zigbee Light Multifunction Mc TCPi Bulb device thread event handled

@scasagrande

Try installing this driver version

───────────────────────────────────────────────────
 Name         Zigbee Light Multifunction Mc              
 Version      2023-08-03T21:48:15.479639827        
───────────────────────────────────────────────────

I uninstalled/reinstalled your drive to get to the new version (confirmed on the app). Looks like it’s still malformed…

2023-08-03T21:56:59.763170743+00:00 TRACE Zigbee Light Multifunction Mc Received event with handler capability
2023-08-03T21:56:59.771033618+00:00 INFO Zigbee Light Multifunction Mc <ZigbeeDevice: c4a22c93-be5d-4209-af4d-a5cbcf10478f [0xAEB5] (TCPi Bulb)> received command: {“capability”:“switchLevel”,“component”:“main”,“command”:“setLevel”,“positional_args”:[55],“args”:{“level”:55}}
2023-08-03T21:56:59.773213618+00:00 TRACE Zigbee Light Multifunction Mc Found CapabilityCommandDispatcher handler in zigbee_light_multifunctions
2023-08-03T21:56:59.787630743+00:00 INFO Zigbee Light Multifunction Mc <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: 0x00 >, < MoveToLevel || level: 0x8B, transition_time: 0x0000, options_mask: 0x00, options_override: 0x00 > > >
2023-08-03T21:56:59.806851826+00:00 DEBUG Zigbee Light Multifunction Mc TCPi Bulb device thread event handled
2023-08-03T21:56:59.813016660+00:00 DEBUG Zigbee Light Multifunction Mc TCPi Bulb device thread event handled
2023-08-03T21:56:59.913796451+00:00 TRACE Zigbee Light Multifunction Mc Received event with handler zigbee
2023-08-03T21:56:59.916276410+00:00 INFO Zigbee Light Multifunction Mc <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: 0xF7, rssi: -81, body_length: 0x0005, < ZCLMessageBody || < ZCLHeader || frame_ctrl: 0x18, seqno: 0x11, ZCLCommandId: 0x0B >, < DefaultResponse || cmd: 0x00, ZclStatus: MALFORMED_COMMAND > > >
2023-08-03T21:56:59.922119118+00:00 DEBUG Zigbee Light Multifunction Mc TCPi Bulb device thread event handled
2023-08-03T21:57:02.305492410+00:00 DEBUG Zigbee Light Multifunction Mc TCPi Bulb device thread event handled
2023-08-03T21:57:02.386095993+00:00 TRACE Zigbee Light Multifunction Mc Received event with handler zigbee
2023-08-03T21:57:02.386930952+00:00 INFO Zigbee Light Multifunction Mc <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: 0xF6, rssi: -86, body_length: 0x0008, < ZCLMessageBody || < ZCLHeader || frame_ctrl: 0x18, seqno: 0x12, ZCLCommandId: 0x01 >, < ReadAttributeResponse || < AttributeRecord || AttributeId: 0x0000, ZclStatus: SUCCESS, DataType: Uint8, CurrentLevel: 0xFE > > > >
2023-08-03T21:57:02.396364785+00:00 TRACE Zigbee Light Multifunction Mc Found ZigbeeMessageDispatcher handler in zigbee_light_multifunctions
2023-08-03T21:57:02.398513202+00:00 INFO Zigbee Light Multifunction Mc Executing ZclClusterAttributeValueHandler: cluster: Level, attribute: CurrentLevel
2023-08-03T21:57:02.402608493+00:00 INFO Zigbee Light Multifunction Mc <ZigbeeDevice: c4a22c93-be5d-4209-af4d-a5cbcf10478f [0xAEB5] (TCPi Bulb)> emitting event: {“component_id”:“main”,“attribute_id”:“level”,“state”:{“value”:100},“capability_id”:“switchLevel”}
2023-08-03T21:57:02.408232618+00:00 DEBUG Zigbee Light Multifunction Mc TCPi Bulb device thread event handled

@scasagrande
Now the MoveToLevel command has been sent and it doesn’t work either.

Sorry I don’t know which command argument is malformed.
It is the lua libraries of the firmware that form the message of the command sent

If someone can add any information, I don’t know what else to do

Don’t know if this will help, but…

Below is the function from the Lua Library that sends the command.

--- Default handler for the SwitchLevel.setLevel command
---
--- This will send the move to level with on off command to the level control cluster
---
--- @param driver Driver The current driver running containing necessary context for execution
--- @param device st.Device The device this message was received from containing identifying information
--- @param command table The capability command table
function switch_level_defaults.set_level(driver, device, command)
  local level = math.floor(command.args.level/100.0 * 254)
  device:send_to_component(command.component, zcl_clusters.Level.server.commands.MoveToLevelWithOnOff(device, level, command.args.rate or 0xFFFF))
end

Looks like if command.args.rate is set it sends that otherwise it sends 0xFFFF.

And here is the code to build the command.


-----------------------------------------------------------
-- Level command MoveToLevelWithOnOff
-----------------------------------------------------------

--- @class st.zigbee.zcl.clusters.Level.MoveToLevelWithOnOff
--- @alias MoveToLevelWithOnOff
---
--- @field public ID number 0x04 the ID of this command
--- @field public NAME string "MoveToLevelWithOnOff" the name of this command
--- @field public level st.zigbee.data_types.Uint8
--- @field public transition_time st.zigbee.data_types.Uint16
--- @field public options_mask st.zigbee.zcl.clusters.Level.types.LevelOptions
--- @field public options_override st.zigbee.zcl.clusters.Level.types.LevelOptions
local MoveToLevelWithOnOff = {}
MoveToLevelWithOnOff.NAME = "MoveToLevelWithOnOff"
MoveToLevelWithOnOff.ID = 0x04
MoveToLevelWithOnOff.args_def = {
  {
    name = "level",
    optional = false,
    data_type = data_types.Uint8,
    is_complex = false,
    is_array = false,
    default = 0x00,
  },
  {
    name = "transition_time",
    optional = false,
    data_type = data_types.Uint16,
    is_complex = false,
    is_array = false,
    default = 0x0000,
  },
  {
    name = "options_mask",
    optional = false,
    data_type = LevelOptionsType,
    is_complex = false,
    is_array = false,
    default = 0x00,
  },
  {
    name = "options_override",
    optional = false,
    data_type = LevelOptionsType,
    is_complex = false,
    is_array = false,
    default = 0x00,
  },
}

function MoveToLevelWithOnOff:get_fields()
  return cluster_base.command_get_fields(self)
end

MoveToLevelWithOnOff.get_length = utils.length_from_fields
MoveToLevelWithOnOff._serialize = utils.serialize_from_fields
MoveToLevelWithOnOff.pretty_print = utils.print_from_fields

--- Deserialize this command
---
--- @param buf buf the bytes of the command body
--- @return MoveToLevelWithOnOff
function MoveToLevelWithOnOff.deserialize(buf)
  return cluster_base.command_deserialize(MoveToLevelWithOnOff, buf)
end

function MoveToLevelWithOnOff:set_field_names()
  cluster_base.command_set_fields(self)
end

--- Build a version of this message as if it came from the device
---
--- @param device st.zigbee.Device the device to build the message from
--- @param level st.zigbee.data_types.Uint8
--- @param transition_time st.zigbee.data_types.Uint16
--- @param options_mask st.zigbee.zcl.clusters.Level.types.LevelOptions
--- @param options_override st.zigbee.zcl.clusters.Level.types.LevelOptions
--- @return st.zigbee.ZigbeeMessageRx The full Zigbee message containing this command body
function MoveToLevelWithOnOff.build_test_rx(device, level, transition_time, options_mask, options_override)
  local args = {level, transition_time, options_mask, options_override}

  return cluster_base.command_build_test_rx(MoveToLevelWithOnOff, device, args, "server")
end

--- Initialize the MoveToLevelWithOnOff command
---
--- @param self MoveToLevelWithOnOff the template class for this command
--- @param device st.zigbee.Device the device to build this message to
--- @param level st.zigbee.data_types.Uint8
--- @param transition_time st.zigbee.data_types.Uint16
--- @param options_mask st.zigbee.zcl.clusters.Level.types.LevelOptions
--- @param options_override st.zigbee.zcl.clusters.Level.types.LevelOptions
--- @return st.zigbee.ZigbeeMessageTx the full command addressed to the device
function MoveToLevelWithOnOff:init(device, level, transition_time, options_mask, options_override)
  local args = {level, transition_time, options_mask, options_override}

  return cluster_base.command_init(self, device, args, "server")
end

function MoveToLevelWithOnOff:set_parent_cluster(cluster)
  self._cluster = cluster
  return self
end

setmetatable(MoveToLevelWithOnOff, {__call = MoveToLevelWithOnOff.init})

return MoveToLevelWithOnOff

Thanks very much for trying, Mariano, I sincerely appreciate the effort.

I noticed the transition_time is set to 0x0000 with the MoveToLevel command, even if I change it in the app to something else. Not sure if that is interesting or not…

One thing I noticed is that it’s giving a MALFORMED_COMMAND message even if I just turn on the switch. Looks like it’s sending the MoveToLevelOnOff cmd 0x04 when turning on the light, perhaps by default. MoveToLevel 0x00 is the other MALFORMED_COMMAND that is sent when just changing the levels.

These lights never gave me any problems, and seemed to be just a standard Zigbee light bulb for all these years. Strange that they’re behaving poorly now!

That is what is sent to all devices.
We have already tried sending a transition time 0x0006 (1 sec) and 0xFFFF, which is the value that tells it to move to the new value as fast as possible.

@scasagrande
We can try to send 0x0000 with this version

───────────────────────────────────────────────────
Name Zigbee Light Multifunction Mc
Version 2023-08-03T22:49:37.549846573
───────────────────────────────────────────────────

I’m going to sleep, tomorrow I see the answer

Unfortunately, still has the problem with 0x0000 on transition time (and I think it was sending this earlier anyway).

I’m trying to look online for any documentation for the TCPi Zigbee lights that might give us some info, but it’s hard to understand how the standard ST Zigbee DTH and SetLevel() worked fine for all those years.

Thanks for staying up late all this time and trying to work with me! I have dozens of these lights spread across a couple of systems, and really appreciate your help.