Execute event only once for a day

Moderator: leecollings

Post Reply
User avatar
advokatb
Posts: 3
Joined: Monday 19 March 2018 19:22
Target OS: Windows
Domoticz version: beta
Location: Ukraine
Contact:

Execute event only once for a day

Post by advokatb »

Hi. I've created event that tells me by Telegram message when my wife comes home from work.

Here it is:
domiticz_wife_home.PNG
domiticz_wife_home.PNG (23.87 KiB) Viewed 1169 times
So I check with Alive_Ping her phone in home's wi-fi network, and if this time is between 17:30 and 19:00 then I recieve Telegram's message.
Also Xiaomi Gateway tells me this by voice.

The problem is that if my wife's phone lose wi-fi network and then finds it I recieve this messages several (~10) times till 19:00.
How can I learn this event stop running for today if my wife's phone was already found and I already know that she's at home.
I need to execute it for 1 time a day (till she comes home).

Thanks.
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: Execute event only once for a day

Post by jvdz »

I would normally use a uservariable for that. Simply create a uservariable and reset it to 0 each day at 17:00 with a separate blockly.
Then update the shown blockly with this logic: when the phone is detected and the uservariable is 0, you send the telegram and set the uservariable to 1.


Jos
New Garbage collection scripts: https://github.com/jvanderzande/GarbageCalendar
User avatar
advokatb
Posts: 3
Joined: Monday 19 March 2018 19:22
Target OS: Windows
Domoticz version: beta
Location: Ukraine
Contact:

Re: Execute event only once for a day

Post by advokatb »

jvdz wrote: Monday 07 May 2018 12:02 I would normally use a uservariable for that. Simply create a uservariable and reset it to 0 each day at 17:00 with a separate blockly.
Then update the shown blockly with this logic: when the phone is detected and the uservariable is 0, you send the telegram and set the uservariable to 1.


Jos
Thanks, it works!
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest