#Question on the proper operation of RGB lights

1 messages · Page 1 of 1 (latest)

hollow path
#

Hi All, (hopefully) quick question on how the RGB light color picker in Home Assistant is supposed to work. I have a DIY device that has an RGB light that connects to Home Assistant over MQTT. The light identifies as RGB capable, and when I look at in the device section, I get a RGB color picker to set the color. (see attached pic)

When I click on a color, a small circle appears where I clicked to show what color I chose. That circle lasts for a second or two and then disappears. Is that how it is supposed to work? Or is the small circle supposed to stick around to let me know what color I chose?

opal cove
#

That behaviour I believe means your device is responding to the message "hey set this colour" with "nah mate, this is my colour"

hollow path
#

I think you are right, but I don't know how to fix it. According to the documentation for the MQTT light, commands to change the light state are sent on a command topic, and the light should respond on a state topic with the new state of the light.

I have implemented this, and verified that it correctly tells Home Assistant when the light state is changed from on to off, but it does not seem to work for colors. Am I messing up the format of the published state?

The recieved message on the command topic from home assistant is:
payload: {"state":"ON","color":{"r":196,"g":86,"b":255}}

and my device responds on the state topic with:
{"state": "ON", "brightness": 99, "color": {"g": 86, "b": 255, "r": 196}}

I wanted to make sure what I am seeing is not the expected behavior before I get too far into the weeds on how it works...

opal cove
#

I'm afraid someone else will have to chime in there. It looks sensible, but I'm not very experienced at playing with mqtt payloads