I use OpenBeken to control the opening of my roller shutters. I use the NTP driver to, among other things, retrieve the sunset and sunrise times and I would like to add a random delay to it.
Example: setChannel 10 $sunset+1800
I would like to replace 1800 with a variable like $RANDOM.
Which could give this if $RANDOM can be bounded.
setChannel 10 $sunset+$RANDOM
If the content of $RANDOM is a real number between 0 and 1 as is often the case, does the modulo operator exist ?
Which could give this for a random delay between 0 and 15 minutes :
setChannel 10 $sunset+($RANDOM*1000%15)*60
Example: setChannel 10 $sunset+1800
I would like to replace 1800 with a variable like $RANDOM.
Which could give this if $RANDOM can be bounded.
setChannel 10 $sunset+$RANDOM
If the content of $RANDOM is a real number between 0 and 1 as is often the case, does the modulo operator exist ?
Which could give this for a random delay between 0 and 15 minutes :
setChannel 10 $sunset+($RANDOM*1000%15)*60