I’ve been using the MQTT binding successfully for a number of years. However yesterday after some regular updates I noticed that most my MQTT devices stopped responding via OH. I’m currently on version 2.5.5.
All my MQTT devices are flashed with tasmota and they are either Shelly or Sonoff (latest version 8.3.1). When configuring MQTT I’ve always used the hostname of openHABianPi. However, this seems to have stopped working, if I update the host to the physical IP of my server it all works as expected. I have also, looked at openhabian-config to ensure my hostname is set. Still no luck…
Any ideas what could be wrong? Its not a massive issue but could do with rectifying.
Many thanks in advanced!
Nameserver issue, DNS.
If you click on the ‘Information’ Button of the tasmota-device’s web page you can see what IP is configured as the name server for your WLAN.
Check that box and the services running on it.
The tasmotae may report it via mqtt as well. I have lines like this in the mqtt log:
Also, If you have not purposely configured dns on your network then openhabianpi name relies on mdns. This service can be unreliable and unstable at times.
For over a year my pc could access using openhabianpi then all of a sudden it stopped with no reasoning whatsoever.
Since then I have configured a dns server on my network. This purposely sets the names up and I have no issues now.
Thanks for the information guys. All of a sudden the hostname is working correctly!
@Thedannymullen could you please provide more information on how I could configure a dns server on my network? Is this something I will have to configure on my router?
Thanks for all the help guys!
Yes if your router can handle the name lookup then it can be done there.
You would need to configure a static reservation on your router for sure then see if you can lookup the name using nslookup hostname.
Actually type nslookup you will get a prompt.
Type server routerip
Type hostname see if a result returned.
I use pihole currently to handle my dns. I can put my hand on the article right now. I will look on my laptop later today.
I’m using Pi-Hole, but I haven’t moved DNS over from my router. I thought about it, but didn’t perceive enough value at the time since I mostly rely on static IP addresses anyway.
@Thedannymullen, how have you found it aside from the improved DNS hostname resolution? Any other benefits?
@rpwong I moved it so that all my hosts lookup will be in one place. It is easy to backup. Plus sometimes the names in the lease on the edge router are not correct for some devices.
My edge router will resolv the names but I point at pihole for ad blocking this allows for only having the one dns server. The dhcp is handled by my router as I have multiple vlans.
I realized as I was reading this that I confused DNS and DHCP. Of course I have my DNS on pi-hole, or else the ad blocking wouldn’t work.