History Graph not working for entity

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…
image

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.

Having the same issue. Did you find a solution?

Yes I did. I had the entity hidden in Customize. So I un-hid it and that fixed it. Funny thing is lovelace ignores customize for everything else.