PVoutput sensor configuration

I upgraded to 0.33 and indeed now i have PVoutput.
It seems there is no unit of measurement on all measured params ?

Do i need to define sensor templates to get this ?

Yes, the PVOutput sensor is designed to be used with a template sensor. Attributes can’t have units of measurement at the moment.

Thanks for adding this feature to Home Assistant, great work. Unfortunately, I have some trouble I want to share with you, for future updates hopefully.

First of all, the sensor.pvoutput is showing a significant part of the time “unknown” in stead of the number of Wh.

I had set the scan_interval to 120 sec, but it is not updating its values every 2 minutes for some reason. Most of the time it is updating two times an hour, once at the exact hour (1.00, 2.00 etc) and once at 42 minutes after the our (1.42, 2.42 etc). But sometimes it is updating more often. I have no clue why it is doing that. Moreover, it seems that the *.42 h value is always “unknown”.

As a result, it is not showing the result of the platform: template correctly. It drops every hour at 42 minutes after the hour to zero.

</> - platform: template
sensors:
energy_generation:
value_template: ‘{{ “%0.2f”|format(states.sensor.pvoutput.state|float/1000) }}’
friendly_name: ‘Generated’
unit_of_measurement: ‘kWh’</>

Any idea why this is happening. PVOutput has data at an 5 minute interval. I tried changing the scan_interval to 5 minutes as well, but no luck.

Three other requests.

  1. the standard “sensor.pvoutput” is showing the results in colours, see first picture. A graph would make more sense, like the second one.
  2. My home assistant is writing its data to an influx database. The values of the generation are written as floats, but the other values (e.g. power_generation) are strings for some reason and put in the database as double quoted values. Unfortunately, I’m not allowed to show more than one picture in this post (as I am a newby)
  3. The generation in Wh is kept at the maximum of the last day until the next morning, when it start to generate energy again. To my opinion, it would be better to start at zero at midnight, especially when writing data to influx from home-assistant.

I suspect that you are hitting the API limits. There is a limit of hits per hour.

Your API key is, my guess, blocked after 42 minutes. As data is not changing in 2 minutes (max. resolution is 5) I would suggest to adjust the query-rate to 5 minutes.

If you are using the API key for other apps as well decrease the amount of queries in those apps as well.

Last suggestion, did you donate to PVoutput? (nothing runs for free)
Rate Limits The amount of API requests per system is increased to 300 per hour (from 60).

I have logged the debug info of the sensor, and it is indeed saying that I have hit the limits. I changed it to a 5 minutes interval, but that didn’t help. I write 12 times an hour data to PVOutput, and read it 12 times an hour, so that should be small enough. I’ll have to dig deeper into this.

What I don’t get is why it isn’t updated in the first 40 minutes.

Edit: I tried several things, but I can’t find it. For now, I’m putting the measurements directly in Infux and using the influx sensor to show it in HA.

Same issues here, i only poll every 300sec, so should only be 12* per hour.
But i hit the limits (i am not using another tool)

Has anyone used a template sensor to create “Net” usage sensors based on PV Output?

how does this work. It will depend on the inverter type?

how did you get the P1 data in PVOutput in the first place? i have connected the P1 to my Pi and using the DSMR component, but would really like to import the data to PVOutput.

Hi Geert,

I am very curious how you get this card on Lovelace.
Because I am new to HA and documentation is not always giving me what I need (want) it is very difficult to figure out myself. Please can you give me a little help?

My setup in configuration.yaml is as follows:

# Configuratie pvoutput
sensor:
  - platform: pvoutput
    name: Zonnepanelen
    system_id: 28701
    api_key: *my api-key*
    scan_interval: 120
  - 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'

So I would like to know what I have to do to see somthing in lovelace UI.
Can you please give me some help?

Franklin

Hello all,

I can answer my own question. A reboot of my RPi took care of this. Before there were no sensors available as entities but after reboot they showed up.