Shelly ColoT unicast
In this blog post I’ll discuss the impact of the Shelly v1.10.0 firmware update introducing CoIoT unicast.
We’ll quickly go through what CoIoT, CoAP and mDNS are. I won’t go into the nitty-gritty details, mostly because I don’t understand the specifics myself :p
CoIoT and CoAP ¶
Shelly uses the CoIoT communication protocol, which is based on CoAP. More information on Shelly’s implementation can be found in the Shelly API Reference documentation.
Important to know for this blog post is that CoAP uses mDNS (multicast DNS) to announce it has a HTTP service running on port 80.
Downside of multicast ¶
Multicast is a great method for devices to discover eachother without spamming packages to the whole network like with broadcast. It works great in regular networks where all devices are within the same network subnet.
Things start to break down, however, when you start implementation network segregation and VLANs.
A lot is dependant on how the networking hardware implements VLANs and how mDNS repeating is handled across VLANs.
Usually you’ll need to be able to forward mDNS packages across VLANs, either through functionality provided by the router or by setting up an mDNS repeater yourself on a system that’s connected to each VLAN you want to connect.
In just about any case, unicast suffices for your Shelly’s, especially when you’re using something like Home Assistant as your central hub.
Setting up unicast CoIoT on Shelly ¶
Setting up Shelly devices to use unicast for CoIoT communication, e.g. to your Home Assistant server, is very easy.
- Make sure you’ve updated your Shelly to at least firmware version v1.10.0
- Open the WebUI of your Shelly. Simply type the IP address of your Shelly in your browser. E.g., http://192.168.1.123
- Go to Internet & Security and open the Advanced - Developer Settings menu
- Check the box next to Enable CoIoT
- Enter the IP address of your Home Assistant server.
You don’t need to enter a port, the default port (5683) will be added automatically when you save.
- Save your changes and reboot the Shelly.
Also make sure you check the box next to Make device discoverable under Settings > Device Discoverable.
Home Automation Shelly CoIoT CoAP mDNS