Configure influxDB sensor

hey, i needs some help to configure influxDB sensor components .
here is the query :

SELECT last("state") AS "last_state" FROM "homeassistant"."autogen"."state" WHERE time > now() - 5m AND "domain"='sensor' AND "entity_id"='external_ip' GROUP BY time(:interval:) FILL(null) 

this the configuration in sensor.ymal i did :

- platform: influxdb
  queries:
    - name: ip external db
      value_template: '{{ value }}'
      group_function: last
      where: '"domain" = ''sensor'''
      measurement: '"homeassistant"."autogen"'
      field: state
      database: homeassistant

but noting is show up in my sensors, in the frontend.

here i my final config,
no error in HA.log , But still , no sesor in the Front end. ):

- platform: influxdb
  queries:
    - name: db external ip
      value_template: '{{ value | round(1) }}'
      group_function: last
      where: '"domain" = ''sensor'' and "entity_id" = ''external_ip'' time > now() - 1h'
      measurement: '"homeassistant"."autogen"'
      field: value
      database: homeassistant

Why does HA not generate the sensor?

Think you need to change name to something else. Usually spaces are not allowed in name.

According to the example in the sensor page, it’s ok.

I’m having the exact same problem, no errors in log but no sensor shows up!

sensor:
 - platform: influxdb
   host: 192.168.1.75
   scan_interval: 10
   queries:
     - name: Totalkwh_idag
       unit_of_measurement: kWh
       where: '"name" = ''Totalt'''
       measurement: '"kWh"'
       database: homeassistant
       field: '"value"'
       group_function: last

My influx looks like this:
SELECT difference(last(“value”)) FROM “kWh” WHERE (“entity_id” = ‘totalkwh’) AND $timeFilter GROUP BY time(1d) fill(null)

got a bit further, the only problem now is the time selector, I want to define “today”

  • platform: influxdb
    host: 192.168.1.75
    scan_interval: 10
    queries:
    • name: totalkwhidag
      unit_of_measurement: kWh
      where: ‘“domain” = ‘‘sensor’’ and “entity_id” = ‘‘totalkwh’’ time = today()’
      measurement: ‘“kWh”’
      field: ‘“value”’
      group_function: last
      database: homeassistant

Hi,

I can see the sensor but no value. Can you guys check what am I missing ?



  - platform: influxdb
    host: 192.168.10.22
    username: ha
    password: ha
    port: 8086
    queries:
      - name: PV Production
        unit_of_measurement: kW/h
        where: '"host" = ''0'''
        measurement: Watts
        field: "84177508"
        group_function: last
        database: ha
SELECT mean("84177508") FROM "Watts" WHERE ("host" = '0') AND $timeFilter GROUP BY time(1m) fill(none)