Hi All,
I am making a custom device that is meant to talk to Home Assistant. The device has an RGB LED and I am trying to get it to work with the MQTT Light integration. The light is set up to use the JSON schema. The components
section of the discovery message for the light is
'components': {
'52744aad-7de2-4d1f-adee-73a34a334998_neopixel': {
'schema': 'json',
'brightness': 'false',
'name': 'Neopixel',
'platform': 'light',
'state_topic': 'homeassistant/device/52744aad-7de2-4d1f-adee-73a34a334998/neopixel/state',
'command_topic': 'homeassistant/device/52744aad-7de2-4d1f-adee-73a34a334998/neopixel/cmd',
'supported_color_modes': ['rgb'],
'unique_id': '52744aad-7de2-4d1f-adee-73a34a334998_neopixel'},
}
This mostly works, the light shows up in Home Assistant, and I can send RGB values to it. However, when using the color picker, I choose a color, and the cursor highlights the color for a second and then disappears. I think this is because my device does not respond correctly to the command with a state topic telling Home Assistant that the color actually changed.
The command topic payload from Home Assistant as seen by the device 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}}
so I guess I have two questions:
- Is the behavior of the color picker that I described correct? Is it supposed to only show the actual color for a second or two?
- If the answer to #1 is ‘no’, what is the correct state response to tell Home Assistant that the RGB color has changed?