# Vacation Package # ----------------------------------------------------------------------------- # Vacation Helpers input_boolean: vacation_mode: name: Vacation Mode input_number: # Threshold for minimum distance to trigger vacation mode (set to 0 to disable) vacation_proximity_threshold: name: Vacation Proximity Threshold mode: box min: 0 max: 1000 initial: 250 step: 10 unit_of_measurement: km # ----------------------------------------------------------------------------- # Vacation Automations automation: - alias: Vacation - Turn On Vacation Mode trigger: - platform: state entity_id: input_select.house_presence_state to: 'Extended Away' - platform: state entity_id: alarm.alarm_control_panel to: armed_vacation - platform: template value_template: >- {{ states('input_number.vacation_proximity_threshold')|default(0)|float > 0 and states('proximity.home')|default(0)|float >= states('input_number.vacation_proximity_threshold')|default(0)|float }} action: - service: input_boolean.turn_on target: entity_id: input_boolean.vacation_mode - alias: Vacation - Turn Off Vacation Mode trigger: - platform: state entity_id: input_select.house_presence_state to: 'Just Arrived' - platform: state entity_id: input_select.house_presence_state to: 'Home' action: - service: input_boolean.turn_off target: entity_id: input_boolean.vacation_mode - alias: Vacation - Turn On Dining and Kitchen Lights at Sunset trigger: - platform: sun event: sunset offset: '-00:30:00' condition: "{{ is_state('input_select.house_presence_state', 'Extended Away') }}" action: - delay: "00:{{ range(0,59)|random|int }}:00" - service: light.turn_on target: entity_id: light.dining_room_light - service: light.turn_on target: entity_id: light.kitchen_light - delay: '02:00:00' - service: light.turn_off target: entity_id: light.dining_room_light - service: light.turn_off target: entity_id: light.kitchen_light - alias: Vacation - Turn On Living Room Lights after Dinner trigger: - platform: time at: '18:30:00' condition: "{{ is_state('input_select.house_presence_state', 'Extended Away') }}" action: - delay: "00:{{ range(0,59)|random|int }}:00" - service: light.turn_off target: entity_id: light.dining_room_light - service: light.turn_off target: entity_id: light.kitchen_light - service: light.turn_on target: entity_id: light.living_room_light - delay: '02:00:00' - service: light.turn_off target: entity_id: light.living_room_light - alias: Vacation - Turn Off Living Room Lights at Bedtime trigger: - platform: time at: '20:30:00' condition: "{{ is_state('input_select.house_presence_state', 'Extended Away') }}" action: - delay: "00:{{ range(0,59)|random|int }}:00" - service: light.turn_off target: entity_id: light.living_room_light