Skip to content

Instantly share code, notes, and snippets.

@danmandle
Created August 30, 2018 15:06
Show Gist options
  • Save danmandle/3bc0dcea1fa4751acef9bfc4a4542a63 to your computer and use it in GitHub Desktop.
Save danmandle/3bc0dcea1fa4751acef9bfc4a4542a63 to your computer and use it in GitHub Desktop.
Laundry Automation for Home Assistant using Amazon Dash buttons
- alias: Washer in Use Power Start
trigger:
- platform: numeric_state
entity_id: sensor.clothes_washer_power
above: 3.5
for:
seconds: 30
condition:
condition: state
entity_id: input_boolean.washer_in_use
state: 'off'
action:
- service: input_boolean.turn_on
data:
entity_id: input_boolean.washer_in_use
- alias: Washer in Use Power Finished
trigger:
- platform: numeric_state
entity_id: sensor.clothes_washer_power
below: 3.5
for:
minutes: 10
action:
- service: input_boolean.turn_off
data:
entity_id: input_boolean.washer_in_use
- service: notify.telegram_group
data_template:
title: '*Washer is done!*'
# The dryer is still in use. It will be done in {{ 60 - states.sensor.dryer_timer.state | int }} mins.
message: >
{%- if is_state('input_boolean.dryer_in_use', 'on') %}
The dryer is still in use. It will be done in XXX mins.
{%- else -%}
Into the dryer it goes.
{% endif %}
Wash cycle took {{ relative_time(states.automation.washer_in_use_power_start.attributes.last_triggered) }}
- alias: Dryer in Use Dash
trigger:
- platform: state
entity_id: binary_sensor.dash_gatorade
from: 'on'
to: 'off'
action:
- service: input_boolean.turn_off
data:
entity_id: input_boolean.dryer_in_use
- service: input_boolean.turn_on
data:
entity_id: input_boolean.dryer_in_use
# not triggering off of dash button because we might want to turn it on via the web interface. Allows for triggering via other stuff too, including voice assistant
- alias: Dryer Timer
trigger:
- platform: state
entity_id: input_boolean.dryer_in_use
to: 'on'
for:
minutes: 60
action:
- service: input_boolean.turn_off
data:
entity_id: input_boolean.dryer_in_use
- service: notify.telegram_group
data:
title: '*Dryer Done*'
message: 'Dryer is done'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment