Graph type selection

Hi everybody,

I have discovered Home Assistant a few days ago and have setup two sensors : one command-line type for the CPU temperature of my Raspberry Pi (on which HA is running) and another one being an LDR (Light detector) on my Arduino running the Firmata firmware.

Both sensors are working and showing on the UI dashboard.
When I click on the temperature sensors, I see a nice timeline graph displaying the evolution of the temperature over time.
When I click on my arduino light sensor, I only get a sort of line graph with lots of small sections (as the value is not stable at all). The graph is therefore almost unreadable and I end up with lots of colored rectangles.
I think the difference might be because the temperature is a floating point whereas the arduino light sensors only gets integer values.

Would it be possible to add a sensor attribute to specify which kind of graph is more suitable for displaying values ?

I have found a discussion about this on the old google group pages but I did not found if anything had been modified following it (!searchin/home-assistant-dev/graphs%7Csort:relevance/home-assistant-dev/3JkzouDCpoI/398koQcR9EsJ). Just in case it has been done but might not be really documented anywhere, I haven’t put my question as feature request.


I’m on the same boat as you. I have a lot of MQTT sensor who only output numbers and what i see in the history is only chronological bars…
It would be really nice an option to set the graph for history.

If MQTT knows what type of value it’s getting from a sensor it can graph it appropriately, make sure you set “unit_of_measurement” in your sensor, the history plugin will present all F or C temps in the same graph, example:

platform: mqtt
state_topic: “/Office esp/ds18b/temp”
name: “Temp: Office”
unit_of_measurement: °C

yes, i know it presents a graph for temperatura C or F. But my sensors are light values

so set a unit of measurement - lux perhaps (even if it is not correct) and see if it will change the graph style


YES !!
It works perfectly.

I’m opening this topic back up because I have the same problem with my luminescence sensor. The device is a Fibaro Multisensor and set up with device class as luminescence and unit of measurement as ‘lux’ but still it doesn’t give me a line chart:

When I change the unit of measurement it works for a while but it seems that if there are too many unique values it always reverts back to this history chart.

What could it be?

edit: nevermind! It’s already working correctly. There were probably some none-numerical values recorded right when I installed this new node. Now this has been more than 24 hrs so no longer in the graph: