I’m trying to create a template configuration but I suspect something is wrong with it?
- platform: template
sensors:
sma_solar_power_filtered:
friendly_name: Solar Power
unit_of_measurement: 'kW'
# The register returns a value of "2147483648" when no solar is available.
# This template filters that value out as 0
value_template: >-
{% if states('sensor.SMA_Solar_Power') >= 20000 %}
0
{% else %}
{{ states('sensor.SMA_Solar_Power') }}
{% endif %}
It validates fine, but when I try to restart HA I see this on the screen and restart doesn’t happen:
The only log I see in the system logs looks unrelated and doesn’t come up if this template isn’t there. The modbus config just above which seems to be functioning just fine otherwise:
Thanks @francisp I took another look at the documentation and updated the yaml.
The annoying thing is that every time I revisit the install, HA seems to have a heap of changes that break it’s backward compatibility. Most of my 2021 configuration isn’t compatible with the latest 2023 version of HA any more!