Test repo for SQLite and Home Assistant
-
Upload test database from:
-
Create a Python program to read database
-
Get latest temperature from Home Assistant SQLite DB
-
We need to find a way to ignore following states:-unavailable
-unknown
-
Get the data from statistics table to get the mean value
-
Append the values to a list
-
Calculate the average temperature for the last
n = 7 x 24
measurements -
Write new data to
- The database
- A sensor in Home Assistant
-
Get snapshot of HA database
-
We get this data from the database
statistics_meta
table- metadata_id: 71 for Outside temperature
-
Based on that, we can find the temperature values from
statistics
table- metadata_id: 71
- mean: mean_temperature, FLOAT