dmxsir
September 26, 2018, 6:39pm
1
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.
dmxsir
September 26, 2018, 8:27pm
2
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
dmxsir
September 27, 2018, 1:19pm
3
Why does HA not generate the sensor?
Think you need to change name to something else. Usually spaces are not allowed in name.
dmxsir
September 30, 2018, 10:02am
5
According to the example in the sensor page, it’s ok.
Mattie
(Mattias)
August 31, 2020, 11:22am
6
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)
Mattie
(Mattias)
August 31, 2020, 2:36pm
7
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
benek984
(Benek984)
June 5, 2021, 10:41am
8
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)