homeassistant/packages/indoor_security_light.yaml

30 lines
709 B
YAML
Raw Permalink Normal View History

input_datetime:
security_lights_interior_time_off:
has_time: true
initial: '22:30'
#
# security_lights_interior_on_offset:
# has_time: true
# initial: ':00'
automation:
- alias: security_lights_interior_time_off
trigger:
- platform: template
value_template: "{{ states('sensor.time') == states('input_datetime.security_lights_interior_time_off')[0:5] }}"
action:
- service: switch.turn_off
data:
entity_id: group.sonoffs
- alias: security_lights_interior_time_on
trigger:
platform: sun
event: sunset
offset: "-00:45:00"
action:
- service: switch.turn_on
data:
entity_id: group.sonoffs