# Shelly water leak detected notifications on your phone > Get a Highest-priority push notification the moment a Shelly Flood sensor detects water. - Company: Shelly (https://www.justpush.io/recipes/shelly) - Event: `flood.alarm` (Flood alarm) - Tags: Smart home, Security - Install: https://studio.justpush.io/recipes/shelly/flood-alarm - Web page: https://www.justpush.io/recipes/shelly/flood-alarm ## Setup 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 Flood alarm 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 (shown in Studio after install)?event=flood.alarm&device=${config.sys.device.name} 9. ``` ## Code Studio calls `handleRequest(request)` with the incoming webhook (`{ method, headers, body, query, raw }`) and sends the message object it returns. Returning `null` sends nothing. ```js // Shelly → flood alarm // Fires when a Shelly Flood sensor detects water. // // Add a webhook action for the "flood.alarm" event on the device, calling: // ?event=flood.alarm&device=${config.sys.device.name} // Shelly webhooks are GET requests, so the data arrives as query parameters. // Fall back to a JSON body so the recipe also works when POSTed (and in the Test runner). function readParams(request) { const body = request.body && typeof request.body === "object" ? request.body : {} return { ...body, ...(request.query || {}) } } // Shelly fills an unset name in as "null"; treat that (and blanks) as missing. function text(value) { const s = value == null ? "" : String(value).trim() return s === "" || s === "null" || s === "undefined" ? null : s } function handleRequest(request) { const params = readParams(request) // Guard: only handle flood alarms, so other Shelly hooks on this integration stay quiet. if (params.event !== "flood.alarm") { console.log(`Ignoring Shelly event "${params.event ?? "unknown"}" — not a flood alarm`) return null } const device = text(params.device) ?? "Your Shelly Flood" return { title: "💧 Water leak detected", message: `${device} detected water`, topic: "Shelly", priority: 2, // Highest — water damage gets worse by the minute // sound: "siren", // any of Studio's sounds, e.g. incoming, bugle, siren } } ``` ## Shelly flood.alarm webhook payload (sample) ```json { "event": "flood.alarm", "device": "Under sink" } ``` ## FAQ ### 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.