I have a Sengled Element RGB bulb that has a Zigbee interface. Zigbee2mqtt was used to get HS visibility and control. Resulting from this I have some recommendations on setting it up in mcsMQTT and also have a need to add additional capability of mcsMQTT to handle the color map used by HS vs. used by the Zigbee bulb.
The bulb information is provided in a JSON payload with state, brightness, color x, and color y parameters. Assuming that one desires to control all parameters, yet keep the parameters all grouped in HS screens, then the first step is on General Tab, Inbound (Subscription) Management and select the third JSON Decoding option to create both parent and child keys. This will handle the grouping. Remember to come back when done with the new bulb and change it back to the default first option of decoding into individual devices.
Next step is to accept the parameters of interest so they map into HS devices. This is shown in the second photo attachment. I have selected On/Off control, Brightness control, and Color(x) control. Right now color x and y are not supported by HS so I need to make an update to mcsMQTT to convert it to RGB. I will do it so that only x or y needs to be selected and it will do the transform on either.
Next enter the publish topic in each of the three text boxes. It will be the same topic and it will be the same as the base sub topic with a /set suffix.
Next use Edit tab (click on Ref button on color(x) device) and change the type to be a Color Picker. This will give the desired UI for color selection in HS.
Next use the Edit tab and change the Publish Payload Template for JSON formatting. In this case it will be {"state":"$$STATUS:"}
Next use the Edit tab to similarly change the Publish Payload Template for JSON formatting of brightness as {"brightness":"$$VALUE"}
Next use the HS Device Management for the Brightness device. Status Graphics tab and change the range to 0 to 255. Also change the type to slider.
The Sengled bulb will retain prior parameter settings so when a bulb is turned OFF, for example, it will remember its brightness and color settings so when turned ON it will restore to the same as when turned OFF. Same for all parameters. This is what allows individual HS device for each parameter.
It is also possible to publish all parameters in one MQTT message. To accomplish this the scripting capability of mcsMQTT will need to be used.
As mentioned above the color control from HS to this bulb is not possible because a transformation between RGB and XY still needs to be implemented in mcsMQTT. I will update these instructions once it is done.
The bulb information is provided in a JSON payload with state, brightness, color x, and color y parameters. Assuming that one desires to control all parameters, yet keep the parameters all grouped in HS screens, then the first step is on General Tab, Inbound (Subscription) Management and select the third JSON Decoding option to create both parent and child keys. This will handle the grouping. Remember to come back when done with the new bulb and change it back to the default first option of decoding into individual devices.
Next step is to accept the parameters of interest so they map into HS devices. This is shown in the second photo attachment. I have selected On/Off control, Brightness control, and Color(x) control. Right now color x and y are not supported by HS so I need to make an update to mcsMQTT to convert it to RGB. I will do it so that only x or y needs to be selected and it will do the transform on either.
Next enter the publish topic in each of the three text boxes. It will be the same topic and it will be the same as the base sub topic with a /set suffix.
Next use Edit tab (click on Ref button on color(x) device) and change the type to be a Color Picker. This will give the desired UI for color selection in HS.
Next use the Edit tab and change the Publish Payload Template for JSON formatting. In this case it will be {"state":"$$STATUS:"}
Next use the Edit tab to similarly change the Publish Payload Template for JSON formatting of brightness as {"brightness":"$$VALUE"}
Next use the HS Device Management for the Brightness device. Status Graphics tab and change the range to 0 to 255. Also change the type to slider.
The Sengled bulb will retain prior parameter settings so when a bulb is turned OFF, for example, it will remember its brightness and color settings so when turned ON it will restore to the same as when turned OFF. Same for all parameters. This is what allows individual HS device for each parameter.
It is also possible to publish all parameters in one MQTT message. To accomplish this the scripting capability of mcsMQTT will need to be used.
As mentioned above the color control from HS to this bulb is not possible because a transformation between RGB and XY still needs to be implemented in mcsMQTT. I will update these instructions once it is done.
Comment