Blocky One Time Only

Post Reply
Andree
Posts: 75
Joined: Wednesday 07 June 2017 11:19
Target OS: Windows
Domoticz version:
Contact:

Blocky One Time Only

Post by Andree » Monday 17 July 2017 17:44

Hi to all,
i want to set an event for notify me when time to work is over 30 minutes.
i have made this blocky and work fine but at every time the script "time to work" run and the result is over 30 minutes i receive a notification!
how can i set "IF time to work > 30" from 7:30 to 8:30 send ONLY ONE TIME a notifications...." ?
Thx!
Traffic.JPG
Traffic.JPG (36.53 KiB) Viewed 610 times

pvm
Posts: 920
Joined: Tuesday 17 June 2014 22:14
Target OS: NAS (Synology & others)
Domoticz version: Stable
Location: NL
Contact:

Re: Blocky One Time Only

Post by pvm » Monday 17 July 2017 18:12

Can you use a user variable or dummy switch to monitor whether you've already send the message
Synology NAS, PI3, ZWave, Xiamo zigbee devices, BTLE plant sensor

tozzke
Posts: 123
Joined: Friday 02 January 2015 10:22
Target OS: Raspberry Pi
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Blocky One Time Only

Post by tozzke » Monday 17 July 2017 18:17

add a variable (in this case a string variable with the value 'no') in the if-statement as well as in the output.
Something like:

Code: Select all

If [your if now] and [[var time_to_work_notification_sent?] = ["no"]]
Do [Set [var time_to_work_notification_sent?] = ["yes"]]
   [Send notification...]
Else if [Time > 9:00] and [var time_to_work_notification_sent?] = ["yes"]
Do [Set [var time_to_work_notification_sent?] = ["no"]]
This way the notification wil only be sent once because the if-statement is no longer true after it triggers

Andree
Posts: 75
Joined: Wednesday 07 June 2017 11:19
Target OS: Windows
Domoticz version:
Contact:

Blocky One Time Only

Post by Andree » Monday 17 July 2017 18:18

pvm wrote:Can you use a user variable or dummy switch to monitor whether you've already send the message
Can you explain how can i use user variables for this target?

Andree
Posts: 75
Joined: Wednesday 07 June 2017 11:19
Target OS: Windows
Domoticz version:
Contact:

Re: Blocky One Time Only

Post by Andree » Monday 17 July 2017 18:23

tozzke wrote:add a variable (in this case a string variable with the value 'no') in the if-statement as well as in the output.
Something like:

Code: Select all

If [your if now] and [[var time_to_work_notification_sent?] = ["no"]]
Do [Set [var time_to_work_notification_sent?] = ["yes"]]
   [Send notification...]
Else if [Time > 9:00] and [var time_to_work_notification_sent?] = ["yes"]
Do [Set [var time_to_work_notification_sent?] = ["no"]]
This way the notification wil only be sent once because the if-statement is no longer true after it triggers

Thx! I can try when arrive at home !

Andree
Posts: 75
Joined: Wednesday 07 June 2017 11:19
Target OS: Windows
Domoticz version:
Contact:

Re: Blocky One Time Only

Post by Andree » Tuesday 18 July 2017 18:47

Thx work perfectly!

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests