Page 1 of 1

Execute event only once for a day

Posted: Monday 07 May 2018 11:49
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 1172 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.

Re: Execute event only once for a day

Posted: Monday 07 May 2018 12:02
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

Re: Execute event only once for a day

Posted: Wednesday 09 May 2018 10:04
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!