We use these “modes” which are triggered by the state of a boolean to set the mode. Like “home”, “away”, “movietime” (in example), “night” and "vacation.
Could I have done this automation smoother / faster / leaner / more efficient? I am not skilled so please dont suggest anything to complicated.
##########################################################
## Kveldskos
##########################################################
- alias: Kveldskos
trigger:
- platform: state
entity_id: input_boolean.kveldskos
to: 'on'
from: 'off'
condition:
- condition: state
entity_id: input_boolean.gjestemodus
state: 'off'
action:
- service: light.turn_off
entity_id:
- light.hyllelys
- light.takspotter_kjokken
- light.taklampe_kjeller
- light.takspotter_stue
- service: light.turn_on
data:
entity_id: light.taklys_kjokken
transition: 2
brightness_pct: 20
- service: light.turn_on
data:
entity_id: light.benkebelysning
transition: 2
brightness_pct: 20
- service: light.turn_on
data:
entity_id: light.bordlampe
transition: 2
brightness_pct: 50
- service: light.turn_on
data:
entity_id: light.lampe_ved_ovn
transition: 2
brightness_pct: 50
- service: light.turn_on
data:
entity_id: light.lampe_pa_skjenken
transition: 2
brightness_pct: 20
- service: light.turn_on
data:
entity_id: light.lys_vinduskarmen
transition: 2
brightness_pct: 20
- service: light.turn_on
data:
entity_id: light.trappelys
transition: 2
brightness_pct: 20
- service: switch.turn_on
entity_id:
- switch.mikro
- switch.tv
- switch.media
- switch.daniel_nattbord
- service: switch.turn_off
entity_id:
- switch.gulvlampe
- switch.vifte_treningsrom
- service: homeassistant.turn_off
entity_id:
- input_boolean.godnatt
- input_boolean.gaar_hjemmefra
- input_boolean.kjorer_hjemmefra
- input_boolean.hjemme
- input_boolean.feriemodus
##########################################################
## Bedtime Guest Mode
##########################################################
##########################################################
## Reset Bedtime Switch
##########################################################
# - alias: Hjemme - Reset Switch
# trigger:
# - platform: state
# entity_id: input_boolean.hjemme
# from: 'off'
# to: 'on'
# for:
# hours: 0
# minutes: 6
# seconds: 0
# action:
# - service: homeassistant.turn_off
# entity_id: input_boolean.hjemme