rules: send a message to an external web address

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
2000ede
Normal user
Posts: 22
Joined: 12 Dec 2023, 16:43

rules: send a message to an external web address

#1 Post by 2000ede » 13 Dec 2023, 20:57

Hi,
I want to send an external http command in Rules:

Example:
http://api.telegram.org/bot999:9999/sen ... t=TEST0815

PostToHTTP ?
SendToHTTP ?
PutToHTTP ?

I've googled a lot but can't find it. As far as I understand, https doesn't work.
But http to an address on the web should work.
How exactly do I have to split it up so that the message gets out?

Thanks for help!

User avatar
chromo23
Normal user
Posts: 827
Joined: 10 Sep 2020, 16:02
Location: germany

Re: rules: send a message to an external web address

#2 Post by chromo23 » 13 Dec 2023, 21:06

For telegram you´ll need a workaround...
see here: viewtopic.php?p=51745&hilit=telegram#p51745

For simple notifications i recommend ntfy.
There you can use PostToHTTP:

Code: Select all

PostToHTTP,ntfy.sh,80,/<Topic>,'title:<some_title>','<some_data>'
Example:

Code: Select all

PostToHTTP,ntfy.sh,80,/Mytopic,'title:%sysname%','%eventvalue1%,%eventvalue2%,%eventvalue3%,%eventvalue4%'
Edit:
The problem with telegram is the S in HTTPS.
Not supported by ESPEasy yet...

2000ede
Normal user
Posts: 22
Joined: 12 Dec 2023, 16:43

Re: rules: send a message to an external web address

#3 Post by 2000ede » 13 Dec 2023, 21:15

Thanks!
I did not know. Even though I haven't worked with ThingSpeak yet, I'll try it.

2000ede
Normal user
Posts: 22
Joined: 12 Dec 2023, 16:43

Re: rules: send a message to an external web address

#4 Post by 2000ede » 13 Dec 2023, 21:26

As a beginner, I find it really unfortunate that https is not supported. With an ESP32 it shouldn't be a problem. This would be a great way to use data from the web (including weather data, etc.). But ok, I don't have enough knowledge.

In my opinion, Telegram would http command is enough (without s).

Maybe the easiest thing is to run another ESP that does this (without ESP Easy).
ESP easy -> ESP - > https -> Telegram, google sheets or....

Actually, I just want to have values ​​from the Internet as variables in ESP Easy, which I can display on a TFT screen.
With the current task I would like to encourage the other side to start a google script, which sends the data to the ESP Easy.

I still need to learn more to understand it. Thanks for the support!
chromo23 wrote: 13 Dec 2023, 21:06
Edit:
The problem with telegram is the S in HTTPS.
Not supported by ESPEasy yet...

User avatar
chromo23
Normal user
Posts: 827
Joined: 10 Sep 2020, 16:02
Location: germany

Re: rules: send a message to an external web address

#5 Post by chromo23 » 13 Dec 2023, 22:00

for getting data from openweather or thingspeak i can provide you with an custom build of espeasy...
see also here: https://github.com/letscontrolit/ESPEasy/pull/4856

2000ede
Normal user
Posts: 22
Joined: 12 Dec 2023, 16:43

Re: rules: send a message to an external web address

#6 Post by 2000ede » 13 Dec 2023, 22:13

Thanks for your support!

Why can you send to "thinkspeak" but not to http telegram directly (not s).
Or did I not understand it correctly?

User avatar
chromo23
Normal user
Posts: 827
Joined: 10 Sep 2020, 16:02
Location: germany

Re: rules: send a message to an external web address

#7 Post by chromo23 » 13 Dec 2023, 22:19

2000ede wrote: 13 Dec 2023, 22:13 Why can you send to "thinkspeak" but not to http telegram directly (not s).
There is only https for telegram....
If you past the link you posted into a browser you´ll see, that it redirects to https....

User avatar
Ath
Normal user
Posts: 3520
Joined: 10 Jun 2018, 12:06
Location: NL

Re: rules: send a message to an external web address

#8 Post by Ath » 13 Dec 2023, 22:26

2000ede wrote: 13 Dec 2023, 22:13 Thanks for your support!

Why can you send to "thinkspeak" but not to http telegram directly (not s).
Or did I not understand it correctly?
As said before, HTTPS requires a secure connection, based on certificates, that require quite some resources on the client side (ESPEasy). That, combined with ESPEasy has proven to be unusable on an ESP8266, but will probably be feasible on an ESP32.
Work on secured connections is a work in progress, with the first part being MQTT with TLS (transport layer security) support in PR #3788, but there are still some stability issues with the used TLS libraries. Later, when this is more stable, also HTTPS, using the same TLS library, is planned to be supported.
/Ton (PayPal.me)

2000ede
Normal user
Posts: 22
Joined: 12 Dec 2023, 16:43

Re: rules: send a message to an external web address

#9 Post by 2000ede » 13 Dec 2023, 22:29

oh, sorry,

You're right, even though I typed http, the browser turns it into https
mea culpa
chromo23 wrote: 13 Dec 2023, 22:19
2000ede wrote: 13 Dec 2023, 22:13 Why can you send to "thinkspeak" but not to http telegram directly (not s).
There is only https for telegram....
If you past the link you posted into a browser you´ll see, that it redirects to https....

2000ede
Normal user
Posts: 22
Joined: 12 Dec 2023, 16:43

Re: rules: send a message to an external web address

#10 Post by 2000ede » 13 Dec 2023, 22:31

ok, thanks.

Thank you again for your understanding of my questions.
Ath wrote: 13 Dec 2023, 22:26
2000ede wrote: 13 Dec 2023, 22:13 Thanks for your support!

Why can you send to "thinkspeak" but not to http telegram directly (not s).
Or did I not understand it correctly?
As said before, HTTPS requires a secure connection, based on certificates, that require quite some resources on the client side (ESPEasy). That, combined with ESPEasy has proven to be unusable on an ESP8266, but will probably be feasible on an ESP32.
Work on secured connections is a work in progress, with the first part being MQTT with TLS (transport layer security) support in PR #3788, but there are still some stability issues with the used TLS libraries. Later, when this is more stable, also HTTPS, using the same TLS library, is planned to be supported.

Post Reply

Who is online

Users browsing this forum: No registered users and 31 guests