Newbie question here.
If i click (all single click) on a button i want three actions to happen with different entitiy’s.
How do i make that code efficient?
This is how i do it now:
- alias: Klik, weg of op bed
trigger:
platform: event
event_type: click
event_data:
entity_id: binary_sensor.switch_158d00016bf4ca
click_type: single
action:
service: light.turn_off
data:
entity_id: group.woonkamer
- alias: Klik, tv uit
trigger:
platform: event
event_type: click
event_data:
entity_id: binary_sensor.switch_158d00016bf4ca
click_type: single
action:
service: switch.turn_off
data:
entity_id: switch.yeelight_2
- alias: Klik, licht keuken en washok in avond aan
trigger:
- platform: event
event_type: click
event_data:
entity_id: binary_sensor.switch_158d00016bf4ca
click_type: single
condition:
condition: time
after: '21:30:00'
before: '02:00:00'
action:
- service: light.turn_on
data:
entity_id: light.fibaro_system_fgd212_dimmer_2_level_4
brightness: 50
- service: light.turn_on
entity_id: light.fibaro_system_fgd212_dimmer_2_level_2
Three times the same at code at alias.
Can i get the three actions together under the “click” code?
How do i do that?
The last 2 services, the lights that turn on.
Both’s lights are connected to a motion sensor.
2 minutes no motion, turn off the light.
Is is possible that when the lights are turned on with this switch (only with this action) between 21:00 and 2:00 the dimmer gets disabled?
So that the light only has to go off when i turn them off with another switch.