@CentralCommand, thank you for the detailed explanation in the above thread. I want you to know it was very clear (even for someone who is “not a coder”) and is greatly appreciated by most everyone.
Hi all, might be worth asking a question here since there seem to be experience with include exclude in influx.
I have size issue with my influx as it is ever growing. I am trying to change from exclude to include but I experience troubles… it’s not working as expected and before I change “everything” I need to be sure the mechanism works. Do any of you have experience with this?
Like ‘sender’ in their unanswered post above, my database is getting very big as are the backups because of it (17Gb). Previously nothing was excluded/included and retention was infinite. I’ve now set that to 800d; I’ve been running HA for 4 years now.
I recognise that I also need to start using includes/excludes but to be honest I don’t know where to start. I must have thousands of entities now as lots of my integrations, like cameras, seem to add 50 or so at a time. Most of the stuff I don’t want retained, but things like temperatures, watts, daily costs etc i do.
Can you give or point to guidance on best approaches?
I have a similar issue with entities that I want exposed to Alexa and Google Home!
Edit:
I took the plunge and decided to use include: instead of exclude:. My influxbd entry in the configuration.yaml file now looks like this…
influxdb:
host: a0d7b954-influxdb
port: 8086
database: homeassistant
username: grafanauser
password: !secret influxpwd
max_retries: 9
default_measurement: state
include: !include influxdb_include.yaml
and the influxdb_include.yaml file looks like.
entities:
- sensor.indoor_temperature_0
- sensor.temperature_1
- sensor.nsphall_temperature_2
- sensor.hot_tub_temperature_delta
- sensor.heating_setpoint
- input_number.required_temperature
- sensor.indoor_humidity_0
- sensor.humidity_1
- sensor.boiler_burn_since_new
- sensor.burn_count_by_day
- sensor.daily_radiation_count
- sensor.daily_background_radiation_dose
- sensor.processor_use
- sensor.disk_use
- sensor.geiger_cpm
- sensor.geiger_usvph
entity_globs:
- sensor.*temperature
- sensor.*humidity
- sensor.*energy
- sensor.*energy_today
- sensor.*energy_yesterday
- sensor.*energy_total
- sensor.*power
- sensor.*power_left
- sensor.*power_right
- sensor.*litres*
- sensor.oil_tank_remaining*
- sensor.oil_kwh*
- sensor.*cost*
- sensor.*wind_speed
- sensor.boiler_runtime*
- sensor.web_scrape*
- input_number.meter_reading_electricity*
- sensor.*pressure
- sensor.speedtest*
- sensor.*kib_s*
- sensor.daily_bytes*
- sensor.*total_?x_gb
domains:
Not too many entries after all by using the * wildcard. I spent a day going through my Grafana dashboards making sure I included all the entities the graphs needed. I do wish I had a decent naming convention in place when I started on this HA journey 4 years ago.
One thing I found out is that the ‘Developer Tools/YAML/Restart/Quick Reload’ doesn’t get through to InfluxDB - a full reboot is needed!
My final issue now is that having reduced what’s included AND having set a retention of 800 days, I expect the database size to gradually drop over the next 800 days. Unfortunately I don’t think that happens and I don’t know how to force a purge. If anyone does know then please tell me.
Includes, no excludes - only include specified entities
This is not working. If I have a filter that only contains one entity to be included, the influxdb add-on stored everything.
This is my filter. In this example I only wanted to include the entity sensor.bezug. But no success.
influxdb:
username: xxxx
password: xxxx
tags:
source: HA
tags_attributes:
- friendly_name
default_measurement: state
include:
entities:
- sensor.bezug