Tip
This script tracks the online status of remote Shelly devices and triggers Shelly scenes to notify users when devices go offline or come back online.
- Monitors the online status of Shelly devices.
- Executes a Shelly Scene to notify the user when all devices go offline.
- Executes a Shelly Scene to notify the user when any device comes back online.
- Stores the last three outage timestamps in KVS for history.
- Shelly devices to monitor
- Predefined Shelly Scenes in the cloud
- Shelly gen2 or never devices with scripting support
- Optain a Shelly Plus, Pro or Gen3 device Shelly devices.
- Connect the Shelly device to your personal WiFi network. Refer to the Shelly web interface guides.
- The firmware of Shelly Gen2 Plus devices must be version 1.4.4 or higher. The KVS store is read only if the firmware version is 1.4.3 or older.
- Open the Shelly device web page: Click Settings → Device Information → Device IP → click on the IP address. The Shelly device web page will open, on the left menu click "<> Scripts".
- Create new script and copy-paste the code inside of the scripting window.
- Name the script, for instance, "Remote monitoring", and save.
- Click "Start" once the saving process is complete.
- After the first run, the script stops and prompts you to fill in configuration parameters in KVS, such as API key, URL, etc.
- Configure script parameters in KVS.
- Add devices data inside of the script.
- Start the script and in few minutes monitor the logs to cehck if everything works well.
- Go to https://control.shelly.cloud/
- Click on the Settings tab
- Click on the "Authorization cloud key"
- Click on the Get key button
- Copy the key and save it in the KVS
- Copy the Shelly cloud URL and save it in the KVS
- Go to https://control.shelly.cloud/
- Click on the Scenes tab
- Click on the scene you want to use
- Click on the Informaton tab
- Copy the Scene ID and save it in the KVS
- Repeat the steps for the other scene
- Go to https://control.shelly.cloud/
- Click on the room where the device is located
- Click on the device you want to use
- Click on the Device Settings tab
- Open Device Information
- Copy the DeviceId (MAC address) and save it in the script
- Repeat the steps for the other devices
- Do not use more than 5 devices in the script as it may cause memory issues
This project is licensed under the MIT License. See the LICENSE file for details.
Created by Leivo Sepp, 2025