Skip to content
Andy Blackburn edited this page Feb 18, 2021 · 62 revisions

Updating from stock firmware

  • Watch a 2 minute video.

  • Use the following URLs depending on the device model:

    • Shelly 1: http://A.B.C.D/ota?url=http://rojer.me/files/shelly/shelly-homekit-Shelly1.zip
    • Shelly 1L: http://A.B.C.D/ota?url=http://rojer.me/files/shelly/shelly-homekit-Shelly1L.zip
    • Shelly 1PM: http://A.B.C.D/ota?url=http://rojer.me/files/shelly/shelly-homekit-Shelly1PM.zip
    • Shelly 2: http://A.B.C.D/ota?url=http://rojer.me/files/shelly/shelly-homekit-Shelly2.zip
    • Shelly 2.5: http://A.B.C.D/ota?url=http://rojer.me/files/shelly/shelly-homekit-Shelly25.zip
    • Shelly I3: http://A.B.C.D/ota?url=http://rojer.me/files/shelly/shelly-homekit-ShellyI3.zip
    • Shelly Plug: http://A.B.C.D/ota?url=http://rojer.me/files/shelly/shelly-homekit-ShellyPlug.zip
    • Shelly Plug S: http://A.B.C.D/ota?url=http://rojer.me/files/shelly/shelly-homekit-ShellyPlugS.zip
  • If everything goes well, after 30 seconds or so you will see LED blinking (see LED indication section here) and a different web interface at the same device address.

  • Script for an automated way to update your devices (see below).

    • ./flash-shelly.py hostname (for single device)
    • ./flash-shelly.py -a (for all devices on the network)

Reverting to stock firmware

It is possible to revert back to stock firmware.


Script

There is a Python script works with macOS / Linux / Windows. It can be downloaded here, simply download the zip, unpack and in terminal navigate to the tools folder and run the command.

  • i.e ./flash-script.py -a will scan your network for all available devices and ask you if you wish to flash the found device(s) to homekit firmware.

Requirements: Python 3.6 or later, Firmware version 2.1 or later.

You can do various things with the script see below:

usage: flash-shelly.py [-h] [-m {homekit,keep,revert}] [-t {homekit,stock,all}] [-a] [-q] [-l] [-e [EXCLUDE ...]] [-n] [-y] [-V VERSION] [--variant VARIANT] [--local-file LOCAL_FILE] [-c HAP_SETUP_CODE]
                       [--ip-type {dhcp,static}] [--ip IPV4_IP] [--gw IPV4_GW] [--mask IPV4_MASK] [--dns IPV4_DNS] [-v {0,1,2,3,4,5}] [--log-file LOG_FILENAME]
                       [hosts ...]

Shelly HomeKit flashing script utility

positional arguments:
  hosts

optional arguments:
  -h, --help            show this help message and exit
  -m {homekit,keep,revert}, --mode {homekit,keep,revert}
                        Script mode.
  -t {homekit,stock,all}, --type {homekit,stock,all}
                        Limit scan to current firmware type.
  -a, --all             Run against all the devices on the network.
  -q, --quiet           Only include upgradeable shelly devices.
  -l, --list            List info of shelly device.
  -e [EXCLUDE ...], --exclude [EXCLUDE ...]
                        Exclude hosts from found devices.
  -n, --assume-no       Do a dummy run through.
  -y, --assume-yes      Do not ask any confirmation to perform the flash.
  -V VERSION, --version VERSION
                        Force a particular version.
  --variant VARIANT     Prerelease variant name.
  --local-file LOCAL_FILE
                        Use local file to flash.
  -c HAP_SETUP_CODE, --hap-setup-code HAP_SETUP_CODE
                        Configure HomeKit setup code, after flashing.
  --ip-type {dhcp,static}
                        Configure network IP type (Static or DHCP)
  --ip IPV4_IP          set IP address
  --gw IPV4_GW          set Gateway IP address
  --mask IPV4_MASK      set Subnet mask address
  --dns IPV4_DNS        set DNS IP address
  -v {0,1,2,3,4,5}, --verbose {0,1,2,3,4,5}
                        Enable verbose logging 0=critical, 1=error, 2=warning, 3=info, 4=debug, 5=trace.
  --log-file LOG_FILENAME
                        Create output log file with chosen filename.```

macOS / Linux example:
  * `./flash-shelly.py -la` this will list all available shelly devices and report the current firmware version that is available.
  * `./flash-shelly.py -am keep` this will update all available shelly devices on the current firmware type (Stock or HomeKit) to latest version.
  * `./flash-shelly.py hostname` this will update the device hostname to current firmware version that is available.
  * `./flash-shelly.py -m revert hostname` this will revert the device hostname to latest stock firmware version that is available (this can also be used with -a `./flash-shelly.py -am revert` to revert all devices on the network).
  * `./flash-shelly.py --local-file=SHSW-1.zip hostname` to flash a local file to the device, you can use hostname or IP of the device.


Windows example:
  * `python3 flash-shelly.py -la` this will list all available shelly devices and report the current firmware version that is available.
  * `python3 flash-shelly.py -am keep` this will update all available shelly devices on the current firmware type (Stock or HomeKit) to latest version.
  * `python3 flash-shelly.py hostname` this will update the device hostname to current firmware version that is available.
  * `python3 flash-shelly.py -m revert hostname` this will revert the device hostname to latest stock firmware version that is available (this can also be used with -a `python3 flash-shelly.py -am revert` to revert all devices on the network).

## Script Fails to run

If the script fails to run because of 'Failed to lookup online version information' and you are running on macOS try the following:
* In the finder navigate to Applications/Python 3.x (x being the full python version you have installed i.e. Python 3.9)
* If you see a icon named "Install Certificates.command", double click on it.
* now try script again.