I am using automations directly to implement home/away/vacation/guest and other modes.
For example, when i set the house alarm “away” when going out, the away automation triggers switching off all lights, closing all shutters etc and when i come back the “back home” automation triggers opening some shutters, some lights etc using some service templates.
I was wondering the best use case for these type of automations. Feels like i have to create home/away/vacation/guest etc scenes and in my automations i should turn on the related scene; altough i am not sure if scenes support service templates… Or should i leave them all as it is, all in automations?
Example of my current automation:
- alias: Shut Everything Down on Bedtime or Away
trigger:
- platform: template
value_template: "{{is_state_attr('alarm_control_panel.area_a','stay_armed', True)}}"
- platform: template
value_template: "{{is_state_attr('alarm_control_panel.area_a','armed', True)}}"
action:
- service: light.turn_off
entity_id: group.all_lights
- service: media_player.turn_off
entity_id: media_player.salon_tv
- service: cover.close_cover
data:
entity_id:
- cover.qubino_salon_pencere_level
- cover.qubino_salon_balkon_level
- cover.qubino_mutfak_pencere_level
- cover.qubino_mutfak_balkon_level
- cover.qubino_calisma_odasi_level
- cover.qubino_cocuk_balkon_level
- cover.qubino_misafir_level
- cover.qubino_sinema_level
- cover.qubino_kis_bahcesi_level
- cover.qubino_teras_level
# SUMMER TIME:
- service_template: >
{%- if is_state_attr('alarm_control_panel.area_a','armed',True) -%}
cover.close_cover
{%- else -%}
script.continue
{% endif %}
data:
entity_id:
- cover.qubino_ebeveyn_level
- cover.qubino_cocuk_pencere_level
id: ef24667b84ff419487795ad02bbfa80f