not good to hear, that I’m not the only one with the problem. Yes the long term are in the DB, they should be in statistics, whereas short term are somewhere else.
this is my maridb
But for the history graph of an entity, you need the events data in the db, because when I removed all events from being logged to the recorder also my history was empty but not the the statistics. I had to limit the size of the DB, so I removed most of the events. just do not remove state_changed, which is uncommented in the config below.
recorder:
purge_keep_days: 1
commit_interval: 10
db_url: !secret mysql
exclude:
entities:
- sensor.time
event_types:
- component_loaded
- core_config_updated
- device_registry_updated
- entity_registry_updated
- hacs/config
- hacs/repository
- hacs/stage
- hacs/status
- homeassistant_close
- homeassistant_final_write
- homeassistant_start
- homeassistant_started
- homeassistant_stop
- ios.action_fired
- knx_event
- lovelace_updated
- nodered
- panels_updated
- persistent_notifications_updated
- service_registered
- service_removed
- tag_scanned
- themes_updated
- user_removed
- timer_out_of_sync
- ios.became_active
- hacs/reload
- call_service
- zha_event
#- state_changed
I have also an Influx DB now, which is consolidating all data to 5min average and then after 2 years to 15min to be safe. Influxdb (1.8) setup - ONE continuous query for WHOLE database - #3 by ha_frw
The Maria DB looks much better than the file based. I can only recommend to switch to mariadb and use influx for longterm in addition. I’m running a yearly overall stats graph of temperature to engergy consumed and heating power required, which I’m also unable to build with long term stats.