Customize component and Influxdb

Hi all,

I’ve recently set up Tasmota based IR Readers (Hichi) for our energy meters via MQTT.
In general, it works fine, however using MQTT they do not expose a unit for the values, this seems to be a resource saving feature of Tasmota.
I worked around this by creating these entries using the customizing integration:

sensor.stromzahler_eg_haus_power:
  unit_of_measurement: 'W'
sensor.stromzahler_eg_haus_energy:
  unit_of_measurement: 'kWh'
sensor.stromzahler_eg_haus_en_out:
  unit_of_measurement: 'kWh'
sensor.stromzahler_og_haus_power:
  unit_of_measurement: 'W'
sensor.stromzahler_og_haus_energy:
  unit_of_measurement: 'kWh'
sensor.stromzahler_og_haus_en_out:
  unit_of_measurement: 'kWh'

However this seems to break the Influxdb recording. Without the unit, I was reading their data from the standard “state” measurement (as defined in my influxdb config in Homeassistant). Once activating the customization, I can neither see new values in the “state” measurement, nor in the overwritten measurement for them.
Is this a bug or am I doing something wrong?

For reference, here is my influxb config:

influxdb:
    api_version: 2
    ssl: false
    host: influxdb
    port: 8086
    token: !secret influxdb_token
    organization: !secret influxdb_org
    bucket: homeassistant
    tags:
      source: HA
    tags_attributes:
      - friendly_name
    default_measurement: state
    exclude:
      entities:
        - zone.home
      domains:
        - persistent_notification
        - person
    include:
      domains:
        - sensor
        - binary_sensor
        - sun
      entities:
        - weather.home

Thanks,
Robin

It’s not a bug. It’s just the way InfluxDB works. The database is sorted by unit. Your entities previously had no unit and now they do. So there will be a new entity under W or kWh instead of state.

That’s how I understand it would work yes, however they’re not showing up under the new unit. There is nothing being reported once I switch the customizing on. I can even filter down to just the entity name and from the point I turn the customizing on, there are no new values coming in.

Edit: Never mind, no idea whatever was going on yesterday, however today it works and Homeassistant is publishing the data into the correct measurement unit in Influxdb…

1 Like

Did the states change yesterday?

Nothing will be pushed to Influx until the state of the entity changes.

Also you need to restart for customize to take immediate effect. Reloading customisation changes only affects the change once the entity changes state.

Yeah, never mind - I edited the next day, it suddently started working. Thanks for the help!