Automation never triggers

Hi All,

I’ve been using HA for a few years and most of the time I can generally find the answer in the community but I can’t work out why this isn’t working;

I have a TP-Link HS-110 monitoring the energy usage on my washing machine. With a template sensor (this might not be the right name just in case the code from my config.yaml is here:)

sensor:
  - platform: template
  # TP Link - switches energy usage
    sensors:
      washing_machine_in_use:
        friendly_name: 'Washing Machine in use?'
        value_template: '{{ states.switch.washing_machine.attributes["current_power_w"] | replace(" W", "") | float >1.5 }}'

This I found on the forum and works well.

I’m then trying to trigger an automation when the above value switches to FALSE. This automation has two actions; set the input helper that the washing machine needs unloading to TRUE and then sends an app notification. I’m doing this through the UI as I’ve never been brave enough to try and get my head around automations in yaml.

Firstly my trigger and as you can see no conditions;

Then the actions;

In the logbook I can see the state of ‘sensor.washing_machine_in_use’ changing to false but the above automation isn’t triggered. In the system logs I can’t see an error that looks like it might be related but I may not be recognising it for what it is.

If I manually trigger it then it works.

I’ve then got a Xaomi contact sensor on the door to trigger an automation that sets ‘input_boolean.kitchen_washing_machine_needs_unloading’ to off and that triggers every time.

I’ve re-created the automation now multiple times and attempted to do the same thing for the same smart plug on the dishwasher and tumble dryer to get the same results.

I’m happy to accept that this is likely to be user error but after a month of trying to work it out I’ve admitted defeat. Someone point out the error of my ways! :wink:

Thanks in advance

Go zo Developer Tools -> States and see what the actual states of your sensor are. It’s probably True instead of TRUE (case sensitive). Also it would be better to put the sensor code in the category binary_sensor instead of sensor, this way you get a sensor that shows on and off.

2 Likes

IMO that should also be a binary_sensor rather than a sensor - binary sensors are on/off (true/false) rather than what you’ve currently got which is a string of (probably) True or False.

Thanks, both.

It was a case sensitive state.

I’ve changed all three ‘appliance_in_use’ sensors to binary sensors and currently testing.