Shelly integration "Failed to connect" issue on a VM installation

Hi all,

I’m having the “Failed to connect” issue while adding a Shelly device on HA through the new Shelly integration.
Here some info about my setup:

  • HA installation

    • Home Assistant OS (2021.3.4) installed on a KVM Virtual Machine (Ubuntu)
    • configured firewall rules to expose HA into my home intranet
    • port forwarding the ports 8123 (for HA), 1883 (for Mqtt) and 5683 (CoIoT) to the VM
  • Shelly configuration

    • Model: Shelly 2.5
    • Firmware: v1.10.1
    • Mqtt disabled
    • CoIoT enabled (rebooted device after this)
    • CoIoT peer = 192.168.1.111:5683 (192.168.1.111 is the HA ip address)
    • Cloud activated (already tried with this turned off)

Here’s an imagine with the setup

On the HA shelly integration first page, I’m adding the IP address of the shelly device (192.168.1.88), but still receiving the “Failed to connect” error message.
Any ideas what may be missing?

Thanks in advance!

i dont have that Shelly device, but on internet and Security, do you see a tab that says COIOT? when you go into shelly settings. (entering its own IP)

If so put your address from HA. without any http or https

1 Like

I have that option activated on the shelly’s settings.
I’ve added an image to the post to provide a better description of my setup

well i had many issues with the cameras. and now it seems stable. what i always do now is:

as soon as i log in into its own WIFI, i do a factory reset.
After, i connect the shelly to my local network, do rthe coiot, and reboot the device. and then I include it to HA. maybe try this procedure. remember i am a major noob soo… i follow my previous experiences and from what ive read.

the issue is in the VM and not on the shelly devices :disappointed: I installed hassio in a raspberry pi to test and the shelly discovery worked just fine.
Does anybody have some details of how to setup the VM connection settings or/and the forwarding rules needed? (I followed the official instructions for VMs and was able to run the hassio OS + GUI web, but the discovey mechanism is not working as in the raspberry pi)

Hi @pedross I am having the exact same issue as you. Did you get the Shellys over the line with HA on KVM in the end?

Hello
I have the same issue - does anyone have a solution for this?

Same issue with a proxmox setup, any news about that?

A few Shellys work and others behave like in here. These are the logs of those that don’t work:

Received error: [Errno 101] Network unreachable, transport: <_SelectorDatagramTransport fd=46 read=polling write=<idle, bufsize=0>>, socket: <asyncio.TransportSocket fd=46, family=AddressFamily.AF_INET, type=SocketKind.SOCK_DGRAM, proto=0, laddr=('0.0.0.0', 39223)>

Not sure if it’s to do with multicast vs unicast? Can’t make them work either way

Well, this is very sad. I guess I’ll add my “Me too” here for posterity.

An update, for those curious, and future troubled souls. A kindly person from Reddit encouraged me to try some different settings, and it seems that enabling “Allow Cross-Origin Resource Sharing” has fixed this for my situation.

To do this, open a web browser and enter the IP address of the actual device (192.168.x.xxx). Click on the “Internet & Security” tab. Then open the “ADVANCED - DEVELOPER SETTINGS” drop-down. Check the box for “Allow Cross-Origin Resource Sharing”, hit SAVE at the bottom, and Bob’s your uncle.

Did you ever figure this out? I’m having the same issue. I tried the CORS setting and it still didn’t work.