Random use with all LEDs on the same color

  • Hi,
    I'm trying to create a bash script that turns to a random color my ambilight, for a random period between 0 & 2 seconds, using hyperion-remote.


    Unfortunately, when I use for example:
    hyperion-remote -p 49 -d 2000 -R 255 -G 5 -B 25
    or
    hyperion-remote -p 49 -d 2000 -R 255 5 25
    or
    hyperion-remote -p 49 -d 2000 -R 255 -G 005 -B 025
    or
    hyperion-remote -p 49 -d 2000 -R255 -G5 -B25
    I receive this error message:
    -R: Argument 255 can not be parsed to 3 integer values


    This works:
    hyperion-remote -p 49 -d 2000 -c 1189ff
    but I don't know how to obtain a random variable between 0 and FFFFFF...that's why I try to use -R -G -B because I found how to generate random number:
    let "red = $[ ( $RANDOM % 255 ) + 1 ]"
    let "green = $[ ( $RANDOM % 255 ) + 1 ]"
    let "blue = $[ ( $RANDOM % 255 ) + 1 ]"


    Any idea please?

  • Full disclosure, I'm Not coder. (Carpenter by trade) However I like to explore and this peeked my curiosity a bit. And a wile back I was researching some led stuff and I came upon a web page that may have what your looking for. Lucky for you I bookmarked the site =)


    http://thisinterestsme.com/random-rgb-hex-color-php/


    hope its of help.

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!