Quantcast
Channel: Configuration - Home Assistant Community
Viewing all articles
Browse latest Browse all 108313

Energy meter removing solar energy

$
0
0

Good afternoon. some time ago they helped me here on the forum to create an energy meter (W), which stays at 0 when the solar energy exported to the grid is greater than 0, thus simulating the real energy that the energy plug spends:

  - platform: template
    sensors:
      watts_real:
        value_template: >-
          {% if ((states('sensor.watts_export') | float) <= 1) %}
            {{ ((states('sensor.plug') | float))  | round(1) }}
          {% endif %}
        friendly_name: 'xxxxxr'
        unit_of_measurement: 'W'

Lately I noticed a warning in the logs:

Logger: homeassistant.helpers.template
Source: helpers/template.py:1292
First occurred: 20:36:44 (4 occurrences)
Last logged: 20:36:44

Template warning: 'float' got invalid input 'unknown' when rendering template '{% if ((states('sensor.watts_export') | float) <= 1) %} {{ ((states('sensor.plug') | float)) | round(1) }} {% endif %}' but no default was specified. Currently 'float' will return '0', however this template will fail to render in Home Assistant core 2022.1

Does anyone know how to solve?
Ths

1 post - 1 participant

Read full topic


Viewing all articles
Browse latest Browse all 108313

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>