40 lines
868 B
YAML
40 lines
868 B
YAML
automation:
|
|
- alias: Encender Luz Habitación Estudio Normal
|
|
initial_state: 'on'
|
|
trigger:
|
|
- platform: state
|
|
entity_id: binary_sensor.movimiento_habitacion_estudio
|
|
to: 'on'
|
|
condition:
|
|
condition: or
|
|
conditions:
|
|
- before: sunrise
|
|
condition: sun
|
|
- after: sunset
|
|
condition: sun
|
|
action:
|
|
- service: homeassistant.turn_on
|
|
data:
|
|
entity_id:
|
|
- light.luz_habitacion_estudio
|
|
- service: timer.start
|
|
data:
|
|
entity_id: timer.luzhabitacionestudio
|
|
|
|
- alias: Apagar Luz Habitación Estudio Normal
|
|
initial_state: 'on'
|
|
trigger:
|
|
platform: event
|
|
event_type: timer.finished
|
|
event_data:
|
|
entity_id: timer.luzhabitacionestudio
|
|
action:
|
|
service: homeassistant.turn_off
|
|
data:
|
|
entity_id:
|
|
- light.luz_habitacion_estudio
|
|
|
|
timer:
|
|
luzhabitacionestudio:
|
|
duration: '00:03:00'
|