ESPHome and InfluxDB

I’ve installed ESPhome on to 2 esp8266s with a DHT22 attached. I see the proper reports when I watch the 8266 logs inside of ESPHome. However, most of the data doesn’t seem to be getting to influxDB. There are no errors reported. I’m sure the network strength is good. Any recommendations?

I have the following in my configuration.yaml:

influxdb:
  host: 192.168.1.yyy
  port: 8086
  database: homeAssistant
  username: user001
  password: xxxxxxxxx
  max_retries: 3
  default_measurement: state

And the sensor configuration is:

sensor:
  - platform: dht
    pin: 04
    model: DHT22
    temperature:
      name: "Living Room Temperature"
    humidity:
      name: "Living Room Humidity"
    update_interval: 10s
[04:41:27][D][sensor:093]: 'Living Room Temperature': Sending state 19.50000 °C with 1 decimals of accuracy
[04:41:27][D][sensor:093]: 'Living Room Humidity': Sending state 72.40000 % with 0 decimals of accuracy
[04:41:37][D][dht:048]: Got Temperature=19.5°C Humidity=72.4%
[04:41:37][D][sensor:093]: 'Living Room Temperature': Sending state 19.50000 °C with 1 decimals of accuracy
[04:41:37][D][sensor:093]: 'Living Room Humidity': Sending state 72.40000 % with 0 decimals of accuracy
[04:41:47][D][dht:048]: Got Temperature=19.5°C Humidity=72.4%

Updates are only sent to InfluxDB when the value changes.

Thank you for that information. Is there a way to change that behavior? I find it disconcerting when Grafana doesn’t show data arriving.

Just set the “fill” of the influxdb to “last value” (not sure which query language you’re using) in your grafana query.

1 Like

Thank you! I’m not actually sure which language I’m using the query builder. This is what the query inspector shows:

SELECT "value" AS "${__field.entity_id::tag}" FROM "autogen"."°F" WHERE time >= now() - 6h and time <= now() GROUP BY "entity_id"::tag

Use force_update: true in your YAML code in ESPHome. With this condition, the values will be continuously sent . If the value changes, it will reflect the update. If the value remains constant, it will stay the same until it changes. This should work perfectly!

1 Like