I was trying to create a trigger on the power consumption for my entire flat, in order to stop some radiators, before that the main trip let me in the dark.
I created with the UI, an Automation that did not work and I could not understand why.
The log where giving me that abscond message.
[homeassistant.components.homeassistant.triggers.numeric_state] Error in ‘Power Dispatch On’ trigger: In ‘numeric_state’ condition: entity sensor.meter_general_active_power state ‘’ cannot be processed as a number
When I looked at the yaml of the automation it was looking like this :
alias: Power Dispatch On
description: Disconnect heating on high power request
trigger:
- platform: numeric_state
entity_id: sensor.meter_general_active_power
value_template: ""
above: 1500
for:
hours: 0
minutes: 0
seconds: 1
condition: []
action:
The root cause of the fault was coming from the line:
value_template: ""
I do not know how it came in the Yalm, most likely an action on the UI done by me, during a test, trying to get the thing to work. But once it’s there the UI will not remove it.
As it’s empty, it’s not visible. I have tried to reproduce how I did it, but I failed miserably (so I could not raise a bug)
Once this line was removed my automation worked
alias: Power Dispatch On
description: Disconnect heating on high power request
trigger:
- platform: numeric_state
entity_id: sensor.meter_general_active_power
above: 4800
for:
hours: 0
minutes: 0
seconds: 0
condition: []
action:
- service: climate.turn_off
data: {}
target:
area_id:
- shower
- chambre
- bureau
- cuisine
- salon
- service: water_heater.turn_off
data: {}
mode: single