Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- blueprint:
- name: Coming Home
- description: Track when a person comes home
- domain: automation
- input:
- person:
- name: Person
- description: Person to track
- selector:
- target:
- persons_not_home:
- name: Persons not home
- description: Person which should not be home
- selector:
- target:
- delay_min:
- name: Delay minimum
- description: How short delay
- default: 10
- selector:
- number:
- min: 0
- max: 300
- mode: slider
- step: 10
- unit_of_measurement: "seconds"
- delay_max:
- name: Delay maximum
- description: How long delay
- default: 50
- selector:
- number:
- min: 10
- max: 600
- mode: slider
- step: 10
- unit_of_measurement: "seconds"
- trigger:
- - platform: state
- entity_id: !input person
- to: home
- mode: single
- variables:
- person: !input person
- persons_not_home: !input persons_not_home
- delay_min: !input delay_min
- delay_max: !input delay_max
- action:
- - delay: "{{ range(delay_min | int, delay_max | int) | random }}"
- - choose:
- - conditions:
- - condition: state
- entity_id: "{{ person }}"
- state: "home"
- - condition: state
- entity_id: "{{ persons_not_home }}"
- state: "not_home"
- sequence:
- - service: mqtt.publish
- data:
- topic: home-assistant/turn_off
- payload: '1'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement