Does anyone know if you have to have the InfluxDB component set up to use the InfluxDB sensor?
I have data from another source going into an external (from Home Assistant) InfluxDB and want to extract it as a sensor, but don’t really want all of Home Assistant data in my InfluxDB as well.
I get the following error in the log:
2020-05-14 09:50:41 ERROR (MainThread) [homeassistant.setup] Error during setup of component influxdb
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/setup.py", line 175, in _async_setup_component
component.setup, hass, processed_config # type: ignore
File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/usr/src/homeassistant/homeassistant/components/influxdb/__init__.py", line 123, in setup
conf = config[DOMAIN]
KeyError: 'influxdb'
With the below sensor configuration:
platform: influxdb
host: 192.168.2.205
port: 8086
username: !secret influxdb_username
password: !secret influxdb_password
queries:
- name: Energy Consumption
unit_of_measurement: kWh
measurement: '"autogen.rtlamr"'
where: '"endpoint_id" = ''12345678'''
database: rtlamr
group_function: last
field: consumption
And the query I am trying to imitate is (from Grafana):
SELECT last("consumption") FROM "autogen"."rtlamr" WHERE ("endpoint_id" = '12345678') AND $timeFilter GROUP BY time($__interval) fill(null)