Feed to multiple influxdb2 buckets

Hi

I have serveral enteties connected to home assistant (dockerized, latest docker-version). While I would like to store weather data long term (influxdb2 dockerize, latest docker-version), I don’t want to store the battery level of my pet flap for more than three months. So in order to do that I created several buckets in influxdb2 with different retention policies. So far so good.

Goal:
Different enteties go do different buckets.

Problem:
When I have several buckets listed in configuration.yaml, it will only feed the last one on the list… example:

# Daten in die influxdb senden
influxdb:
  api_version: 2
  host: XXX.YYY.YYY.ZZZ
  ssl: false
  port: AAAA
  precision: s
  organization: <ID>
  bucket: home_assistant
  token: <token>
  tags_attributes:
    - friendly_name
  include:
    entities:
      - sensor.1
      - sensor.2
      - sensor.3
      - sun.sun
  bucket: Cats
  include:
    entities:
      - sensor.4
      - sensor.5
      - sensor.6
  bucket: Energy
  include:
    entities:
      - sensor.7

When ever I comment out the last bucket in the list (e.g. for sensor.7), the now last one (sensor.4-6) will be written to influxdb2.

My workaround would be to fire up new container for every bucket, which seems to be an overkill. Any ideas to make this work in one home assistant instance?

Thanks in advance for your help.

The integration actually only supports 1 bucket (the last one listed, as you noticed).
What you want is basically in this feature request:

You can do this through node red’s influxdb nodes. Influxdb is temperamental, send a wrong value and it will screw up that entry. Removing a value is not easy. I’d suggest using a test db first.