It’s difficult to tell because you haven’t formatted the code properly, but it looks like you are missing the sensor: key before you started saying - platform: template
But in any case number 2 -
There is no need to set this specific sensor up in YAML, you can do this in the UI in Devices and Services > Helpers > Template > Sensor
Hi, I added this function. Im receiving negative values from this sensor.
I would like to filter negative values to 0. The result I receive is unavailable. I dont understand why. May someone give some input?
type or paste code here
`Hi, I added this function. Im receiving negative values from this sensor.
I would like to filter negative values to 0. The result I receive is unavailable. I dont understand why. May someone give some input?
{% if states("sensor.maquina_lavar_loica_power") >= 0 %}
{{ states("sensor.maquina_lavar_loica_power") | round (2)}}
{% else %}
{{0}}
{% endif %}`