Delayed detection when switching Shelly manually

EDIT: I think I fixed the behavior by setting the correct host IP in the binding configuration. But I have no clue why :slight_smile:

Hi,

I use several Shelly 1 devices connected to my physical light switches.
In openHAB I make use of the “follow” profile to switch other items, once the Shelly has been turned on or off externally / manually. This worked flawlessly meaning instantly in the past and stopped at an unknown time when I upgraded my openHAB instance. Maybe I switched at the same time from MQTT integration to Shelly Binding. Not sure.

Now, when pushing the light switch manually I see that it takes a random time within approx. 30s for openHAB to detect the change of the state. I tried to disable the ECO feature in the shelly, but this didn’t help.

Any help or idea is highly appreciated.

best regards

Stefan

I don’t use Shelly devices, but “random time within approx. 30s” suggests that the devices are being polled at a 30s interval. This seems relevant from the Discovery section of the docs:

Important for Generation 1 Devices: It’s recommended to enable CoIoT in the device settings for faster response times (event driven rather than polling). Open the device’s Web UI, section “COIOT settings” and select “Enable COCIOT”. It’s recommended to switch the Shelly devices to CoAP peer mode if you have only your openHAB system controlling the device. This allows routing the CoIoT/CoAP messages across multiple IP subnets without special network setup required. You could use Shelly Manager (doc/ShellyManager.md) to easily do the setup (configuring the openHAB host as CoAP peer address). Keep Multicast mode if you have multiple hosts, which should receive the CoAP updates.

I would guess you have Gen1 devices, since Gen2 devices use websockets.

Thanks, in deed Gen 1, but COIOT was already enabled. I think I fixed the issue by setting the host IP in the Shelly binding. No clue why this helps as I don’t know how COIOT works

For the benefit of future readers, what do you mean by “correct host IP”? What was the binding pointing to?

well, I use openHAB in docker container with “host” networking. So I set the “Host Interface IP” in the Shelly binding to my normal ipv4 host ip address. Previously the value was empty.

I’m also having problems that CoIot is not working on my Shelly1 (1st Gen). When setting the host, what port number did you use?

You need to open the Shelly binding itself via Administration - Settings - Add-on Store - Bindings

Click on Shelly Binding. In the new window you will see the binding description and information. In the top right click the gear icon. There you set the up address of the host (in my case the docker container underlying physical host). There is no requirement for a port setting.