Page 1 of 1

Daily maximum PV values

Posted: Fri Feb 07, 2025 12:30 pm
by reef
I have two arrays, so currently get live data from those direct from my H1-5.0-E (sensor.pv_power_h1_5_0_e) and the second (sensor.h1_5_0_e_ct2_meter) as well as a custom sensor (sensor.total_pv_power) which is just both added together.

I'd like to be able to see the maximum for each of those three sensors for that day, with it resetting at midnight ready for the next day. At the moment I can just hover at the top of the history graphs to get the maximum value, but 2025.2 has changed the graphing and this is quite difficult now.

Any idea how I could do this?

Many thanks.

Re: Daily maximum PV values

Posted: Sat Feb 08, 2025 10:30 am
by Dave Foster
This should hopefully do what you want, it will gradually increase throughout the day and display the maximum pv power recorded, resetting at midnight.

Code: Select all

  - trigger:
      - platform: time
        at: '00:00:00'
      - platform: state
        entity_id: sensor.pv1_power
    sensor:
      - name: 'PV1 Max Power Today'
        unit_of_measurement: kW
        device_class: power
        state_class: measurement
        state: >
          {% set pv1_new = states('sensor.pv1_power')|float(-1) %}
          {{ [pv1_new, this.state | float(-1)] | max if trigger.platform != 'time' else 0 }}

Add that to your template sensors in configuration.yaml, duplicate it for PV2, and for PV daily power you just need a template sum of the 2 max power today sensors.

Re: Daily maximum PV values

Posted: Sat Feb 08, 2025 4:34 pm
by reef
Thanks Dave.

Rather annoyingly it's dull and generation has stopped, so I can't see if it's working yet. Fingers crossed! :D

Re: Daily maximum PV values

Posted: Sun Feb 09, 2025 2:31 pm
by reef
Maxpower.png

Thanks again Dave, that works perfectly. :)