automation:
- alias: 'Rule 1 Light on in the evening'
trigger:
- platform: sun
event: sunset
offset: '-01:00:00'
- platform: state
entity_id: group.all_devices
state: 'home'
condition:
- platform: state
entity_id: group.all_devices
state: 'home'
- platform: time
after: '16:00:00'
before: '23:00:00'
action:
service: homeassistant.turn_on
entity_id: group.living_room
- alias: 'Rule 2 - Away Mode'
trigger:
platform: state
entity_id: group.all_devices
state: 'not_home'
action:
service: light.turn_off
entity_id: group.all_lights
- alias: 'Leave Home notification'
trigger:
platform: zone
event: leave
zone: zone.home
entity_id: device_tracker.paulus
condition:
platform: time
after: '20:00'
action:
service: notify.notify
data:
message: 'Paulus left the house'