Let script only send telegram message once

Moderator: leecollings

Post Reply
Mrblomme
Posts: 15
Joined: Friday 09 October 2020 9:05
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Let script only send telegram message once

Post 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 534 times
User avatar
jvdz
Posts: 2189
Joined: Tuesday 30 December 2014 19:25
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.107
Location: Netherlands
Contact:

Re: Let script only send telegram message once

Post 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
New Garbage collection scripts: https://github.com/jvanderzande/GarbageCalendar
Sergio0348
Posts: 2
Joined: Monday 26 October 2020 10:33
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Let script only send telegram message once

Post 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
Sergio0348
Posts: 2
Joined: Monday 26 October 2020 10:33
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Let script only send telegram message once

Post 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
User avatar
jvdz
Posts: 2189
Joined: Tuesday 30 December 2014 19:25
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.107
Location: Netherlands
Contact:

Re: Let script only send telegram message once

Post 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
New Garbage collection scripts: https://github.com/jvanderzande/GarbageCalendar
Mrblomme
Posts: 15
Joined: Friday 09 October 2020 9:05
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Let script only send telegram message once

Post by Mrblomme »

So far so good!
vochtigheidok.JPG
vochtigheidok.JPG (123.16 KiB) Viewed 509 times
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests