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.
Daily maximum PV values
-
- Posts: 1744
- Joined: Thu Oct 13, 2022 7:21 pm
This should hopefully do what you want, it will gradually increase throughout the day and display the maximum pv power recorded, resetting at midnight.
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.
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.