Rules Global Sync

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
overdrive
New user
Posts: 8
Joined: 31 Aug 2016, 13:35

Rules Global Sync

#1 Post by overdrive » 11 Sep 2016, 18:20

Hi,
i want to use the Value form ESPDevice1 in a rule on ESPDevice2.
I set it up and it is working.

But one problem is left, how can i check with a rule in the ESPDevice2, if the ESPDevice1 are still online?

Because without this check, i can't be sure if the value i get from ESPDevice1 is an actuelle value.

Maybe someone can help.

Martinus

Re: Rules Global Sync

#2 Post by Martinus » 13 Sep 2016, 20:40

When data from a remote ESP is received, it will also create an event for the rules engine. I think you could start a timer, set to a value larger than the send frequency of the remote ESP. This timer will be restarted each time the event is received. So normally, it should never reach 0 and fire.

If the timer finished, it means that it was not reset within the specified time window. Meaning that the remote ESP likely had an issue..

Sample that you could try out:
ESP1 has an analog sensor with global sync, taskname "Analog" taskvaluename "Analog".
ESP1 sends data every 5 seconds.
ESP2 receives this through globalsync

Rule on ESP2:

Code: Select all

on Analog#Analog do
  timerSet 1,10 // (re)start timer for 10 seconds
endon

on Rules#Timer=1 do
  help // something wrong, of course the 'help' command is fictitious
endon
But then the next challenge: What to do when this situation occurs...

overdrive
New user
Posts: 8
Joined: 31 Aug 2016, 13:35

Re: Rules Global Sync

#3 Post by overdrive » 14 Sep 2016, 08:50

Thank you.
It`s funny, yesterday when i was on the way home, i also thought about a timer rule on message receive.

I will try if it works.
For me it is clear what to do. If timer is 1 the relay which switch on something is not allowed to switch on.

overdrive
New user
Posts: 8
Joined: 31 Aug 2016, 13:35

Re: Rules Global Sync

#4 Post by overdrive » 14 Sep 2016, 12:52

It works.
If the timer is 1 i switch of a relay and switch on a status LED.

Thanks

Post Reply

Who is online

Users browsing this forum: No registered users and 10 guests