Send an email from a scene

Good evening.

I would like to be notified (ideally by email) when a sensor is triggered (water level in my case), but I can’t find this function anywhere, except for sending a message directly in Gladys. However, that’s not really practical: there is no notification on my smartphone and there is an issue with message refreshing — I have to manually refresh to see them appear…

Thanks in advance for your ideas :slight_smile:

Hi, you need to do it via MQTT.

Create an MQTT sensor to which you send a value; this sensor must be monitored by bash/python/Node-RED… which will perform an action depending on the value.

You’ll find quite a few bash code examples in my tutorials:

You also have the option to be notified via Telegram through a scene.

Here is the documentation to set up Telegram Envoyer des notifications Gladys sur Telegram | Gladys Assistant

And an example of a scene :

@Hizo Thank you for these tutorials :slight_smile:

However, wouldn’t it be simpler to design a common function for all of Gladys that allows sending a notification by selecting one or more channels (email, voice, SMS …)?

@cicoub13 Thanks for this idea, but I don’t use Telegram … However, I’ll look into the use of variables :slight_smile:

I agree, it would be nice to have an email sending system directly from gladys.
For SMS it’s more complicated…

You can easily send SMS via the Free (mobile) API but otherwise…

But since you use Python, you can send yourself JSON with the message and the recipient and send it from your Python script.

@Hizo Indeed, one can delegate everything to tools external to Gladys, but in my opinion you lose all the value of the graphical interface that the assistant provides: the simpler and more integrated it is, the more we use it :slight_smile: I would have imagined finding a configuration page for "interfaces to the world", in which to configure an interface that would then be accessible from anywhere in the scenes, for example …

1 Like

You can make a feature request, but you’ll need to be extremely specific about the idea and what’s expected.

Hello @cicoub13

How do you retrieve the weather status so you can store it in a variable afterwards?

Hi @jean_bruder !

Strange though, wouldn’t the simplest thing be to fix this issue on your phone? Not having notifications is really annoying, isn’t it? ^^

Telegram integrates really well with Gladys, especially for replying to Gladys/sending images, etc… :slight_smile:

I am making an HTTP request to OpenWeatherMap

GET https://api.openweathermap.org/data/2.5/weather?lat=43.2568\u0026lon=-0.4016\u0026appid=\u003ckey\u003e\u0026lang=FR\u0026units=metric

@cicoub13

If you can make a mini-tutorial showing how you do it that would be great and would provide a general example for other uses :wink:

OK, I’ll do that (but my scene is already described here https://youtu.be/OeXewA105qI?si=xKdlb6RQypYgDkTa\u0026t=2169)

yes I had seen it but it shows more what you can do than how to do it :sob: hence my request :crazy_face: :wink:

Hello @pierre-gilles,

I’m not sure I’m using Gladys the right way to get notifications: in my case it’s a shortcut to the web page.

Regarding the various communication channels implemented, such as Telegram, perhaps broader support would allow better adoption of the tool?

I’m not sure I understand, did you properly install the Telegram app on your phone?

https://play.google.com/store/apps/details?id=org.telegram.messenger\u0026hl=fr\u0026gl=US

Ok, I put my home latitude and longitude and replace « key » with my API key, is that right?

Because I’m getting an error.

Hello @pierre-gilles,

No, Telegram is not installed. I use Gladys’s WEB interface only. I imagine that’s why the notifications simply don’t come through.

But that doesn’t answer my initial question, which would be to be able, in the first instance, to send an email :wink:

Ideally, I imagine a « message » block to add to scenes, in which to select the message target (to be configured in a dedicated configuration module) and the message to send. It would then be possible within the same scene to send the same message to several people/media :slight_smile: For the moment, in my case, when I want Gladys (aka « La p’tite Dame » as my son calls her) to inform us verbally, I’m forced to duplicate the HTTP blocks (and thus the whole ad-hoc configuration) by changing the message depending on what needs to be said :crazy_face:

Gladys already seems like a real gem at this stage, so why not continue making the project even better? :heart_eyes:

Have a great day :slight_smile:

Install it then :joy: it’s free and takes 30 seconds! Once you’ve tried it you’ll be convinced :grinning_face_with_smiling_eyes: 100 times better than email!

Why not, you can create a feature request and if there’s demand it can be prioritized.

Besides, sending emails is complicated. Either you set up your own email server (and that’s not user-friendly at all, and you’re very likely to end up in spam), or you use the SMTP credentials from your email provider (if they provide them), and that’s not very user-friendly. Or you pay for an email-sending API (SendGrid, Amazon SES, etc.).

In short, for me in the short term, the solution is in your hands: install Telegram and within 30 seconds you can do whatever you want :wink:

Personally, I’m not convinced by Telegram, I don’t use it.

I prefer SMS and emails.

1 Like