Ok, so I wanted to put some effort in my ever growing influxdb which is now around 40Gb in size :-).
But like any other “tasks” in HA it’s not so simple.
I read about influxdb and I use the addon. I Assume I have v1 (not 2).
I have and exclude list now in recorder and in influxbd, mostly the same.
I tried to search how to cleanup influx, not found any helpful sources.
Then I tried to find out how to get “wanted” entities in influx:
only certain integrations (cannot find how to do this).
All these tasks… I end up in dead ends…
Thus I wanted to ask, just as a starter, can anyone who has an “include” list for influx please share it below?
Additionally - is it a good moment to start influxdb v2 ? Can 1 and 2 run in parallel?
This is my current config and added “include” config.
I am struggling to understand the rules of InfluxDB - Home Assistant
I expect that:
the include will be included, then nothing else will be included.
the exclude will all be extra excluded on top of the nothing else will be included.
I meanwhile stopped forwarding data to influx( I never really had a good case for analysing older data), thus my configuration might no longer work. also never had Influx2 running
I created template sensors for all entities I wanted to have in influx, all template sensors had a time based attribute to force updates every 5 minutes and all template sensors had a “_db” at the end of the entity name ( and a few where HA added the “_2” suffix…
Additionally, because I didn’t like that by default the measurement in influx was created by the unit of the entity ( measurements like “°C” or “%”), I overwrote the measurements in the influx configuration:
I am sorry. I asked for maybe a reason I would need it as well.
I started another home assistant to “test”…
This is so true! Even if I specify specific entities (two) though everything is written in the DB…
According to the documentation this should not happen but it does…
With that in mind it’s not even feasible to start changing the config in my production setup…
I do not understand these filters.
Why is everything included by default?
I only want to track a couple of dedicated entities and nothing else but I am not able to configure this. The influxdb is always tracking tons of useless information and start growing very fast.
It would be great if some one could provide a example that allows to pick only a few entities and remove the rest.
I was searching something else and found this post. It’s a matter of fact that HA writes the sensor data every 30? seconds independent if value changed or not. This blows up the database, not limited to influxdb, same for logger-db.
A question if somebody has an idea how to delete sequent updates whithout value update what are more or less duplicates.
How could be functional “<<<< duplicate” removed from database or even prevent to be written? When temp wasn’t changed there is no benefit to write or keep such entries.
No it is not a fact at all. The data is only written when the state changes. This actually annoys a lot of people. See: InfluxDB to store data in intervals
Is that Influxdb or the recorder database?
If it is the recorder, maybe it is because one of the entity’s attributes changes every 30 seconds.
Ok, when data is only stored when it’s unique it’s the behaviour I would appriciate. Probably there are some special situations where this is not the case. I think it’s what you meant in your last sentence … if one of the attributes changed … e. g. climate has many attributes so it’s likely that there was any change. Out of the discussion I assume I can create / use sensors with single state and then there should be no duplicates.
Data posted was simplified to show the relevant part. I extracted a measurement from my Influxdb and there are duplicates (same values in a sequence) still. See below.
hey @tom_l
May I ask you as expert a question
I would like to work with INCLUDE as only option
anything that is not defined in Include should not be persisted in influx
in this include I would need to define something with a wildcard or integration level
like
include:
entities:
- anything from Integration XYZ (has unfortunetly no good name pattern in it I could use)
- any sensor value that has "kwh" in its name somewhere - could define it *kwh* or is wildcard only as ending allowed?
thjose 2 examples are a little painful to me to understand and I would appreciate some hints.
Thank you!
EDIT:
I went through all my entities and this would be the list I want to INCLUDE and nothing else
espicially the * wildcards I used below would be interesting if this is a correct syntax?
ok if anybody is looking for more examples.
I use this now and when I check in Grafana some example entities it looks like its working and the pattern with * are accepted this way
include: # Beginne die Liste der zu speichernden Entities
entities: # Liste der spezifischen Entities ohne Wildcards
- 'vacuum.greta' # Der Staubsauger mit dem Namen 'greta'
- 'vacuum.roborock_s7' # Der Staubsauger Roborock S7
- 'vacuum.gustav' # Der Staubsauger mit dem Namen 'gustav'
entity_globs: # Liste der Entities, die mit Wildcards erfasst werden
- 'sensor.local_ecowitt*' # Alle Entities, die mit 'sensor.local_ecowitt' beginnen
- 'climate.*' # Alle Klimageräte (z.B. Thermostate)
- 'sensor.energy*' # Alle Energiesensoren (z.B. Verbrauch)
- 'sensor.*_battery' # Alle Batteriestatus-Entities
- 'sensor.*_battery_level' # Alle Batterielevel-Entities
- 'sensor.*_illuminance' # Alle Helligkeitssensoren
- 'sensor.*_temperature' # Alle Temperatursensoren
- 'sensor.*_humidity' # Alle Feuchtigkeitssensoren
- 'sensor.*_smoke' # Alle Rauchsensoren
- 'sensor.*_smoke_concentration' # Alle Rauchkonzentrationssensoren
- 'sensor.*_energy' # Alle Energiemessungen
- 'sensor.*_power' # Alle Leistungsmessungen
- 'sensor.*_current' # Alle Strommessungen
- 'sensor.*_kwh' # Alle kWh-Messungen
- 'sensor.*_w' # Alle Watt-Messungen
- 'sensor.qemu*' # Alle QEMU-bezogenen Sensoren
- 'sensor.*proxmox*' # Alle Proxmox-bezogenen Sensoren
- 'sensor.wpl17*' # Alle WPL17-bezogenen Sensoren
- 'sensor.custom*' # Alle benutzerdefinierten Sensoren