• 10 dec 2017: forum version update. In case of issues use this topic.
  • 30 nov 2017: pilight moved servers. In case of issues use this topic.
Hello There, Guest! Login Register

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
event at randomized time after another event
First of all: I love pilight, especially because of its speed and low cpu-usage. Great work.
Is it possible to start a (series of) event(s) at random times after a dusk-sensor or movement-sensor sends a signal? I can detect the sensor, but don't know how I can switch my lights after random amount of minutes.

Check the pilight wiki Smile
There is documentation for the RANDOM() function for eventing rules, that's what you are looking for.
Thanks pilino1234 for your prompt reply. Of course I have studied the manual and the wiki as well as a lot of forum posts. But I think I am missing some basic knowledge here.
I suppose I have to add a random nr of minutes by using Date_ADD(datetime, RANDOM(2,10) MINUTE) == ....
But I don't understand how I can relate this to the time of a switch.state being changed. How can I replace the .... by the time a switch.state is changed? I suppose I have to learn a lot, but I hope to learn from you guys.


"rule": "IF schemersensor.state IS on THEN switch DEVICE eettafellamp TO on AFTER RANDOM(0,3) MINUTE",

Works. Sorry for the newbie question, but no doubt : I will be back with another one.
If I understand correctly you want to turn on a light for a random amount of minutes after your motion detector sent a signal.
I'm not entirely sure if it works but try:
The FOR action in your rule, so
IF 1=1 THEN switch light TO on FOR RANDOM(2,10) MINUTE

Hmm my tapatalk didn't show me you edited post, seems you already found it

Possibly Related Threads...
Thread Author Replies Views Last Post
  puzzled by syntax when using RANDOM time Emiks5 4 1,336 03-04-2020, 10:57 PM
Last Post: Emiks5
  Always trigger event on any device state Phil 8 3,072 03-22-2017, 07:30 PM
Last Post: Phil
  datetime event again wupperpi 5 3,073 02-26-2017, 10:11 PM
Last Post: wo_rasp
  Rule executed at wrong time philipp81 1 1,189 02-25-2017, 10:43 PM
Last Post: curlymo
  [Solved ]Turn off device at random time manmetdehamer 4 2,581 07-27-2016, 03:35 PM
Last Post: manmetdehamer
  Calling URL on event couchninja 5 3,045 06-29-2016, 08:43 PM
Last Post: Niek
  Time interval between two rule checks muecke 3 2,206 04-21-2016, 02:31 PM
Last Post: pilino1234
  Triggering device at specific time or sunrise if sunrise is after OrTiN 3 2,017 03-24-2016, 11:11 PM
Last Post: OrTiN
  rules time interval kniazio 8 4,223 03-12-2016, 04:49 PM
Last Post: kniazio
  tfa sensors - event if no data were received oeiber 6 2,541 02-21-2016, 11:07 PM
Last Post: oeiber

Forum Jump:

Browsing: 1 Guest(s)