Hi mates,
Hope you are all doing good, I am taking some time to work on my home assistant project and have few problem setting up influxdb.
I am following this tutorial as it seems to be the best I could find, adapting it with my project.
My problem is HA is not talking to influxdb though Grafana can see it and communicate with it. Of course I cannot make any useful chart as HA is not filling influxdb with my sensors data.
I have HA, Influxdb, Grafana (and Node-red, Deconz) install using docker. I am not using Hassio
cat Home_Assistant/.HA_VERSION
0.106.6
At startup, I can see in the HA logs the influxdb service is starting but fails to connect :
2020-03-25 19:20:58 INFO (MainThread) [homeassistant.setup] Setting up influxdb
2020-03-25 19:20:58 INFO (MainThread) [homeassistant.setup] Setting up lovelace
2020-03-25 19:20:58 INFO (MainThread) [homeassistant.setup] Setup of domain lovelace took 0.0 seconds.
2020-03-25 19:20:58 INFO (MainThread) [homeassistant.setup] Setting up updater
2020-03-25 19:20:58 INFO (MainThread) [homeassistant.setup] Setting up zone
2020-03-25 19:20:58 INFO (MainThread) [homeassistant.setup] Setting up sun
2020-03-25 19:20:58 WARNING (SyncWorker_9) [homeassistant.components.influxdb] Database host is not accessible due to 'HTTPConnectionPool(host='192.168.1.251', port=8086): Max retries exceeded with url: /write?db=home_assistant (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f206b45b490>: 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.
The last line makes me think home assistant is trying to use the deprecated webui to connect but I am not so sure.
My HA config.yaml :
influxdb:
host: 192.168.1.251
port: 8086
database: home_assistant
max_retries: 10
include:
entities:
# Batteries
- sensor.bout1_salon_xiaomi_battery_level
- sensor.bout5_salon_ikea_battery_level
- sensor.temp_salon_battery_level
# Temperatures
- sensor.temp_salon
# Humidite
- sensor.humid_salon
# Pression
- sensor.press_salon
I can access the databased through command line of course and Grafana but not HA.
What could be wrong ?
Just in case, my docker-compose file :
version: '3'
services:
homeassistant:
container_name: home-assistant
image: homeassistant/home-assistant:stable
restart: always
ports:
- "8123:8123"
volumes:
- /opt/Docker/Home_Assistant/:/config
devices:
- /dev/ttyZWAVE:/dev/ttyACM0
environment:
- TZ=Europe/Paris
network_mode: host
nodered:
container_name: node-red
restart: unless-stopped
image: nodered/node-red:latest
depends_on:
- "homeassistant"
user: root
volumes:
- /opt/Docker/Node_Red/:/data
ports:
- "1880:1880"
deconz:
image: marthoc/deconz
container_name: deconz
restart: always
ports:
- "8080:8080"
- "5900:5900"
volumes:
- /opt/Docker/Deconz:/root/.local/share/dresden-elektronik/deCONZ
devices:
- /dev/ttyACM0
environment:
- DECONZ_WEB_PORT=8080
- DECONZ_WS_PORT=4443
- DEBUG_INFO=1
- DEBUG_APS=0
- DEBUG_ZCL=0
- DEBUG_ZDP=0
- DEBUG_OTAU=0
- DECONZ_DEVICE=/dev/ttyACM0
network_mode: host
influxdb:
container_name: influxdb
restart: always
ports:
- '8086:8086'
- '8083:8083'
volumes:
- '/opt/Docker/Influxdb/:/var/lib/influxdb'
image: influxdb
network_mode: host
grafana:
ports:
- '3000:3000'
container_name: grafana
volumes:
- '/opt/Docker/Grafana:/var/lib/grafana'
image: grafana/grafana
network_mode: host
Any idea on what could be wrong ?
I was planning on writing a French tutorial on HA installation and all but I think I am not auite ready as I cannot figure out this problem on my own…
Cheers,