Shellys becoming unavailable

Hello,

running the latest version of core-2021.6.1 and supervisor-2021.05.4 on a RPi4.
I have installed the Shelly add-on via hacs.

From time to time, i have the problem that my Shellys (3 of type, 2.5 for my roller shutters, 6 of type Plug S) become unresponsive.
I do not see any entries in the HA logfiles.
All devices have a static IP address configured via my Fritrz!Box.

I reloaded the Integration, also restrated HA - no effect.
All Shellys have latest firmware installed. Also rebooted the Shellys - no effect.
Also unplugged one of the Shelly and re-plugged - no effect.

Anyone has any idea what is wrong here?
Searched in the forums and by G*** but not really found s.th. which helps.
In Github of the integration, i see several similar, but not what i am encountering.

Thanks for your help in advance,
/ Ralf

Are the Shellys working via their app, or are they completely offline?

I had this with two Shelly 1s — very unreliable wifi connection, going offline when the physical switch was operated. In the end, I flashed them with ESPHome and they have been perfect since.

I can control the Shellys via their (internal) website.
I do notuse cloud or the Shwlly App as i wanged to control them with HA.

If they’re staying connected to wifi but the HA integration isn’t working for you, perhaps use MQTT on them? I don’t use the integration, but I have a Shelly 1PM on its own firmware that works fine like that.

Switch:

- platform: mqtt
  name: "Immersion switch relay"
  unique_id: UNIQUE_ID
  command_topic: "shellies/shelly1pm-xxxxxx/relay/0/command"
  payload_on: "on"
  payload_off: "off"
  state_topic: "shellies/shelly1pm-xxxxxx/relay/0"
  state_on: "on"
  state_off: "off"

One of several sensors:

- platform: mqtt
  name: "Immersion switch relay state"
  unique_id: ANOTHER_UID
  state_topic: "shellies/shelly1pm-xxxxxx/relay/0"

All local control, has worked flawlessly for months.

Are they configured for broadcast CoAP or are they directing the packets to HA’s IP ?

I figured it out to get the devices back - using the “hard” method:

  1. uninstalled the Shelley integration
  2. reboot
  3. installed Shelly integration again

BUT if i click on an entity in lovelace (e.g. a button) it is insanely slow. It takes several seconds until i see a reaction in Lovelyce. Means: click - device on, several seconds later it is shown up in lovelace. Then i can click again to disable.

Also, my Shelly 2.5 showed up as two switches. I use these Shellies for my cover blinds.
Before, it has shown up as covers.

Unsure what this is and how to really get behind the things as i do not really see anything in the logs and how to fix all this.

Need to investigate if the proposed solution via mqtt is helping, but need some free time to set this up.

Nevertheless, thanks for all your help so far!
/ Ralf

Seems i found one topic: my Shellies 2.5 have changed the device type after a firmware update.
These have been (re)set to “button type”. I changed this to back to “cover type”.

Update: iused the rest API method to control the shellies which reacts much more faster as the integration.
Tried with the above mqtt but my shellies never reacted if i changed the value. Think they are only writing but never reading the values? Unsure…
To get additional values like power consumption, i set up the mqtt connection in the shellies.

Nevertheless, thanks for all your help!
/ Ralf

If you tried with exactly the above MQTT, it won’t work. You need to replace my topics’ "shellies/shelly1pm-xxxxxx/ with the topic they’re using. My 1PM is virtually instantaneous over MQTT, and my ESPHome-flashed Shelly 1 units are similarly quick.

Surely i replaced it appropriately. Do the shellys really read the mqtt topics or just send it?
Nevertheless, rest is working good for me.

Yes, they read it too: the command_topic in my example works to turn it on and off.

Glad it’s working for you now.