Better Avahi Support

I just finished writing a handful of media_component automations and really was missing the ability to use the avahi naming, rather than the full ip when pointing towards my local media. I’ve had the same thought other places, such as pointing towards my zoneminder instances, etc…

In short, it would be nice to say:
media_content_id: http://vault.local/local/Fireplace.mp3
and
zoneminder:
host: zoneminder.local

rather than:
media_content_id: http://192.168.1.150/local/Fireplace.mp3
and
zoneminder:
host: 192.168.1.175

Most of my computers have static IPs, but its still annoying to have to remember them and type them out.

Just a thought

don’t you have a DNS on your network? I can not think of a router that doesn’t have one included.
You could use these names, at least that’s what I’m doing.

Sure. I have avahi enabled everywhere else… i.e. I ssh in to the machine ssh [email protected], but when I point to foo.local addresses in my configs like my zoneminder example above it doesn’t resolve.

and just zoneminder without the local is not working?

correct, neither host: zoneminder nor host: zoneminder.local work for me. I positively do have and use avahi for other administration tasks, so I know the network has it enabled and ports open.

Also pertinent, this is running instance of the official docker image running on a Fedora26 server. (although this never worked when running bare metal on my older debian server either)

hmmm, feel free to delete this. It has to be something wrong with my local network config. I just realized that other devices (such as my pihole config) work just fine using only their hostname…

Aha. But this is strange, because normal hostname discovery should work.
From your laptop, something like ping zoneminder works?
If yes, could you login to the HA docker image running and try from there. If it’s not working there, have a look at the /etc/resolve to check your DNS settings.

Edit: thinking about it, you could hardcode the hostnames in the /etc/hostnames of your fedora machine to see if it helps. If so, either you are then happy with it, or fix your DNS config.

The thing with avahi and docker is a bit complicated. I once looked into it, and afaik one needs Dbus to have a working avahi setup and I could not find a way to make it work inside of docker.