Page 1 of 1

Let script only send telegram message once

Posted: Monday 26 October 2020 9:56
by Mrblomme
I've made a script that sends me a message when the humidity in one of my rooms is too high.
The problem I'm having is that I'm now recieving a message every minute...

How do I manage to send me to only send 1 message? I will change the script so I get 1 when it's too high and one when its back ok..
humidity c&a.JPG
humidity c&a.JPG (45.84 KiB) Viewed 532 times

Re: Let script only send telegram message once

Posted: Monday 26 October 2020 10:19
by jvdz
This would require some LUA/DzEvents scripting. I would either use an extra UserVariable or Persistent variable.
Then when the "Luchtvochtigheid" gets above 70, Check voor de value of the UserVariable and when it isn't 1, Send the Telegram message and set the UserVarible to 1.
When the "Luchtvochtigheid" gets below 70, reset the UserVariable back to 0, so the next time it gets above 70, the same process is triggered.

Jos

Re: Let script only send telegram message once

Posted: Monday 26 October 2020 10:48
by Sergio0348
Hello
Be careful if you are using the latest release there may be a bug with Telegram. Since I applied it, my Telegram messages no longer work and it's the same with the test button in the settings.
Serge

Re: Let script only send telegram message once

Posted: Monday 26 October 2020 10:48
by Sergio0348
Hello
Be careful if you are using the latest release there may be a bug with Telegram. Since I applied it, my Telegram messages no longer work and it's the same with the test button in the settings. :o
Serge

Re: Let script only send telegram message once

Posted: Monday 26 October 2020 10:56
by jvdz
@Sergio0348, Don't think reporting an issue is relevant to the question, as clearly Telegram is working for the OP, but which version are you using?

EDIT: Just tested the latest Beta and Telegram is working fine! Also the test button.

Jos

Re: Let script only send telegram message once

Posted: Monday 26 October 2020 13:36
by Mrblomme
So far so good!
vochtigheidok.JPG
vochtigheidok.JPG (123.16 KiB) Viewed 507 times