

- #Why is docker ip different from homeassistant how to#
- #Why is docker ip different from homeassistant install#
Of course host and port needs to be adapted to where you can reach the InfluxDB database from your Home Assitant host. Once the access is possible you can connect Home Assistant to the database by using a configuration like this: # saving data to influxdbĭetails can be found here but this small setup is good enough for me. Access from outside will not be possible. This will forward the port 8086 from the container to the host but only for the IP address 127.0.0.1 which is localhost.

due to host mode in Home Assistant) you can use this neat code: ports: If you want to avoid access from the outside but still need to open the database (e.g. If the Home Assistant container is running in host mode or on a different machine you need to forward the 8086 port from the dabase container so that it is available from the outside. If you are using Docker and both containers are on the same network you can simply reach it via containername:port. Before we start we need to make sure though that the database is reachable from the Home Assistant host. The configuration can be done via the configuration.yaml file. We can configure Home Assistant to write data for some (or all) devices to this new database. Now lets go and connect it to Home Assistant. You now have a new databases and a user that can read and write to it. Grant all on homeassistant to homeassistant you can directly connect to the DB in the container (influxdb is the container name)Ĭreate user homeassistant with password 'supersecurepassword123' Afterwards we will connect it to Home Assistant. If you are using my setup just start the containers via docker-compose and follow these steps to set up our new InfluxDB database. While it works with a bunch of them InfluxDB is the preferred one in most cases. Grafana needs a separate database in the background to load the data from. If you want to the same simple setup I am using just head over to my GitHub repository The setup is really easy and already includes a container for Grafana and one for the database I am using here: InfluxDB.
#Why is docker ip different from homeassistant install#
You can install Grafana on pretty much all platforms manually but I would suggest going with Docker for your smart home server to make all of this more manageable. Setting this up with Home Assistant is also really easy.
#Why is docker ip different from homeassistant how to#
I already described how to use it with OpenHab in an earlier post. Fortunately there is a much much better tool out there (and it is for free): Grafana.

The built-in history tool is a little bit more powerful but also not that much better. Much more powerful and customizable: a Grafana dashboard
