GladysAssistant / Gladys

A privacy-first, open-source home assistant
https://gladysassistant.com
Apache License 2.0
2.69k stars 285 forks source link

Add a sensor chart box for the dashboard #693

Closed Pierre-Gilles closed 3 years ago

Pierre-Gilles commented 4 years ago

Description

Be able to display a chart on the dashboard. Ex: temperature of last month

Specs

Pierre-Gilles commented 3 years ago

Ok, and where do you store them at the end?

euguuu commented 3 years ago

I store state after downsamling in new table t_device_feature_state_light

Pierre-Gilles commented 3 years ago

Ok! And how often do you build this "cached" version ?

euguuu commented 3 years ago

every day

Pierre-Gilles commented 3 years ago

what happens when it's the first day?

euguuu commented 3 years ago

i add a column last_downsampling on feature object

the first time of job execution the donwsampling start on all data in feature_state and the second time just on last day of last_downsampling (=last created_at of feature_state treat) in feature, so if some feature state arrive in late (for example if data come from third party platform and this platform is down for a couple of days) the downsampling treat all data from last_downsampling date (so maybe more than 1 day)

Pierre-Gilles commented 3 years ago

FYI: https://community.gladysassistant.com/t/affichage-des-courbes-de-capteurs-sur-le-dashboard/6535