I created a helper for it and an automation to update it based on the forecasted peak time provided by the forecast.solar integration
alias: Set PV peak time
description: >-
Update the PV peak time for today. Always update at sunrise. For updates,
check the validity of the time set.
trigger:
- platform: sun
event: sunrise
offset: 0
id: sunrise
- platform: state
entity_id:
- sensor.energy_production_today
id: update
condition:
- condition: template
value_template: "{{ states('sensor.power_highest_peak_time_today') != 'unavailable' }}"
alias: Not unavailable
action:
- if:
- condition: trigger
id: update
- condition: or
conditions:
- condition: time
after: input_datetime.pv_peak_time
alias: Do not update if peak time has passed
- condition: template
value_template: >-
{{
as_local(as_datetime(states('sensor.power_highest_peak_time_today')))
< now() }}
alias: Do not set time to the past
then:
- stop: ""
alias: Stop if update conditions are not met
- service: input_datetime.set_datetime
target:
entity_id: input_datetime.pv_peak_time
data:
datetime: >-
{{ as_local(as_datetime(states('sensor.power_highest_peak_time_today')))
}}
mode: queued
max: 10
Interesting idea.
Until now I use the peak time from SolCast integration for Node-Red flows with which I distribute the charge of the battery over the day.
However, for my sensor with the highest output of the day, I want to store the time when my PV modules delivered the highest output.
For this I now use the following definition:
This might be a bit out of the discussion, but itâs still related so will give it a try.
Iâm looking for a long term statistic of the outdoor average temperature for each day (from midnight to midnight). A sensor providing daily outside temperature as average, max and min combined would be all in.
Long description of reason: this is for tracing power usage vs. outside temperature. And since I do have power consumption for each day easily available a daily average of the outside temperature would be a great way to monitor the performance. Heating is heat pump, 3x16kW air-to-water heat pumps, and the arrangement of the outside modules is questioned for low performace (mounted too close, and short circuit of air) so any changes made could affect power consumtion, but if outside temperature differs isât nothing worth when comparing.
Hello
Using the utility meter to retain non changing records longer is neat, thanks for that.
I seem to have implemented what you suggested successfully. One qq please, the timestamp recorded with the daily reading doesnât appear to get stored in the utility helper attributes. Is there a way to add that too?
Apologies if I missed a detail along the way.
Wow ⊠I didnât expect so complicate when trying to get outdoor min temperature of the day
First I tried with a custom intergration âDaily Sensorâ but got non reliable results
I will learn these template and try to play with it
Thank you
Iâm gonna reply here. We now have the statistic sensor in the GUI. I set it on 24 hour interval for some test value, but there is no option to reset it at midnight. It looks like it resets at the time I created the sensor⊠Is there a way to fix this?