Aaliss
1
how do i change colors or color scenes(romantic, movie…) every click of wireless button?
now i just can change it once with this script.
- alias: Change lights color
trigger:
platform: event
event_type: click
event_data:
entity_id: binary_sensor.switch_158d0001d8ea53
click_type: long_click_press
action:
service: light.turn_on
entity_id:
- light.yeelight_rgb_7c49eb0ff332
- light.yeelight_rgb_7c49eb1028fd
data:
brightness: 255
kelvin: 2700
Need advise or link to similar topic, please.
AlexStann
(AlexStann)
2
Hi. I use 2 types templates
for similar cases:
-
random with scripts:
alias: Good morning
trigger:
- at: 06:55:00
platform: time
condition:
- condition: time
weekday:
- mon
- tue
- wed
- thu
- fri
action:
- data: {}
service_template: script.{{range(11,14) | random}}
-
serial with scripts:
alias: Cube flip 90 Onkyo source
trigger:
- event_data:
action_type: flip90
entity_id: binary_sensor.cube
event_type: cube_action
platform: event
condition: []
action:
- data_template:
entity_id: '{% if states.media_player.onkyo.attributes.source == ''PC'' %} script.002
{% elif states.media_player.onkyo.attributes.source == ''ChromeCast'' %} script.001
{% else %} n/a {% endif %}'
service: script.turn_on