Skip to content

Instantly share code, notes, and snippets.

@tathamoddie
Created January 5, 2023 09:58
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save tathamoddie/972a5666d6b025ef02ef7d55bc186f9c to your computer and use it in GitHub Desktop.
Save tathamoddie/972a5666d6b025ef02ef7d55bc186f9c to your computer and use it in GitHub Desktop.
alias: "[Washing] Done"
description: ""
trigger:
- platform: numeric_state
entity_id: sensor.washing_machine_power
for:
hours: 0
minutes: 0
seconds: 0
above: "500"
condition: []
action:
- variables:
start_energy: "{{ states('sensor.washing_machine_energy') }}"
- wait_for_trigger:
- platform: state
entity_id:
- sensor.washing_machine_power
to: "0"
for:
hours: 0
minutes: 5
seconds: 0
continue_on_timeout: false
- variables:
end_energy: "{{ states('sensor.washing_machine_energy') }}"
- service: notify.everyone
data:
title: 🫧 So Fresh and So Clean
message: Washing is done. Used {{ (end_energy - start_energy)|round(2) }}kWh.
mode: single
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment