Created
November 10, 2017 19:45
-
-
Save plett/1e1719f0530a81f024dcb3c6564a573a to your computer and use it in GitHub Desktop.
Home Assistant Tumble Drier Finish Notification Automation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#this is the tplink HS110 | |
switch: | |
- platform: tplink | |
host: ip.add.ress.here | |
name: "Tumble Dryer" | |
# These template sensors get updated each time the tplink reports data and are true or false depending on the current draw in the last message | |
sensor: | |
- platform: template | |
sensors: | |
dryer_power_high: | |
value_template: '{{ states.switch.tumble_dryer.attributes["Current consumption"] | replace(" W","")|float > 10}}' | |
entity_id: switch.tumble_dryer | |
- platform: template | |
sensors: | |
dryer_power_low: | |
value_template: '{{ states.switch.tumble_dryer.attributes["Current consumption"] | replace(" W","")|float < 10}}' | |
entity_id: switch.tumble_dryer | |
#this is the last known state of the drier so we can tell if the new reading has changed | |
input_boolean: | |
dryer_running: | |
name: Tumble Dryer Running | |
initial: off | |
icon: mdi:washing-machine | |
automation: | |
- alias: 'Detect Dryer Start' | |
trigger: | |
platform: state | |
entity_id: sensor.dryer_power_high | |
from: 'False' | |
to: 'True' | |
action: | |
service: input_boolean.turn_on | |
entity_id: input_boolean.dryer_running | |
- alias: 'Detect Dryer Finish' | |
trigger: | |
platform: state | |
entity_id: sensor.dryer_power_low | |
from: 'False' | |
to: 'True' | |
for: | |
seconds: 30 # a little bit of de-bouncing | |
condition: | |
condition: state | |
entity_id: input_boolean.dryer_running | |
state: 'on' | |
action: | |
- service: input_boolean.turn_off | |
entity_id: input_boolean.dryer_running | |
- service: notify.paul_pushbullet | |
data: | |
message: "The tumble dryer has finished running" | |
title: "House" | |
#the pushbullet configuration | |
notify: | |
- name: paul_pushbullet | |
platform: pushbullet | |
api_key: secret key here |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment