Influxdb not populating?

Just enabled the influxdb component but it looks like it’s not populating the database with values.

I have two sensors whitelisted for influxdb - a temperature sensor (yr platform) and a command line sensor “internet” that gives me the total traffic over 4G. None of them seem to get logged, but the sensors themselves are registered somehow:

> show measurements
name: measurements
------------------
name
MB
°C

> SHOW TAG KEYS FROM "MB"
name: MB
--------
tagKey
domain
entity_id

> SHOW TAG VALUES FROM "MB" WITH KEY = "entity_id"
name: entity_idTagValues
------------------------
entity_id
internet

> select * from sensor

The last command does not return anything.

The sensors look fine in the HA frontend:

What does your influxdb configuration look like? Did you white/blacklist anything?

Yes, I whitelisted two sensors. Leaving the configuration empty generated lots of error messages (parse errors from influxdb) and yielded the same results regarding the two sensors above (e.g they get recorded in MEASUREMENTS but there are no values recorded).

Maybe I should try blacklisting everything that caused problems instead?

Are you seeing any exceptions? I tried to enable it and noticed the same, and my hass log was filled with errors.

Yes, tons. I searched for it and it looked like it was a known issue with certain types of data not being properly parsed by influxdb, and the correct way to avoid it was to black/whitelist. This got me as far as avoiding the hass errors, but now it doesn’t log anything.

I’m at work now, but I’ll post an example when I’m back home tonight.

Yeah that’s about where I’m at, so I ended up disabling influxdb. I wanted to try out graphite but it was a hodge-podge of services that you need to setup which I didn’t want to bother with. I hope the influx problem gets fixed.

@magnushacker @cmsimike

Facing the same issue here.
How are you guys whitelisting/blacklisting sensors?

@magnushacker

Any hope of formatting the data types to match what influx expects?
Does home assistant support type casting data?

There are YAML options to whitelist/blacklist components. The docs have the specifics.

Fixed it! :smile:

First upgraded to latest versions of HA and the influxdb python library:

sudo pip3 install --upgrade homeassistant
sudo pip3 install --upgrade influxdb

After this I upgraded to influxdb 1.1 by following the instructions on http://www.andremiller.net/content/grafana-and-influxdb-quickstart-on-ubuntu (e.g adding the Influx repo to my sources.list and installing with apt-get). Note that here is a conflict with the official ubuntu package, which meant that I needed to remove the influxdb-client package first (the ubuntu packages are split in client/server, whereas the package provided by influxdata.com contains everything). When starting influxdb 1.1 for the first time it complained about a database file:

[run] 2016/11/17 23:41:13 Using configuration at: /etc/influxdb/influxdb.conf
run: create server: detected /var/lib/influxdb/meta/raft.db. To proceed, you'll need to either 1) downgrade to v0.11.x, export your metadata, upgrade to the current version again, and then import the metadata or 2) delete the file, which will effectively reset your database. For more assistance with the upgrade, see: https://docs.influxdata.com/influxdb/v0.12/administration/upgrading/

I removed raft.db since I don’t have anything else anyway. I also blacklisted all my group and scene entities as well as sun.sun in configuration.yaml and then restarted HA.

Now values are logged in influxdb and I can view them with grafana:

Still getting exceptions when HA tries to log events for group entities though, that’s why I had to blacklist them in the config.