This is driving me crazy.
I have defined a sensor like this:
sensor:
- platform: template
sensors:
daylengthchange:
friendly_name: 'Change in Day Length'
unit_of_measurement: "sec"
value_template: >
{{ (states.sun.sun.attributes.daylight) - (states.sun.sun.attributes.prev_daylight) }}
icon_template: mdi:weather-sunny
and it is working…
But there is no state history and I can’t do a graph of it.
I can’t for the life of me see what the problem is.