Closed imsh closed 5 months ago
It might fix #53
Hello @imsh, thank you for your contribution.
I fail to see that this is working properly, still only get 10 days on temp sensors
I fail to see that this is working properly, still only get 10 days on temp sensors
Are you trying to use the statistics-graph
? The PR is not changing the max age of collected values, but rather allows to collect the aggregated values which normally cover longer periods. Fx this is my config and resulting graph:
OK, but why doesn't it work like other temperature sensors that also have long term statistics, ie displays the lts when doing normal HA graphs, like this:
Did do a graph like yours, but I have no data:
The last sensor is not a myuplink sensor, which has data. All the myuplink sensors are listed a statistics in developer tools. But only 5 days stored. Very strange!
This is how my bt1 graph looks in history view:
the data from statistics seems to be displayed fine.
Maybe HA is not updating the sensor's attribute properly if it was already created by an older version of the code which was not setting the attribute?
The config looks to be ok:
{ "aliases": [], "area_id": null, "capabilities": { "state_class": "measurement" }, "config_entry_id": "31ddf43c6be83a9c9db1544bfebd1fef", "device_class": null, "device_id": "a6e46f88be6be37114f8e1d7e8d813c6", "disabled_by": null, "entity_category": null, "entity_id": "sensor.f1255_16_cu_nibef_f1255_16_cu_room_temperature_bt50", "hidden_by": null, "icon": null, "id": "3024723c2720d9b1063f0b5c52dc1193", "has_entity_name": false, "name": "Room temperature (BT50)", "options": { "conversation": { "should_expose": true }, "sensor": { "display_precision": null } }, "original_device_class": "temperature", "original_icon": null, "original_name": "F1255-16 CU Arrie NIBEF F1255-16 CU Room temperature (BT50)", "platform": "myuplink", "supported_features": 0, "translation_key": null, "unique_id": "myuplink_emmy-r-96125-20230919-06505918065019-80-1f-12-07-1f-f4_40033", "previous_unique_id": null, "unit_of_measurement": "°C" },
I found that there a duplicates of state_attributues table with different config:
381 | 2660811100 | {"unit_of_measurement":"°C","device_class":"temperature","friendly_name":"Room temperature (BT50)"} -- | -- | -- 289325 | 500508076 | {"state_class":"measurement","unit_of_measurement":"°C","device_class":"temperature","friendly_name":"Room temperature (BT50)"}
This allows drawing nice graphs of these sensors using statistics-graph