Closed ghost closed 4 years ago
This is an issue from MQTT, it reports all colour values, but doesn't update or hides the one not in use. We save these and then restore them, but we don't know what attribute had the right colour.
MQTT should only report the attribute with the right colour.
I investigated the MQTT messages that get send when I change the color in the scene editor. The message that is send to the command topic looks like this:
{
"state": "ON",
"color": {
"r": 255,
"g": 36,
"b": 91
}
}
The message that is received on the state topic looks like this:
{
"state": "ON",
"color": {},
"r": 255,
"g": 36,
"b": 91,
"brightness": 165,
"effect": "solid"
}
My problem is the formatting of the state topic in my special case. I will have to investigate further why the RGB values are not nested under the color attribute. For testing purposes I sent the message from the command topic to the state topic and that's how I was able to solve the issue I had. And when I save the scene also the correct color values are stored in the file. So sorry that mistake was in my configuration and not in the scenes editor.
@bramkragten Thanks for your reply! You got me in the direction of thinking to investigate my MQTT messages further and that's where my problem was.
Checklist
The problem
When I set the color of a MQTT light (only supports
rgb
) in the scenes editor the light turns to the correct color but when I then save that scene without doing any further changes and activate it from the UI. The light just turns white (RGB values of 255).Expected behavior
The light should turn to it's set color in the scenes editor.
Steps to reproduce
Environment
State of relevant entities
Attributes of the light after scene was activated:
Problem-relevant configuration
The MQTT Light has the following config:
Snippet from the
scenes.yaml
file when saved from the scenes editor:Additional information
I noticed that when I configure the scene in the scenes editor and click on some color in the UI the physical color of the light changes but the values don't (as shown in the following screenshot)
For other MQTT lights (without JSON schema) the scenes editor works just fine and all the color values in the
scenes.yaml
file are set correctly.