Hello everybody,
After some trial and error I managed to get some sensors on the Lovelace UI.
Unfortunately I have some trouble with them. I spent some hours looking for the anser here in de community and other places on the Internet.
This is happening:
My overal sensor is displaying the right values (just like the ones I receive from PVOutput when I do an API call.
But my individual sensors are displaying no data:
This is my setup in configuration.yaml
sensor:
- platform: pvoutput
name: Zonnepanelen
system_id: 28710
api_key: *my API key*
scan_interval: 300
- platform: template
sensors:
power_consumption:
value_template: >
{% if is_state_attr("sensor.pvoutput", "power_consumption", "NaN") %}0{% else %}{{ state_attr('sensor.pvoutput', 'power_consumption') }}{% endif %}
friendly_name: 'Using'
unit_of_measurement: 'Watt'
energy_consumption:
value_template: >
{{ "%0.1f"|format(state_attr('sensor.pvoutput', 'energy_consumption')|float/1000) }}
friendly_name: 'Used'
unit_of_measurement: 'kWh'
power_generation:
value_template: >
{% if is_state_attr("sensor.pvoutput", "power_generation", "NaN") %}0{% else %}{{ state_attr('sensor.pvoutput', 'power_generation') }}{% endif %}
friendly_name: 'Generating'
unit_of_measurement: 'Watt'
energy_generation:
value_template: >
{% if is_state_attr("sensor.pvoutput", "energy_generation", "NaN") %}0{% else %}{{ "%0.2f"|format(state_attr('sensor.pvoutput', 'energy_generation')|float/1000) }}{% endif %}
friendly_name: 'Generated'
unit_of_measurement: 'kWh'
Could someone give me a little help please?
Franklin