Dishwasher config

Hiyas

im going nuts about a automation that should be really simple.
I made a sensor called sensor.dishwasher_running, that do work, It changes from True to False or the other way around.

But i cant get HA to send me a notification about it.
If anyone could look at the code and see what im doing wrong?

  - alias: 'Rule 018 - Diskmaskinen'      
trigger:
  platform: state
  entity_id: 
  - sensor.dishwasher_running
  from: 'True'
  to: 'False' 
action:
  - service: notify.iphone7    
    data_template:
      message: 'Diskmasinen är klar (current power: {{ states.switch.diskmaskin.attributes.current_power_mwh }})'

Sorry everyone, you can remove this post! Just when i did hit send i remember that states.switch.diskmaskin is changed cause of new Vera config.

My bad!

@Daniel_Gronlund
Wait a minute! how are you getting the status of the dishwasher? Sensor? Do share

Hi

I just use a power plug that can messure the mwh.

In my sensors.yaml i have created two sensors (maybe not the 100% right way todo it)

  - platform: template
sensors:
  dishwasher_running:
    value_template: '{{ states.switch.diskmaskin_32.attributes.current_power_mwh > 1401}}'
    friendly_name: 'Diskmaskin pa'

  - platform: template
sensors:
  dishwasher_running_state:
    value_template: '{% if is_state("sensor.dishwasher_running", "True") %}Diskar{% else %}Diskar ej{% endif %}'
    friendly_name: 'Dishwasher State' 

The 2nd sensor is just to make it look better in the UI

Then I have a automation fot notify

  - alias: 'Rule 018 - Diskmaskinen'      
trigger:
  platform: state
  entity_id: 
  - sensor.dishwasher_running
  from: 'True'
  to: 'False' 
action:
  - service: notify.iphone7    
    data_template:
      message: 'Diskmasinen är klar (current power: {{ states.switch.diskmaskin_32.attributes.current_power_mwh }})' 

I did include current power so i can make sure that its really done,

In the UI I just added the “sensor.dishwasher_running” and changed the Icon to a dishwasher

Awesome! I do like the idea :smile:
I really need to use templates in my automations so valuable, I have the hardest time getting them started! Thanks for the ideas!