Danielhiversen / home_assistant_airthings_cloud

Airthings cloud
Apache License 2.0
32 stars 6 forks source link

Collection time is offset #4

Closed sokratz closed 3 years ago

sokratz commented 3 years ago

when data is pulled by the script it's tagged with current date/time instead of the date/time of the reading on the dashboard.
recommend bringing in latestSample utc time with the currentSensorValues

"content": { "serialNumber": "2930022690", "locationName": "Local FD", "roomName": "Basement", "segmentStart": "2020-10-04T21:39:51", "latestSample": "2020-10-14T13:44:57", "currentSensorValues": [ { "type": "radonShortTermAvg", "value": 0.19, "providedUnit": "pci", "preferredUnit": "pci", "isAlert": false, "thresholds": [ 2.7, 4 ] },

Danielhiversen commented 3 years ago

Not sure I understand.

This component does not set any timestamp, that is done by the HomeAssistant core

sokratz commented 3 years ago

I guess I wasn't thinking when I posted this. While you could correct graphs and historical events, the polling aspect of this will always be a little bit off for automation purposes which makes sense. My HA current time data vs. the Dashboard data was a few hours off because of the sync differences though, and I've seen up to 9 hours behind so far. To protect from accidental issues locally, I think I would evaluate the "latestSample" time and make sure it's current enough (subjective) to even grab it. Probably want to add this to the readme that the "Hub" or something that syncs data frequently to the AT Dashboard would be required for this to operate well within the automation ecosystem.

Danielhiversen commented 3 years ago

Hmm, understand your point. Let me see what I can do.