I have a couple Xiaomi Yeelights, and I want to make an automation where I can turn on a button and it activates a scene, but when I turn it off, it returns to the previous state. I now have this for the automation:
- alias: "Kantoor chill"
trigger:
- platform: mqtt
topic: "scenes/kantoorChill/cmnd"
payload: "ON"
action:
- service: scene.create
data:
scene_id: before_chill_kantoor
snapshot_entities:
- light.kantoor
- light.bureau_strip
- service: scene.turn_on
entity_id: scene.chill
- service: mqtt.publish
data:
topic: "scenes/kantoorChill/stat"
payload: "ON"
- alias: "Kantoor normaal"
trigger:
- platform: mqtt
topic: "scenes/kantoorChill/cmnd"
payload: "OFF"
action:
- service: scene.turn_on
entity_id: scene.before_chill_kantoor
- service: mqtt.publish
data:
topic: "scenes/kantoorChill/stat"
payload: "OFF"
I normally have the lights turned to white with a warmer temperature. But, when I turn off the button (and activate scene.before_chill_kantoor) the light turns to rgb[255,255,255] instead of the white which it was set as. Is there any way to only save the white values or something like that?
Thanks!