Just noticed by chance Shelly have new firmware available. Has the super cool feature of backup WiFi! Love it! It is fantastic for my situation for reasons too complicated to list here.
However, got me thinking, does anyone have an automation to alert them to new firmware for their Shellys? I never look at the Shelly web GUI unless there’s a problem
Is there a way to report which device/s require an update? I have 20+ Shellies and most have been updated but trying to find a way to easily report the one or two that still require updating.
My Shellies are on v1.7.0 and they don’t seem to be periodically posting to shellies/announce.
It seem we need to publish a announce message to the topic shellies/command to trigger this announcement.
I’ve adapted @Florian snippet and added a periodic trigger to receive the announcements as well as adding the shelly ip to the notifications message for easy access to the GUI where one can update it.
To be honest now the latest release seems to have resolved the connectivity woes that have plagued my shellies for the last few months, I don’t think I’ll ever update again. Updating from when I bought them actually made them less reliable.
Does the code need to be entered in configuration.yaml or do I need to create an automation? Sorry but I’m still a bit immature at the Home Assistant level.
Very nice. Is there any way to automatically run the update, and maybe give a notification on success? Rather than manually having to click the link.
I am supporting quite a few Home Assistant installs all with shelly devices, and it would be great to be able to keep them up to date.
Edit, yes there is:
in configuration.yaml, add the rest integration and configure like so:
Just wondering, how would that look like in case Shelly is not utilized over MQTT Service? Rather for instance default Protocol, CoAP? Possible? Advantage or Disadvantage not to use MQTT?
Great automation you posted!
Quite new to yaml/HASS and not great at programming so I have a question:
It triggers the update by shelly url. I have a username/password on the shelly devices, does it login via the username/pass provided within hass and perform the update?
So far it didn’t trigger yet, even though an update was avail.
Edit: figured some stuff out with the help of shelly api docs. Think I figured it out.
The automation above does not check if there’s a firmware version difference (shelly device vs latest release), but rather checks the releasedate.
Means: I just have to wait for a new release to see if it triggers.
@spol when you’ll have it confirmed can you please share your code? I also have all my Shellies configured using Shelly integration (CoAP) with username and password and I was also wondering if the update is possible. Thanks!
Before I tackle this myself I thought I would check if anyone had set up automated updating with notification using CoAP (since I now have 8 or 10 shelly’s that need updates).
While new to HA I have been an engineer for MANY many years. Seems straight forward if I understand how things SHOULD work. At a high-level it seems like one could use
Trigger: binary_sensor.<< entity name >>_lts_firmware_update = True
Service: would be Notification Service described, and of course the REST command to update.
Of course I would need to understand how to do this “generically” rather then having to specify each Shelly (something like) binary_sensor.*_lts_firmware_update = True)? If there is some sort of wildcard support in HA. And of course have to understand if the rest of the scripts above that were contributed would still work for passing IPs to updater as written if NOT triggered by MQTT.
In summary seems like the is a better solution then just simply choosing to ditch the built in Shelly integration for the HACS integration they seems to provide UI support for updating Firmware (both of which are preferable to the web bookmark I made that I currently use to update all Shellys via URL or the terminal command I have that does the same) as those options still require my intervention.
Thanks for any guidance. When/if I finally get around to doing this myself I will post code here as seems at least 2 others here were looking for the same solution. Perhaps some FUTURE version of HA might make automation and other code snippet sharing easier… But that’s clearly a bigger topic for another day and I need too learn a lot more before I make THOSE kind of suggestions as something tells me Script Kiddies on steroids is not a great idea for stability/predictability/or MORE importantly Security!.. lol
Not yet as I haven’t had time to devote to it given other pressing HA issues (adding new Shelly’s and other issues around adding HAS type add-ons via docker since I don’t use Supervisor. However I am coincidentally looking at picking the issue back up soon after get around to implementing circadian lighting for my house full of Lifx bulbs (many controlled by Shelly connected physical light switches.
FWIW, I have a version of the MQTT “approach” that includes requesting the Shellies to update the firmware. I recently moved over from OpenHAB, where I’ve used this (MQTT) approach for a couple of years.
Strange, I have similar errors in my logs. I can actually see the shellies/announce topic and I can see the JSON payload. Try sending the shellies/command message with announce a payload and see what comes back…