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 (https://groups.google.com/forum/#!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.

Regards

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:

sensor:
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

3 Likes

YES !!
It works perfectly.
Thanks

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: