Allow influx DB to use a server name instead of IP address

Hi guys.

Thank you for all the amazing work on Home Assistant. It has made my home automation life much easier.

Would it be possible for the Influx config to take in server name rather than the IP address.
The reason is I am running Home Assistant in docker and my Influx db in a docker cluster (for fail over reasons). It would be nicer to be able to config Influx as influx.example.domain and let the DNS resolve the IP address.

Please keep up the good work.
Many Thanks.

Have you tried to put a server name in the host field and gotten an error or are you assuming only ip addresses are allowed because the documentation mentions ip address in the description of the host field? There is no logic in the code which enforces host has to look like an ip address, you should be able to put in a server name, it takes any text. I also don’t see why that wouldn’t work but if you tried it and got an error please share.

I’ve done a couple of enhancements for influx for 0.112 already so I can take a look if it doesn’t work for some reason. I agree that it should support that.

Hi Mike.

Thanks for the quick reply. I cannot remember what happened when I tried the server name. However I will give it a go after work. From what you say, it does sound like it should just work.

I will have another go and post back my findings.

Hi Mike.
I got a change to stick in the server name as you suggested, and it work.
Sorry for inconveniencing you.
It might be worth updating the docs.
Please feel free to close this request.

Thank you again for your time.

What did you put under the port section if you used servername as host? Currently, i have an influxdb database outside of my network and i want HA to send some data but no data gets sent through. tried port 443 and that didn’t work either, but works when I’m adding it as a database in grafana

Mind sharing the yaml that for this to work?

When I tried to follow the docs it was giving me weird auth errors.