[Solved] No history graph for sensor

Hi,

I’m trying to add a temperature graph to lovelace from a sensor. According to [1] it should happen automatically when “unit_of_measurement” is defined for the sensor. But when I add the history graph card I end up with “Recent Switches” view from [1].

Here are the attributes for “sensor.fibaro_system_fgdw002_door_opening_sensor_2_temperature”:

node_id: 17
value_index: 1
value_instance: 1
value_id: 72057594328137746
unit_of_measurement: °C
friendly_name: Temperatur loft

The temperature reading seem correct. What am I doing wrong?

[1] https://www.home-assistant.io/lovelace/history-graph/

When you view the History page, and scroll to the bottom where all graphed entities are displayed, do you see the fibaro temperature sensor as a graph?

For example:

Screenshot from 2020-10-14 18-15-17

Or is it displayed elsewhere in the History view as a horizontal bar chart?

It is shown as a graph. The same way I would like the Lovelace card to look like.

All of a sudden the graph is now shown correctly! I haven’t done anything… The only reason I can come up with, is that the sensor now has been active for more than 24 hours which is the interval i use for the graph.

Did this temperature sensor always have:

unit_of_measurement: °C

or was it added/modified recently?

“unit_of_measurement” has always been part of the sensor.

It’s based on the database and your current browser cache. This is normal when you add unit_of_measurement to an existing item. Next time, delete your database and it will instantly update. Or wait like you did.

But I did NOT add “unit_of_measurement” to an existing sensor. I added a new sensor to the system.