Skip to content

Instantly share code, notes, and snippets.

@hrosenbauer
Forked from tathamoddie/washing.yaml
Created January 13, 2023 08:32
Show Gist options
  • Select an option

  • Save hrosenbauer/c8fba698c06dbf3a9289e3ee9bbcbfe2 to your computer and use it in GitHub Desktop.

Select an option

Save hrosenbauer/c8fba698c06dbf3a9289e3ee9bbcbfe2 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