Home / Away / Vacation etc modes and scenes

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

1 Like

Personal opinion would be to have a separate automation for each alarm state.

I started off having one automation triggered by each sperate alarm state and then with choose actions to carry out various functions based on the state the alarm had just changed to (armed_home, armed_night, armed_away & disarmed)

However the automation got a little too large for my liking and I ended up making a separate automation for each state. Shortly afterwards (before run in parallel was an option) I decided to start off loading some of the repeated actions to scenes.

However doing it this way with scenes, I soon found that I could not easily add any intelligence by this method. For example when leaving and alarm going to state armed_away I might call a scene that turns off all lights, however if we are leaving and its dark and the dogs are in the house I may want to leave a couple of lights on, or if its hot maybe leave a fan on - adding this sort of thing when predominantly calling scenes is not possible unless I create 101 scenes for all eventualities.

So long story short, I went back to simply having one automation for each alarm state.

2 Likes