Hi all,
I want to set a specific rgb color for my Xiaomi gateway when double press through a Xiaomi smart switch. Problem is that rgb_color is working only if I use homeassistant.turn_on service. If I change to homeassistant_toggle or light.toggle, the light returns to default white. Only brightness is recognized.
With what I have now is working fine, but I want to toggle the light, not just turn it on.
The code:
It’s working either with homeassistant.turn_on or with light.turn_on but the problem is that I want also to be able to turn it off (with the same process if possible) just like toggle.
But with light.toggle, rgb_color setting is not working. Returns back to default white.
Yes, I was just going to suggest that. Make a condition if the light is on, turn it off, and if the light is off, set the color and do a light.turn_on.