How to show each "reading" for a sensor value

Sorry if my wording is incorrect.

I would like to see each what I’m calling a reading. What I mean can be seen in the image below, which is the same history graph captured with my pointer hovering over different places along the graph which, I believe, are different data points or readings of sensor values.

It doesn’t need to be in graph format. Table would be fine.

I am trying to figure out how and why there are data points at these (to me) random times.

Thank you!

Those points are recorded when the sensor has sent a new value through that is different from the previous one.

The data is all stored in the HA database, which can be accessed via SQL (not particularly user-friendly):

From my system:

troon@NAS:/volume1/docker/homeassistant/config$ sqlite3 -interactive -readonly home-assistant_v2.db
sqlite> SELECT states.state_id, states_meta.entity_id, DATETIME(last_updated_ts, 'unixepoch', 'localtime'), states.state FROM states LEFT JOIN states_meta ON (states.metadata_id=states_meta.metadata_id) WHERE states_meta.entity_id='sensor.outside_temperature' ORDER BY states.state_id DESC LIMIT 20;
37285516|sensor.outside_temperature|2024-12-17 13:12:45|8.3
37284421|sensor.outside_temperature|2024-12-17 12:48:45|8.2
37281947|sensor.outside_temperature|2024-12-17 12:30:45|8.1
37276708|sensor.outside_temperature|2024-12-17 11:28:44|8.0
37276395|sensor.outside_temperature|2024-12-17 11:22:44|7.9
37276020|sensor.outside_temperature|2024-12-17 11:14:44|7.8
37275848|sensor.outside_temperature|2024-12-17 11:10:44|7.7
37275589|sensor.outside_temperature|2024-12-17 11:04:44|7.6
37274771|sensor.outside_temperature|2024-12-17 10:48:44|7.5
37274563|sensor.outside_temperature|2024-12-17 10:44:44|7.4
37274375|sensor.outside_temperature|2024-12-17 10:40:44|7.3
37274147|sensor.outside_temperature|2024-12-17 10:36:44|7.2
37274041|sensor.outside_temperature|2024-12-17 10:34:44|7.1
37273918|sensor.outside_temperature|2024-12-17 10:32:44|7.0
37273692|sensor.outside_temperature|2024-12-17 10:28:44|6.9
37273369|sensor.outside_temperature|2024-12-17 10:22:44|6.8
37273183|sensor.outside_temperature|2024-12-17 10:18:44|6.7
37272825|sensor.outside_temperature|2024-12-17 10:10:44|6.6
37272094|sensor.outside_temperature|2024-12-17 09:54:44|6.5
37271769|sensor.outside_temperature|2024-12-17 09:48:44|6.4

That’s a table of the last 20 updates to my outside temperature sensor.

I think I understand.

So now I have to figure out why the value of the sensor is changing at those times.

Is there an easier way (card perhaps) that will pull this data from my db without the need to construct a SQL SELECT?

I’m using the mysql db.

What type of sensor is it, and do you think it should not be changing?

There’s no card as such, but there is this:

This is the configuration.yaml code that creates this sensor:

command_line:
  - sensor:
      command: "curl -k -u <user>:<password> https://ws.otodatanetwork.com/neevoapp/v1/DataService.svc/GetAllDisplayPropaneDevices --header Content-Type:application/json"
      name: "Propane Tank Neevo 371 Gallons"
      unique_id: propane_tank_371_gallons
      value_template: "{{ value_json[0].Level|float(0) * 2.4 if value_json[0].Level is defined else this.state }}"
      scan_interval: 14400
      state_class: measurement
      unit_of_measurement: "Gallons"
  # 371 Propane

I don’t understand how the sensor value could change more frequently than every 14400 seconds (4 hours). I really only need daily readings, so the only reason I have the scan interval set to every 4 hours is just in case setting it to every 24 hours results in a single failure to read and then missing a day.

It looks like the sensor value is determined to have “changed” upon reloading of YAML or restarting of HA also.

Yes, that’s expected behaviour. The scan_interval restarts in that situation. None of your timestamps from the graph above are closer than 14,400s apart: shortest interval is 15,149s.

How often are you restarting / reloading? What happens if you don’t do that?

I changed the interval to 28800, restarted, and will leave it alone for a couple of days.

Thank you.

I thought I would explore the SQL integration as a possible to way to explore the mysql db that I’m using for HA. Didn’t get very far.

Then I thought: Shouldn’t there be a log, or a way to enable logging, for when any particular sensor is updated or has a change of value.

I see that the DEVELOPER | STATE values show LAST UPDATED and LAST CHANGED.

There should be a way to record this, to keep track of all the occurences for a sensor of UPDATED and CHANGED and the associated values (for later display).