Hi
No surprise here, yet another Rules question...
(Will someone please just charge me € for doing these?)
With the ability to scene set DMX & SPi universe', I just can't resist trying to get OpenRemote to (slowly) fire off commands to create a simple random chase.
I found this :-
import java.util.Random;
public class RandomNumber {
private int randomNumber;
public void begin() {
this.randomNumber = new Random().nextInt( 100 );
}
public void setValue(final int value) {
this.randomNumber = value;
}
public int getValue() {
return this.randomNumber;
}
}
And I'm wondering how best to use it to create a 6 digit HEX RGB string.
I can easily obtain an interval timer in Velbus, so triggering a rule is straight forward.
(Following is just a thought, not a working rule)
Rule "Random Chase"
When
Sensor "Interval Timer" value == "on"
Then
public class RandomNumber {
private int randomNumber;
public void begin() {
this.randomNumber = new Random().nextInt( 255 );
}
public void setValue(final int value) {
this.randomNumber = value;
}
public int getValue() {
return this.randomNumber;
}
}
[Something to turn the number into a HEX string]
Then
Execute.command ("RGB_Uni0", $HEX)
End