help rule

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
novembre62
Normal user
Posts: 30
Joined: 10 May 2019, 15:39
Location: italy

help rule

#1 Post by novembre62 » 02 Jan 2021, 14:45

hi, i would like a rule on pulse counter
..when the Count value is> of a set threshold and remains for a set time ... sends a Telegram notification.
it would be possible ?
Thanks for your help

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

Re: help rule

#2 Post by Ath » 02 Jan 2021, 15:19

Something like this?

Code: Select all

on Pulsecounter#Total do // Could also trigger on Count instead of Total
  if %eventvalue%>100 // Change 100 to desired value
    TimerSet,2,30  // Send Telegram message after 30 seconds, change duration as desired
  else
    TimerSet,2,0 // Stop timer
  endif
endon

on Rules#Timer=2 do
  SendToHTTP,url_for_telegram_api,443,'/address/and/other/stuff/with/telegram/message/total=[Pulsecounter#Total]'
endon
NB: I have not investigated how the Telegram API needs to be used, if the GET verb isn't sophisticated enough, you might meed to use the Generic HTTP Advanced controller.
/Ton (PayPal.me)

novembre62
Normal user
Posts: 30
Joined: 10 May 2019, 15:39
Location: italy

Re: help rule

#3 Post by novembre62 » 03 Jan 2021, 09:54

use

https://api.telegram.org/botxxxxxxxx/se ... t_id=xxxxx
& text = xxxxx

for telegram notifications, but on espeasy it doesn't work

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

Re: help rule

#4 Post by Ath » 03 Jan 2021, 10:14

Do you have any log results from both ESPEasy and Telegram?
The link you provided complaints that field "description" is missing, so you probably need to adjust that.
/Ton (PayPal.me)

chemmex
Normal user
Posts: 92
Joined: 15 Feb 2019, 16:18

Re: help rule

#5 Post by chemmex » 03 Jan 2021, 12:46

First of all, there's https in the url, so no chance to send it that way

TD-er
Core team member
Posts: 8643
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: help rule

#6 Post by TD-er » 03 Jan 2021, 14:20

Yep the same for the sendtohttp call, which is using port 443 (HTTPS)

novembre62
Normal user
Posts: 30
Joined: 10 May 2019, 15:39
Location: italy

Re: help rule

#7 Post by novembre62 » 03 Jan 2021, 16:43

Ath wrote: 03 Jan 2021, 10:14 Do you have any log results from both ESPEasy and Telegram?
The link you provided complaints that field "description" is missing, so you probably need to adjust that.
the link from the browser works fine ..

thanks for the help, I will try other solutions

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot] and 20 guests