Home Assistant Community Add-on: InfluxDB

Hello,

This is my first post here and I am just beginner when it comes to the Hassio.
I was trying for few days to setup Hassio+Influxdb+Grafana.
The hardest thing was to configure and start Hassio+Influxdb. I was doing everything and according to the documentation but no success. I was also trying unofficial tips but the same result - everything was configured without errors but no data in Influxdb.
Then I installed Grafana and connected it to database created in Influxdb. And surprise - I have data to query and visualize in Influxdb’s dashboards. I started again to changing all configs and finally I managed to get Influxdb also working.

Long story short.
This is my configuration.yaml:

"
influxdb:
_host: localhost
_database: home_assistant
_username: homeassistant
_password: test
_max_retries: 3
_default_measurement: state
_include:
__entities:
___- sensor.coreos_cpu_used
___- sensor.coreos_cpu_temp
___- sensor.coreos_ram_free
___- sensor.coreos_cpu_load
___- sensor.coreos_disk_free
___- sensor.coreos_disk_used
___- sensor.coreos_disk_used_percent
___- sensor.coreos_ram_free
___- sensor.coreos_ram_used
___- sensor.coreos_ram_used_percent
___- sensor.coreos_swap_free
___- sensor.coreos_swap_used
___- sensor.coreos_swap_used_percent
___- sensor.coreos_thread
___- sensor.coreos_total
"

This is my Influxdb configuration:
"
{
“auth”: true,
“reporting”: false,
“ssl”: false,
“certfile”: “fullchain.pem”,
“keyfile”: “privkey.pem”,
“username”: “homeassistant”,
“password”: “test”,
“log_level”: “info”
}
"
Other things are configured inline with Hassio documentation:

  • database in Influxdb created: home_assistant
  • user in Influxdb created with ALL permission: homeassistant.

I also attached one screen as a proof :-).

I hope this will help someone.

Regards.

1 Like

Hello, Everybody., I try to get data from influxDB by python , using API communication.

But I still get
{
“error”: “authorization failed”
}

Could u help me ?

Python%20code

:tada: Release v3.4.0

Full Changelog

This is a general maintenance release, and add support for allowing tuning of InfluxDB by passing in configuration environment variables via the add-on configuration.

