Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- mqtt:
- broker: ***
- port: 1883
- client_id: home-assistant-1
- keepalive: 60
- username: ***
- password: ***
- device_tracker:
- - platform: nmap_tracker
- hosts: 192.168.0.1-255
- home_interval: 1
- interval_seconds: 30
- consider_home: 900
- ifttt:
- key: ***
- notify:
- - platform: pushbullet
- api_key: ***
- name: pushbullet
- switch:
- - platform: wemo
- - platform: mqtt
- state_topic: "home/killhass"
- command_topic: "home/killhass"
- name: "KillHass"
- qos: 0
- payload_on: "ON"
- payload_of: "OFF"
- optimistic: false
- state_format:
- script:
- restarthawemo:
- alias: "Restart HA if WeMo isn't found after 15 minutes"
- sequence:
- - delay:
- minutes: 15
- - execute_service: notify.pushbullet
- service_data:
- message: 'WeMo not found, restarting HA'
- - execute_service: switch.turn_on
- service_data:
- entity_id: switch.killhass
- automation:
- - alias: "Restart HA if WeMo switch isn't found after 15 minutes"
- trigger:
- platform: state
- entity_id: device_tracker.wemo
- from: 'not_home'
- to: 'home'
- condition:
- - platform: template
- value_template: '{% if states.switch.wemo %}false{% else %}true{% endif %}'
- - platform: state
- entity_id: script.restarthawemo
- state: 'off'
- action:
- service: homeassistant.turn_on
- entity_id: script.restarthawemo
- - alias: 'Stop HA'
- trigger:
- - platform: state
- entity_id: switch.KillHass
- state: 'on'
- action:
- service: homeassistant.stop
- - alias: 'Stop restarting HA is WeMo is found'
- trigger:
- platform: template
- value_template: '{% if states.switch.wemo %}true{% else %}false{% endif %}'
- condition:
- platform: state
- entity_id: script.restarthawemo
- state: 'on'
- action:
- service: homeassistant.turn_off
- entity_id: script.restarthawemo
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement