Send notifications to your mobile phone from a Shelly device
Shelly offers a well-known range of smart home products celebrated for their seamless integration into your Wi-Fi network, eliminating the need for a dedicated smart home hub. One of their key strengths is their exceptional versatility—they can function within Shelly's proprietary cloud system or seamlessly integrate with free open-source software platforms like Home Assistant or OpenHAB. This flexibility allows you to build a powerful, cost-effective smart home system that surpasses traditional automation systems in terms of affordability.
A distinguishing feature of Shelly devices is their ability to communicate effortlessly with external automation systems via webhooks. Webhooks are essentially HTTP-based callback functions that enable lightweight, event-driven communication between two application programming interfaces (APIs).
In simpler terms, you can easily program any Shelly device to trigger an external web program whenever specific events occur.
For instance, imagine using a Shelly 1 smart switch to control your porch lights. You can set it up to trigger an external web resource whenever the lights are turned on or off. This could include calling the EZAlert.me API to send a notification via Telegram, Slack, or Discord.
To do this, you'll need to create an EZAlert.me account if you don't have one already and set up your first channel. Detailed instructions can be found in the "Getting started with EZAlert.me" guide.
Once your channel is set up, you can find your channel's API key by clicking the "Config" button and selecting "API Keys" from the popup menu. The API key will be a string in the format YY-YYYYYYYYYYY.
As explained in the EZAlert.me documentation, you can send alerts to the channel using the EZAlert.me API and your channel API key.
Suppose you wish to send a message each time the porch light is switched on. In that case, you should construct a URL like the following:
https://ezalert.me/v1/sendAlert?apikey=YY-YYYYYYYYYYYY&text=Porch+light+ON
Subsequently, type this URL in the "I/O Actions" section of the Shelly device configuration, specifically as the "Output on" URL, as illustrated in the provided image.
Be sure to change the YY-YYYYYYYYYYY with your channel actual API key.
WARNING: sometimes Shelly devices seems unable to reach SSL Urls. In the case your Shelly sensor is unable to send alerts, try use "http://" instead of "https://" in the Webhook URL. It usually fix the problem but please note that HTTP protocol is not encrypted and inerently less secure than HTTPS.
In the same way you can build an URL for the "Output off" event if you want to be notified every time the light is switched off.
Every Shelly device model has its own list of webhooks so that you can fire notification on specific events, for example you can program a Shelly door to send you an alert every time the door is opened.
Or you can program a Shelly EM to send an alert every time your house electric power consumption is too high or every time your solar panels produce more than a certain quantity of power.
Additionally, if you're using Shelly sensors such as the Shelly H&T, Shelly Flood, or similar devices, we've developed a dedicated Shelly Sensor webhook to streamline the integration process.
For more information about Shelly webhooks and how to use them please check out Shelly documentation .