:hammer: Changes

  • :arrow_up: Upgrades Chronograf to 1.7.15
  • :books: Fixes typo (#54)
  • :hammer: Add environment variable support for InfluxDB (#52)
  • :arrow_up: Upgrades add-on base image to v4.0.1
  • :arrow_up: Upgrades InfluxDB to v1.7.9

Questions? Join our Discord server! https://discord.me/hassioaddons
Enjoying my add-ons? Consider supporting my work: https://patreon.com/frenck

Starting NGINX…

Same here, InfluxDB won’t start after upgrade

Starting NGINX is actually the final message.
It should be done starting, so something else is going on.

Is it possible to query a specific point in time from InfluxDB? Lets say at 10.58 am.

My best attempt at this doesn’t work:

 where: '"entity_id" = ''fibaro_system_fgwpe_f_wall_plug_gen5_energy'' and time = 10:58:00'

However this does work:

where: '"entity_id" = ''fibaro_system_fgwpe_f_wall_plug_gen5_energy'' and time > now() - 12h'

:tada: Release v3.4.1

Full Changelog

This is a bugfix release, addressing an issue with the new environment setting options, introduced in v3.4.0.

:hammer: Changes

  • :ambulance: Fix typo in regex (#56)

Questions? Join our Discord server! https://discord.me/hassioaddons
Enjoying my add-ons? Consider supporting my work: https://patreon.com/frenck

I have a similar topic, I want to have the value 3h ago. The problem is, that there is no value with exactly that time-stamp. That’s why I use the last value of the time range before:

SELECT last("state_float") FROM "homeassistant_permanent"."autogen"."sensor.temp_esszimmer_taster" WHERE time > now() - 24h AND time < now() - 3h

You could also do a second query for the next value (with FIRST() on the next time range) and interpolate between these two…
Not exactly what you searched for, but maybe it helps

Hello everyone!
Hass.io ( 0.102.3 ), Grafana 3.0.2, InfluxDB (3.4.1) on one Rasp.

I dont have any problem for put data from HA to InfluxDB (created new DB homeassistant, and user homeassistant / test)
But I cannont connect from grafana to InfluxDB :frowning:

If I try use http://localhost:8086 for connection (DB homeassistant, and user homeassistant / test) from Grafana, I see “http: proxy error: dial tcp 127.0.0.1:8086: connect: connection refused”

If use http://a0d7b954_influxdb:8086 for connection - “http: proxy error: dial tcp: lookup a0d7b954_influxdb on 127.0.0.11:53: no such host:”

Any idea what is wrong?

Config for InfluxDB
{
“auth”: true,
“reporting”: true,
“ssl”: false,
“certfile”: “fullchain.pem”,
“keyfile”: “privkey.pem”,
“envvars”: []
}

Thank you!

Hi all,

I got InfluxDB warnings in my log every minute.

A few days ago I installed the InfluxDB add-on and created a database. Later I removed the Influx add-on, but it looks like there’s something left behind. Any ideas how to solve this?

Database host is not accessible due to 'HTTPConnectionPool(host='localhost', port=8086): Max retries exceeded with url: /write?db=home_assistant (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f72396dfe50>: Failed to establish a new connection: [Errno 111] Connection refused'))', please check your entries in the configuration file (host, port, etc.) and verify that the database exists and is READ/WRITE. Retrying again in 60 seconds.

Hello,
Maybe it will support for you - in my case I recive the same error when I connecting from Grafana to DB(on one the same Raspbery and IP) using “127.0.0.1” or “localhost”, but if use Raspbery local IP address this is working!

1 Like

Thanks for your reply. After reinstalling both Influxdb and Grafana and doing some configurations and restarts I realized I forgot to remove influxdb: in my configuration.yaml :shushing_face:

:tada: Release v3.5.0

Full Changelog

This is a general maintenance release.

:hammer: Changes

  • :arrow_up: Upgrades add-on base image to v4.0.2
  • :arrow_up: Upgrades Chronograf to 1.7.16
  • :fireworks: Updates maintenance/license year to 2020
  • :books: Adjust add-on installation instructions
  • :pencil2: Funding adjustments
  • :pencil2: Fixes some spelling and grammar
  • :arrow_up: Upgrades add-on base image to v4.0.3
  • :arrow_up: Upgrades lua-resty-http to 0.15-0
  • :pencil2: Fixes some spelling and grammar

Questions? Join our Discord server! https://discord.me/hassioaddons
Enjoying my add-ons? Consider supporting my work:
https://github.com/sponsors/frenck or https://patreon.com/frenck

:tada: Release v3.5.1

Full Changelog

This is a general maintenance release.

:hammer: Changes

  • :arrow_up: Upgrades Chronograf to 1.7.17

Questions? Join our Discord server! https://discord.me/hassioaddons
Enjoying my add-ons? Consider supporting my work:
https://github.com/sponsors/frenck or https://patreon.com/frenck

Hello @frenck and team,

I’m getting below error:

2020-01-16 21:13:53 WARNING (SyncWorker_15) [homeassistant.components.influxdb] Database host is not accessible due to 'HTTPSConnectionPool(host='a0d7b954-influxdb', port=8086): Max retries exceeded with url: /write?db=homeassistant (Caused by SSLError(SSLError("bad handshake: Error([('SSL routines', 'ssl3_get_record', 'wrong version number')])")))', please check your entries in the configuration file (host, port, etc.) and verify that the database exists and is READ/WRITE. Retrying again in 60 seconds.
2020-01-16 21:14:54 WARNING (SyncWorker_14) [homeassistant.components.influxdb] Database host is not accessible due to 'HTTPSConnectionPool(host='a0d7b954-influxdb', port=8086): Max retries exceeded with url: /write?db=homeassistant (Caused by SSLError(SSLError("bad handshake: Error([('SSL routines', 'ssl3_get_record', 'wrong version number')])")))', please check your entries in the configuration file (host, port, etc.) and verify that the database exists and is READ/WRITE. Retrying again in 60 seconds.
2020-01-16 21:15:55 WARNING (SyncWorker_15) [homeassistant.components.influxdb] Database host is not accessible due to 'HTTPSConnectionPool(host='a0d7b954-influxdb', port=8086): Max retries exceeded with url: /write?db=homeassistant (Caused by SSLError(SSLError("bad handshake: Error([('SSL routines', 'ssl3_get_record', 'wrong version number')])")))', please check your entries in the configuration file (host, port, etc.) and verify that the database exists and is READ/WRITE. Retrying again in 60 seconds.

Config as follows:
image
image

Any ideas?

Thanks

1 Like

Set ssl to false in your config.
Or if you really want to do ssl, ensure to have valid certicates configured.

You don’t need SSL in your HA config, as the a0..-influxdb host is an internal connection that doesn’t use SSL.

Thank u sir. Really appreciated. It worked

I would be great to be able to get collectd data into this Influxdb instance to be displayed in your Grafana plugin.

I’ve replied on the GitHub issues: https://github.com/hassio-addons/addon-influxdb/issues/1

No way to access the config file of Influxdb of this addon?

Even if you could (which you can using Docker), it would not persist… that’s how Docker containers work. So it would be better to get in it in. Please join me on GitHub. I’ve already build the feature, testing is the issue… (I think).

@frenck Hi! Almost two years later :slight_smile:

I’m also interested in getting collectd working with InfluxDB. I’d like to be able to get the statistics of my OpenWRT router into Influx, and then Grafana OpenWRT Traffic Monitor with collectd and InfluxDB | Jake’s Blog.

I see the issue Collectd in influxdb ¡ Issue #1 ¡ hassio-addons/addon-influxdb ¡ GitHub is closed, but you mentioned that you had this working on your development branch. Do you maybe have the code for this?

1 Like

Hi,

First thank you for this fantastic work!
I am using InfluxDB for weeks without any problem.
This morning it does not start correctly anymore.
Last update I have done was a week ago.
It looks like a normal start but after 1 min I have strange log.
When trying to connect to it I have a error 502 Bad Gateway

First log when I start the addon manually (as it is crashing even if autostart)

[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] 00-banner.sh: executing... 
-----------------------------------------------------------
 Hass.io Add-on: InfluxDB
 Scalable datastore for metrics, events, and real-time analytics
-----------------------------------------------------------
 Add-on version: 3.5.1
 You are running the latest version of this add-on.
 System: HassOS 3.8  (armv7 / raspberrypi3)
 Home Assistant version: 0.104.3
 Supervisor version: 195
-----------------------------------------------------------
 Please, share the above information when looking for help
 or support in, e.g., GitHub, forums or the Discord chat.
-----------------------------------------------------------
[cont-init.d] 00-banner.sh: exited 0.
[cont-init.d] 01-log-level.sh: executing... 
Log level is set to WARNING
[cont-init.d] 01-log-level.sh: exited 0.
[cont-init.d] create-users.sh: executing... 
[cont-init.d] create-users.sh: exited 0.
[cont-init.d] influxdb.sh: executing... 
[cont-init.d] influxdb.sh: exited 0.
[cont-init.d] kapacitor.sh: executing... 
[cont-init.d] kapacitor.sh: exited 0.
[cont-init.d] nginx.sh: executing... 
[cont-init.d] nginx.sh: exited 0.
[cont-init.d] done.
[services.d] starting services
[services.d] done.

After 1 minunute I see this

os.(*File).write(...)
	/usr/local/go/src/os/file_unix.go:280
os.(*File).Write(0x1914a9a8, 0x21900000, 0x100000, 0x100000, 0x0, 0x3b9ad42f, 0x15808)
	/usr/local/go/src/os/file.go:145 +0x5c
github.com/influxdata/influxdb/pkg/limiter.(*Writer).Write(0x2d6e520, 0x21900000, 0x100000, 0x100000, 0x1ae2c000, 0x22984300, 0x8)
	/go/src/github.com/influxdata/influxdb/pkg/limiter/writer.go:64 +0xd4
bufio.(*Writer).Flush(0x2d6e5e0, 0x22982000, 0x22d5)
	/usr/local/go/src/bufio/bufio.go:590 +0x64
bufio.(*Writer).Write(0x2d6e5e0, 0x22982000, 0x2308, 0x2310, 0x4, 0x0, 0x0)
	/usr/local/go/src/bufio/bufio.go:626 +0xf8
github.com/influxdata/influxdb/tsdb/engine/tsm1.(*tsmWriter).WriteBlock(0x14afbe90, 0x1a8fe080, 0x3e, 0x40, 0x7e970b00, 0x15ed9552, 0xcd08c700, 0x15edb65f, 0x22982000, 0x2308, ...)
	/go/src/github.com/influxdata/influxdb/tsdb/engine/tsm1/writer.go:679 +0x138
github.com/influxdata/influxdb/tsdb/engine/tsm1.(*Compactor).write(0x319cba0, 0x3b01bd0, 0x49, 0x1abaf08, 0xa063fc0, 0xe95c01, 0x0, 0x0)
	/go/src/github.com/influxdata/influxdb/tsdb/engine/tsm1/compact.go:1149 +0x214
github.com/influxdata/influxdb/tsdb/engine/tsm1.(*Compactor).writeNewFiles(0x319cba0, 0x3, 0x1, 0x0, 0x0, 0x0, 0x1abaf08, 0xa063fc0, 0x4f92601, 0x0, ...)
	/go/src/github.com/influxdata/influxdb/tsdb/engine/tsm1/compact.go:1032 +0x144
github.com/influxdata/influxdb/tsdb/engine/tsm1.(*Compactor).WriteSnapshot.func1(0xf8eec80, 0x319cba0, 0x4e15498, 0x1f4f9880, 0x35d4680)
	/go/src/github.com/influxdata/influxdb/tsdb/engine/tsm1/compact.go:847 +0x94
created by github.com/influxdata/influxdb/tsdb/engine/tsm1.(*Compactor).WriteSnapshot
	/go/src/github.com/influxdata/influxdb/tsdb/engine/tsm1/compact.go:845 +0x16c
goroutine 667 [IO wait]:
internal/poll.runtime_pollWait(0x66c6fda4, 0x72, 0xffffffff)
	/usr/local/go/src/runtime/netpoll.go:182 +0x48
internal/poll.(*pollDesc).wait(0x154c2514, 0x72, 0x0, 0x1, 0xffffffff)
	/usr/local/go/src/internal/poll/fd_poll_runtime.go:87 +0x80
internal/poll.(*pollDesc).waitRead(...)
	/usr/local/go/src/internal/poll/fd_poll_runtime.go:92
internal/poll.(*FD).Read(0x154c2500, 0xd3adead, 0x1, 0x1, 0x0, 0x0, 0x0)
	/usr/local/go/src/internal/poll/fd_unix.go:169 +0x184
net.(*netFD).Read(0x154c2500, 0xd3adead, 0x1, 0x1, 0x4ad4060, 0x503718, 0x7)
	/usr/local/go/src/net/fd_unix.go:202 +0x38
net.(*conn).Read(0x1914a690, 0xd3adead, 0x1, 0x1, 0x0, 0x0, 0x0)
	/usr/local/go/src/net/net.go:177 +0x5c
net/http.(*connReader).backgroundRead(0xd3adea0)
	/usr/local/go/src/net/http/server.go:677 +0x44
created by net/http.(*connReader).startBackgroundRead
	/usr/local/go/src/net/http/server.go:673 +0xb0
goroutine 693 [runnable]:
syscall.Syscall(0x76, 0x4d, 0x0, 0x0, 0x0, 0x0, 0x0)
	/usr/local/go/src/syscall/asm_linux_arm.s:14 +0x8
syscall.Fsync(0x4d, 0x18e6860, 0x40da440)
	/usr/local/go/src/syscall/zsyscall_linux_arm.go:449 +0x30
internal/poll.(*FD).Fsync(0x40da440, 0x0, 0x0)
	/usr/local/go/src/internal/poll/fd_fsync_posix.go:17 +0x84
os.(*File).Sync(0x492c568, 0x0, 0x0)
	/usr/local/go/src/os/file_posix.go:133 +0x40
github.com/influxdata/influxdb/tsdb/engine/tsm1.(*WALSegmentWriter).sync(0x4913640, 0xc0000000, 0x1a446001)
	/go/src/github.com/influxdata/influxdb/tsdb/engine/tsm1/wal.go:1087 +0x54
github.com/influxdata/influxdb/tsdb/engine/tsm1.(*WAL).sync(0x303e980)
	/go/src/github.com/influxdata/influxdb/tsdb/engine/tsm1/wal.go:300 +0x20
github.com/influxdata/influxdb/tsdb/engine/tsm1.(*WAL).scheduleSync.func1(0x303e980)
	/go/src/github.com/influxdata/influxdb/tsdb/engine/tsm1/wal.go:287 +0x74
created by github.com/influxdata/influxdb/tsdb/engine/tsm1.(*WAL).scheduleSync
	/go/src/github.com/influxdata/influxdb/tsdb/engine/tsm1/wal.go:261 +0x60
goroutine 673 [running]:
runtime.throw(0xea2be6, 0xd)
	/usr/local/go/src/runtime/panic.go:617 +0x5c fp=0x10bc5d90 sp=0x10bc5d7c pc=0x400d8
runtime.(*mcache).refill(0x76eeb368, 0x65)
	/usr/local/go/src/runtime/mcache.go:137 +0xfc fp=0x10bc5da4 sp=0x10bc5d90 pc=0x2668c
runtime.(*mcache).nextFree(0x76eeb368, 0x65, 0x0, 0x0, 0x0)
	/usr/local/go/src/runtime/malloc.go:786 +0x7c fp=0x10bc5dc4 sp=0x10bc5da4 pc=0x1ac30
runtime.mallocgc(0x2000, 0xd0ace0, 0xbc7501, 0x31ac200)
	/usr/local/go/src/runtime/malloc.go:939 +0x78c fp=0x10bc5e2c sp=0x10bc5dc4 pc=0x1b574
runtime.makeslice(0xd0ace0, 0x1fdc, 0x1fdc, 0x3e8)
	/usr/local/go/src/runtime/slice.go:49 +0x70 fp=0x10bc5e40 sp=0x10bc5e2c pc=0x579b8
github.com/influxdata/influxdb/tsdb/engine/tsm1.packBlock(0x0, 0x0, 0x0, 0x1f00, 0x10afc000, 0x1f41, 0x1f41, 0x1379aa00, 0x90, 0x207f, ...)
	/go/src/github.com/influxdata/influxdb/tsdb/engine/tsm1/encoding.go:948 +0x1b8 fp=0x10bc5e70 sp=0x10bc5e40 pc=0xbca8ec
github.com/influxdata/influxdb/tsdb/engine/tsm1.encodeFloatBlockUsing(0x0, 0x0, 0x0, 0x12d7fc40, 0x3e8, 0x3878, 0x1ab2c60, 0x31ac200, 0x47664c0, 0x22fb0000, ...)
	/go/src/github.com/influxdata/influxdb/tsdb/engine/tsm1/encoding.go:394 +0x1b0 fp=0x10bc5eb4 sp=0x10bc5e70 pc=0xbc7668
github.com/influxdata/influxdb/tsdb/engine/tsm1.(*cacheKeyIterator).encode.func1(0x4e156c8, 0x1, 0x651, 0xa063fc0)
	/go/src/github.com/influxdata/influxdb/tsdb/engine/tsm1/compact.go:1959 +0x2ec fp=0x10bc5fdc sp=0x10bc5eb4 pc=0xc1e584
runtime.goexit()
	/usr/local/go/src/runtime/asm_arm.s:868 +0x4 fp=0x10bc5fdc sp=0x10bc5fdc pc=0x71a18
created by github.com/influxdata/influxdb/tsdb/engine/tsm1.(*cacheKeyIterator).encode
	/go/src/github.com/influxdata/influxdb/tsdb/engine/tsm1/compact.go:1921 +0x80
goroutine 448 [running]:
runtime.throw(0xea2be6, 0xd)
	/usr/local/go/src/runtime/panic.go:617 +0x5c fp=0x111d1d90 sp=0x111d1d7c pc=0x400d8
runtime.(*mcache).refill(0x76eeb004, 0x65)
	/usr/local/go/src/runtime/mcache.go:137 +0xfc fp=0x111d1da4 sp=0x111d1d90 pc=0x2668c
runtime.(*mcache).nextFree(0x76eeb004, 0x65, 0x0, 0x0, 0x0)
	/usr/local/go/src/runtime/malloc.go:786 +0x7c fp=0x111d1dc4 sp=0x111d1da4 pc=0x1ac30
runtime.mallocgc(0x2000, 0xd0ace0, 0xbc7501, 0x31ac1a0)
	/usr/local/go/src/runtime/malloc.go:939 +0x78c fp=0x111d1e2c sp=0x111d1dc4 pc=0x1b574
runtime.makeslice(0xd0ace0, 0x1fdc, 0x1fdc, 0x3e8)
	/usr/local/go/src/runtime/slice.go:49 +0x70 fp=0x111d1e40 sp=0x111d1e2c pc=0x579b8
github.com/influxdata/influxdb/tsdb/engine/tsm1.packBlock(0x0, 0x0, 0x0, 0x1f00, 0x1104c000, 0x1f41, 0x1f41, 0x15df4a00, 0x90, 0x207f, ...)
	/go/src/github.com/influxdata/influxdb/tsdb/engine/tsm1/encoding.go:948 +0x1b8 fp=0x111d1e70 sp=0x111d1e40 pc=0xbca8ec
github.com/influxdata/influxdb/tsdb/engine/tsm1.encodeFloatBlockUsing(0x0, 0x0, 0x0, 0x1298bac0, 0x3e8, 0x30a8, 0x1ab2c60, 0x31ac1a0, 0x47663c0, 0x22f6b400, ...)
	/go/src/github.com/influxdata/influxdb/tsdb/engine/tsm1/encoding.go:394 +0x1b0 fp=0x111d1eb4 sp=0x111d1e70 pc=0xbc7668
github.com/influxdata/influxdb/tsdb/engine/tsm1.(*cacheKeyIterator).encode.func1(0x4e156c8, 0x1, 0x651, 0xa063fc0)
	/go/src/github.com/influxdata/influxdb/tsdb/engine/tsm1/compact.go:1959 +0x2ec fp=0x111d1fdc sp=0x111d1eb4 pc=0xc1e584
runtime.goexit()
	/usr/local/go/src/runtime/asm_arm.s:868 +0x4 fp=0x111d1fdc sp=0x111d1fdc pc=0x71a18
created by github.com/influxdata/influxdb/tsdb/engine/tsm1.(*cacheKeyIterator).encode
	/go/src/github.com/influxdata/influxdb/tsdb/engine/tsm1/compact.go:1921 +0x80
[s6-finish] sending all processes the TERM signal.

My config:

{
  "auth": true,
  "reporting": true,
  "ssl": false,
  "certfile": "fullchain.pem",
  "keyfile": "privkey.pem",
  "envvars": [],
  "log_level": "warning",
  "verify_ssl": false
}

I notice the CPU/MEM (Glances) are running sky high until crashing at startup.
Anything I can do ?