Ello, I am kind of stuck right now… So my main goal is to get daily statistics for power yield from my SMA Inverters. The integration itself does not seem to want to save the daily yield as a statistic, and while I wait for a reply on the issue I opened, i thought I would try to make a custom sensor to keep the statistics myself. I yoinked some stuff from other forum posts together and got to this template:
template:
- trigger:
- platform: time
at: '00:00:10'
- platform: state
entity_id: sensor.sn_12345_daily_yield
sensor:
- name: 'SMA-1-2 Daily Custom'
unique_id: 'sma-1-2_daily_custom'
unit_of_measurement: 'Wh'
device_class: energy
state_class: total_increasing
state: >
{% set t_new = states('sensor.sn_93726_daily_yield') | float(-50) %}
{{ [t_new, this.state | float(-50)] | max if trigger.platform != 'time' else t_new }}
However when I try to get the max value per day to display in a statistics card, I can only select “Change”, even though I need max… And I cant seem to put it into words well enough to find the issue on google… Can somebody explain, what I need to do to pick something other than “Change”?