Philip
Well-Known Member
Nieuwe versie
Code:########################## ## Vacation mode on ########################## - id: 'Vacation mode: turn on' alias: Vakantiemodus aan initial_state: "on" trigger: - platform: state entity_id: group.family from: "home" to: "not_home" for: "24:00:00" condition: [] action: - service: input_boolean.turn_on entity_id: input_boolean.vakantiemodus - service: notify.mobile_app_nokia_7_plus data: message: Goeie reis! Geniet er van! Ik heb alvast vakantiemodus geactiveerd. - service: notify.mobile_app_iphone_kim data: message: Goeie reis! Geniet er van! Ik heb alvast vakantiemodus geactiveerd. ########################## ## Vacation mode off ########################## - id: 'Vacation mode: turn off' alias: Vakantiemodus uit initial_state: "on" trigger: - platform: state entity_id: group.family from: not_home to: home condition: - condition: state entity_id: input_boolean.vakantiemodus state: "on" action: - service: input_boolean.turn_off entity_id: input_boolean.vakantiemodus - service: notify.mobile_app_nokia_7_plus data: message: Home sweet home. Ik heb de vakantiemodus gedeactiveerd. - service: notify.mobile_app_iphone_kim data: message: Home sweet home. Ik heb de vakantiemodus gedeactiveerd. ######################################## ## Vacation mode light automations ######################################## - id: 'Turn on vacation lights upstairs to simulate presence' alias: Vakantie lichten boven willekeurig aan initial_state: on trigger: platform: time at: '21:45:00' condition: - condition: state entity_id: input_boolean.vakantiemodus state: 'on' action: - delay: '00:{{ range(01,30) | random | int }}:00' # Toggling random entity state - service: homeassistant.turn_on data_template: entity_id: "{{ state_attr('group.simulation_bovenverdieping','entity_id') | random }}" - service: notify.mobile_app_nokia_7_plus data: message: Ik heb je simulatielichten boven aangestoken om {{ now().strftime('%H') }}:{{now().strftime('%M') }}. - id: 'Turn off vacation lights to simulate presence' alias: Vakantie lichten uit initial_state: on trigger: platform: time at: '22:30:00' condition: - condition: state entity_id: input_boolean.vakantiemodus state: 'on' action: - delay: '00:{{ range(01,30) | random | int }}:00' - service: homeassistant.turn_off entity_id: group.simulation_lights_off - service: notify.mobile_app_nokia_7_plus data: message: Ik heb je aanwezigheidssimulatie met lichten gestopt om {{ now().strftime('%H') }}:{{now().strftime('%M') }}.
Ziet er goed uit... denk ik
