I think this issue started since 0.88 version.
The Broadlink SP3 socket, which I use to check if the bedroom TV is on, started to act weirdly. It is working, because I can see the watt usage, I just don’t like the logs being full with this message.
2019-02-26 12:12:18 WARNING (MainThread) [homeassistant.helpers.condition] Value cannot be processed as a number: <state sensor.bedroom_tv_load=; friendly_name=bedroom_tv_load, hidden=True @ 2019-02-26T12:12:18.150749+01:00> (Offending entity: )
Yeah, hmm. I’m not sure why you are getting that error. But your TV load does not match what the switch is saying. I was hoping to see that it contained units, but that doesn’t seem to be the issue. Is that 0.24 value the current load with the TV on?
the value is valid, it’s not on right now. When it’s on, the value changes, and it’s a valid change again. So no problem with the value, that’s what I was saying. It is working, automation depending on it runs with no problem.
The only problem is that HA has lots of warning in the log.
Yes, and something that would spark that warning would be characters that doesn’t allow it to convert the value into a number. I understand your problem, just trying to see where the error could be coming from.
So, give this a whirl
bedroom_tv_load:
value_template: >
{% set s = state_attr('switch.bedroom_tv_socket', 'current_power_w') %}
{{ s | float if s else 0.0 }}
Basically asserts that it needs a number otherwise it returns zero.