Announcement

Collapse
No announcement yet.

script?

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

    script?

    Has anyone had any luck integrating this into a script? I would simply like to change the color with a script but thus far have not figured it out.

    #2
    There is a Philips Hue API that uses JSON via HTTP commands.

    Here is a link to get you started:

    https://developers.meethue.com/develop/get-started-2/

    Comment


      #3
      Originally posted by ajachierno View Post
      Has anyone had any luck integrating this into a script? I would simply like to change the color with a script but thus far have not figured it out.
      Here is a C# script to change the color of a Philips hue bulb, juste replace the colorControlFeatRef value with the ref# of the color control of your bulb, and set the RGB hex code of the color you want to the color variable.

      Code:
      public object Main(object[] parms)
      {
         int colorControlFeatRef = 1839;
         string color = "001199";
      
         CAPI.CAPIControl[] controls = hs.CAPIGetControlEx(colorControlFeatRef, true);
         CAPI.CAPIControl ctrl = Array.Find(controls, c => (c.ControlType == Enums.CAPIControlType.Color_Picker));
      
         if (ctrl != null)
         {
            ctrl.ControlString = color;
            if (hs.CAPIControlHandler(ctrl) != CAPI.CAPIControlResponse.All_Success)
            {
               hs.WriteLog("Script", string.Format("Problem while trying to set device {0} to {1}", colorControlFeatRef, color));
            }
         }
         else
         {
             hs.WriteLog("Script", string.Format("Can't find color picker control for device {0}", colorControlFeatRef));
         }
         return 0;
      }

      Comment


        #4
        So will something like this work with this plugin?

        [CODESub Main(ByVal Params As Object)

        Dim s As Double = hs.DeviceValueEx(1994)

        if s =2 then
        hs.PluginFunction("JowiHue", "", "SetLightsHueSat", {False, "WestLeft", 255, 1310, 255, 10})

        elseif s =3 then
        hs.PluginFunction("JowiHue", "", "SetLightsHueSat", {False, "WestLeft", 255, 1965, 255, 10})

        ​][/CODE]

        If not are there any examples of script calls for this plugin?

        Thanks,
        Tim
        FB Page - https://www.facebook.com/pages/Capt-Tim/209398425902188

        HSTouch Layouts - https://www.facebook.com/media/set/?...5902188&type=3

        Comment


          #5
          Originally posted by fungun View Post
          So will something like this work with this plugin?

          [CODESub Main(ByVal Params As Object)

          Dim s As Double = hs.DeviceValueEx(1994)

          if s =2 then
          hs.PluginFunction("JowiHue", "", "SetLightsHueSat", {False, "WestLeft", 255, 1310, 255, 10})

          elseif s =3 then
          hs.PluginFunction("JowiHue", "", "SetLightsHueSat", {False, "WestLeft", 255, 1965, 255, 10})

          ​][/CODE]

          If not are there any examples of script calls for this plugin?

          Thanks,
          Tim
          Suggest you post in the Jowi Hue forum.....
          Jon

          Comment


            #6
            Originally posted by fungun View Post
            So will something like this work with this plugin?

            [CODESub Main(ByVal Params As Object)

            Dim s As Double = hs.DeviceValueEx(1994)

            if s =2 then
            hs.PluginFunction("JowiHue", "", "SetLightsHueSat", {False, "WestLeft", 255, 1310, 255, 10})

            elseif s =3 then
            hs.PluginFunction("JowiHue", "", "SetLightsHueSat", {False, "WestLeft", 255, 1965, 255, 10})

            ​][/CODE]

            If not are there any examples of script calls for this plugin?

            Thanks,
            Tim
            As Jon wrote, you have used scripting calls for the JowiHue plugin. This forum is for the HomeSeer Hue plugin. The help file for JowiHue has all the scripting calls.


            Click image for larger version

Name:	31DAA666-527A-4DD0-AF18-830C5F70FA55.jpg
Views:	90
Size:	52.3 KB
ID:	1575830
            Click image for larger version  Name:	66218627-8E8F-4878-8497-50D23CE8E06E.jpg Views:	0 Size:	50.6 KB ID:	1575829
            HS4 Pro, 4.2.19.16 Windows 10 pro, Supermicro LP Xeon

            Comment


              #7
              As Jon wrote, you have used scripting calls for the JowiHue plugin. This forum is for the HomeSeer Hue plugin. The help file for JowiHue has all the scripting calls.
              I do realize that, but was wondering if this plugin has scripting calls similar to the JowiHue plugin. Since I haven't seen any documentation on the HS Hue plugin.

              Thanks,
              Tim
              FB Page - https://www.facebook.com/pages/Capt-Tim/209398425902188

              HSTouch Layouts - https://www.facebook.com/media/set/?...5902188&type=3

              Comment


                #8
                Originally posted by fungun View Post
                I do realize that, but was wondering if this plugin has scripting calls similar to the JowiHue plugin. Since I haven't seen any documentation on the HS Hue plugin.

                Thanks,
                Tim
                Got it! I use Wim’s HS4 JowiHue plug-in, after having used his HS3 version for years. It is worth a look.

                Here is an animation we still use for Christmas. The driveway path lights and the garage sconces are running a JowiHue animation. It works reliably every year.


                HS4 Pro, 4.2.19.16 Windows 10 pro, Supermicro LP Xeon

                Comment


                  #9
                  Yup, I went back to JowiHue.

                  Thanks,
                  Tim
                  FB Page - https://www.facebook.com/pages/Capt-Tim/209398425902188

                  HSTouch Layouts - https://www.facebook.com/media/set/?...5902188&type=3

                  Comment

                  Working...
                  X