Influx Integration include/exclude question

I have tried the influx DB integration and it worked but I seem to be getting pretty much all my entities fed into the DB.
How doe the include/excludes work?
For instance, if I include a domain do all the entities in that domain get fed to the DB or do I have to also include the required entities as well? which is what I would expect. However it seems that everything is included in an included domain.
See my entry in the config here…

#influxdb:
#  api_version: 2
#  ssl: false
#  host: 10.101.202.246
#  port: 8086
#  token: mytoken
#  organization: myorg
#  bucket: mybucket
#  tags:
#    source: HA
#  tags_attributes:
#    - friendly_name
#  default_measurement: units
#  exclude:
#    entities:
#      - zone.home
#    domains:
#      - persistent_notification
#      - person
#  include:
#    domains:
#      - sensor
#      - binary_sensor
#      - sun
#    entities:
#      - binary_sensor.octopus_energy_a_2359165f_intelligent_dispatching
#      - binary_sensor.octopus_energy_electricity_21l3530001_1012350035843_off_peak
#      - sensor.octopus_energy_electricity_21l3530001_1012350035843_current_rate
#      - sensor.octopus_energy_electricity_21l3530001_1012350035843_current_demand
#      - sensor.octopus_energy_electricity_21l3530001_1050002490326_export_current_rate
#      - sensor.octopus_energy_electricity_21l3530001_1050002490326_export_previous_accumulative_consumption
#      - sensor.octopus_energy_gas_e6s14501262061_2969223610_current_rate
#      - sensor.octopus_energy_gas_e6s14501262061_2969223610_current_consumptiontype or paste code here

One other question: is it possible to have 2 (or more) instances of the influx dB integration so you can write to separate buckets?

Am I correct in saying that: If I only have include entities and nothing else it will only include those entities?

Hi Clive,

How doe the include/excludes work?

InfluxDB - Home Assistant has the chapter “Configure filter” regarding your questions.

If I only have include entities and nothing else it will only include those entities?

This is example 2 in their description. So yes, if you not exclude anything but include either specific entities or domains, only those included will be exposed.

For instance, if I include a domain do all the entities in that domain get fed to the DB or do I have to also include the required entities as well? which is what I would expect. However it seems that everything is included in an included domain.

This is example 4 of their help. What you do is:

  • exclude zone.home and all persistent_notification and person domain objects
  • include all sensor, binary_sensor and sun domains AND include specific entities

I guess you only want to expose the specific binary_sensor and sensor-entities to your influxdb and maybe all sun-domain objects (example 2)? Then you would only do:

...
include:
  domains:
    - sun
  entities:
    - binary_sensor.octopus_energy_a_2359165f_intelligent_dispatching
    - binary_sensor.octopus_energy_electricity_21l3530001_1012350035843_off_peak
    - sensor.octopus_energy_electricity_21l3530001_1012350035843_current_rate
    - sensor.octopus_energy_electricity_21l3530001_1012350035843_current_demand
    - sensor.octopus_energy_electricity_21l3530001_1050002490326_export_current_rate
    - ...
1 Like

Thanks for the help. I have it working now. :+1: