Shelly switch turned on or off notifications on your phone.

Get a low-priority push notification when a Shelly relay or plug switches on or off.

How it works

Three steps to your first push

STEP 01

Install the recipe

One click in Studio gives you a personal webhook URL.

STEP 02

Paste your URL into Shelly

Add it as a webhook for Switch on.

STEP 03

Get a push on your phone

With the text, sound and buttons from the recipe.

Setup

How to set up the Shelly switch on webhook

  1. Click Install in Studio and sign in. The recipe is added to your account and you get a personal webhook URL.
  2. Open your Shelly device's web interface (browse to its IP address) or the Shelly Smart Control app and go to Actions.
  3. Add a webhook action for the Switch on event.
  4. Use the URL from the setup notes below. Shelly fills in the ${…} parts itself when it calls it.
  5. Save, then trigger the device once to send a real event.
  6. Use this as the action URL:
  7. ```
  8. your webhook URL?event=switch.on&device=${config.sys.device.name}&label=Garage%20heaterhttps://••••••••/•••••••• your personal URL, shown after install
  9. ```
  10. Want a push when it turns off as well? Add a second action for `switch.off` with the same URL, changing `event=switch.on` to `event=switch.off`.
  11. Change `label=Garage%20heater` to whatever you want the notification to say (`%20` is a space). Leave it out to use the device name.
The code

What runs when the webhook arrives

Studio calls handleRequest(request) with the incoming webhook and sends the message it returns. It's yours after install; change anything.

transform.js
1// Shelly → switch turned on / off
2// Fires when a Shelly relay or plug (Plus 1, Plus Plug S, Pro 4PM, …) switches.
3//
4// Add webhook actions for "switch.on" and/or "switch.off", calling:
5// <integration URL>?event=switch.on&device=${config.sys.device.name}&label=Garage%20heater
6// (use event=switch.off on the off action)
7
8// Shelly webhooks are GET requests, so the data arrives as query parameters.
9// Fall back to a JSON body so the recipe also works when POSTed (and in the Test runner).
10function readParams(request) {
11 const body = request.body && typeof request.body === "object" ? request.body : {}
12 return { ...body, ...(request.query || {}) }
13}
14
15// Shelly fills an unset name in as "null"; treat that (and blanks) as missing.
16function text(value) {
17 const s = value == null ? "" : String(value).trim()
18 return s === "" || s === "null" || s === "undefined" ? null : s
19}
20
21// Switch events, and how to describe them in the notification.
22const STATES = {
23 "switch.on": "on",
24 "switch.off": "off",
25}
26
27function handleRequest(request) {
28 const params = readParams(request)
29
30 // Guard: only handle switch events, so other Shelly hooks on this integration stay quiet.
31 if (!Object.prototype.hasOwnProperty.call(STATES, params.event)) {
32 console.log(`Ignoring Shelly event "${params.event ?? "unknown"}" — not a switch event`)
33 return null
34 }
35
36 // "label" is free text you put in the URL (e.g. "Garage heater"); fall back to the device name.
37 const name = text(params.label) ?? text(params.device) ?? "Your Shelly"
38
39 return {
40 title: `🔌 ${name} switched ${STATES[params.event]}`,
41 topic: "Shelly",
42 priority: -1, // Low — a status update, not an alert
43 }
44}
Payload

The Shelly switch.on webhook

This is what Shelly sends to your URL for switch on. It is a sample, trimmed to the fields recipes use.

switch.on · sample.json
1{
2 "event": "switch.on",
3 "label": "Garage heater",
4 "device": "shellyplusplugs-garage"
5}
FAQ

Shelly switch turned on or off notifications: questions

Does this work on iPhone and Android?

Yes. Install the JustPush app from the App Store or Google Play and sign in. Every phone signed in to your account gets the notification.

Do I need to write code?

No. Install the recipe in Studio, paste your webhook URL into Shelly and you are done. The code is there if you want to change the text, the sound or the buttons.

Can I change what the notification says?

Yes. After install the recipe's code is yours. Edit it in Studio and test it against the sample payload before you save.

What does it cost?

JustPush is free for 30 days. After that it's $19.99 a year, or $39.99 once. There is no extra charge for recipes.

Ready when you are

Shelly on your phone in two minutes.

Install the recipe, paste one URL, done. Free for 30 days, no credit card required.