Execute event only once for a day

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

Execute event only once for a day

Post by advokatb » Monday 07 May 2018 11:49

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 536 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: 1367
Joined: Tuesday 30 December 2014 20:25
Target OS: Raspberry Pi
Domoticz version: Stable
Location: Westland/Netherlands
Contact:

Re: Execute event only once for a day

Post by jvdz » 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

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

Re: Execute event only once for a day

Post by advokatb » Wednesday 09 May 2018 10:04

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: Prutsium and 2 guests