Hi, I have many Shellys, commanding lights that are behaving funny.
Sometimes they work as expected
Sometimes you turn on the light in HA and the entity goes unavailable for few seconds and then comes back available (but the command on/off or off/on is NOT executed.
If you turn it on/off via Shelly web interface, does HA react to the state? Can you turn it on/off?
Are you using the core integration, custom component or MQTT?
Have you tried to reset the Shelly?
Have you tried to set the device up new in HA?
Do you have unicast with HA as peer enabled in Shelly developer settings?
Do the Shellys have good WiFi signal?
Do you have a unusual network setup?
Newest firmware?
If you have a UniFi setup I can tell you (basically just go to the device in Cloud Controller and click Reconnect).
If not, you need to find out yourself
It might be a bit of a hassle, but if you want to know for sure if it’s a network/wifi problem, you could set up something like Nagios and monitor the Shelly devices for a while. I run NEMS on a Raspberry Pi and monitoring my Shellys works great.
I crerated a new SSID (same LAN as Home Assistant) on which I make connect ONLY the Shelly (around 15), and I put the DMIT to 1 (not sure what that is). Of course all the Shelly have the congfiguration CAST as per Home Assistant instruction (IP:5683)