Announcement

Collapse
No announcement yet.

Random colour?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Random colour?

    Is it possible to set a light / group to a random colour? I currently use a python script for this, and I'd like to move the functionality to HS3 + JowiHue. My python script just sets the hue for the group to a random number between 0 and 65535, so doesn't have to be fancier than that

    #2
    Fluffypony,

    I am just jumping in shortly so I do not have time to work out a real sample. But check the docs of the JowiHue plugin.It should be in the docs directory at your homeseer installation. You will find a PDF wit all possibilities of the plugin, including scripting (vb.net scripting).
    This might put you on track?

    Eventually I can get you a sample to randomize the hue setting later.

    Thanks

    Wim
    -- Wim

    Plugins:RFXCOM, HSTouch Server, Squeezebox, BLGData, Restart, Jon00's Perfmon and Network monitor, WeatherXML, BLBackup, TenScripting, BC4, Pushover, PHLocation, JowiHue, Zwave, Sonos
    650 devices ---- 336 events ----- 40 scripts

    Comment


      #3
      I really should try reading the documentation more often Thanks for pointing me in that direction, I'll take a look at it later today!

      Comment


        #4
        For anyone that comes across this in future, this is the script I wrote to handle this:


        Code:
        Sub Main(ByVal Parm As Object)
        Dim staticRandomGenerator As New System.Random
        
        Dim i As Integer = staticRandomGenerator.Next(0, 65535)
        
        If hs.PluginFunction("JowiHue", "", "SetLightsHueSat", {True, "GROUP NAME", Nothing, i, Nothing, 100}) Then
        	hs.WriteLog("HueScript", "GROUP colour successfully changed")
        Else
        	hs.WriteLog("HueScript", "GROUP colour failed to change, check log for details")
        End If
        
        End Sub

        Comment

        Working...
        X