Announcement

Collapse
No announcement yet.

Setting RGBW value directly with a script?

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

    Setting RGBW value directly with a script?

    I want to update the "mood lights" (using Fibaro RGBW modules and LED strips) in various rooms, and for that I'd like to set a color directly.

    This can easily be achieved with the Custom Color device.



    But how can I control this device in a script? Has anybody done it?
    Or is there a custom Z-wave function for this to work?
    HSPro 3.0.0.458, Z-NET with Z-wave plugin 3.0.1.190, RFXCOM + 2x RFXtrx433E, HSTouch, Squeezebox plugin, iTach IP/WF2IR & GC-100-6 with UltraGCIR, BLDenon, NetcamStudio, Jon00s Webpage builder, Harmony Hub plugin, SCSIP (with FreePBX), Arduino plugin, IFTTT, Pushalot plugin, Device History plugin.
    Running on Windows 10 (64) virtualized
    on ESXi (Fujitsu Primergy TX150 S8).
    WinSeer (for Win10) - TextSeer - FitbitSeer - HSPI_MoskusSample

    Are you Norwegian (or Scandinavian) and getting started with HomeSeer? Read the "HomeSeer School"!

    #2
    Anybody?
    HSPro 3.0.0.458, Z-NET with Z-wave plugin 3.0.1.190, RFXCOM + 2x RFXtrx433E, HSTouch, Squeezebox plugin, iTach IP/WF2IR & GC-100-6 with UltraGCIR, BLDenon, NetcamStudio, Jon00s Webpage builder, Harmony Hub plugin, SCSIP (with FreePBX), Arduino plugin, IFTTT, Pushalot plugin, Device History plugin.
    Running on Windows 10 (64) virtualized
    on ESXi (Fujitsu Primergy TX150 S8).
    WinSeer (for Win10) - TextSeer - FitbitSeer - HSPI_MoskusSample

    Are you Norwegian (or Scandinavian) and getting started with HomeSeer? Read the "HomeSeer School"!

    Comment


      #3
      A CAPI command to the child devices should work. Take a look at Tenholde's tenScriptAid utility (http://board.homeseer.com/showthread.php?t=177761) as it should help out the proper CAPI command to use.

      Cheers
      Al
      HS 4.2.8.0: 2134 Devices 1252 Events
      Z-Wave 3.0.10.0: 133 Nodes on one Z-Net

      Comment


        #4
        Originally posted by sparkman View Post
        A CAPI command to the child devices should work.
        Yes, it SHOULD. But it doesn't.

        But I'll give tenScriptAid a try.
        HSPro 3.0.0.458, Z-NET with Z-wave plugin 3.0.1.190, RFXCOM + 2x RFXtrx433E, HSTouch, Squeezebox plugin, iTach IP/WF2IR & GC-100-6 with UltraGCIR, BLDenon, NetcamStudio, Jon00s Webpage builder, Harmony Hub plugin, SCSIP (with FreePBX), Arduino plugin, IFTTT, Pushalot plugin, Device History plugin.
        Running on Windows 10 (64) virtualized
        on ESXi (Fujitsu Primergy TX150 S8).
        WinSeer (for Win10) - TextSeer - FitbitSeer - HSPI_MoskusSample

        Are you Norwegian (or Scandinavian) and getting started with HomeSeer? Read the "HomeSeer School"!

        Comment


          #5
          The custom color device you showed is quiet a complicated input tool to replace since it uses so many different methodes for setting the color. I see things like a color picker, RGB values, HSV values, preset colors and HEX values.
          My first question would be, do you need all those options?
          Next you have to do a conversion (if needed) from your input to the values the mood light expects.

          I don't know enough of the Fibaro RGBW modules you uses to say anything more sensible about this. For instance are they controled by RGB or HSV would be a good question
          - Bram

          Send from my Commodore VIC-20

          Ashai_Rey____________________________________________________________ ________________
          HS3 Pro 3.0.0.534
          PIugins: ZMC audio | ZMC VR | ZMC IR | ZMC NDS | RFXcom | AZ scripts | Jon00 Scripts | BLBackup | FritzBox | Z-Wave | mcsMQTT | AK Ikea

          Comment


            #6
            I don't need all the options displayed, as most are overlapping.

            What I want is to specify a color in HEX, say #FF0000 for red, convert it to Integer, and find the appropriate CAPI control. But so far, that hasn't worked.
            HSPro 3.0.0.458, Z-NET with Z-wave plugin 3.0.1.190, RFXCOM + 2x RFXtrx433E, HSTouch, Squeezebox plugin, iTach IP/WF2IR & GC-100-6 with UltraGCIR, BLDenon, NetcamStudio, Jon00s Webpage builder, Harmony Hub plugin, SCSIP (with FreePBX), Arduino plugin, IFTTT, Pushalot plugin, Device History plugin.
            Running on Windows 10 (64) virtualized
            on ESXi (Fujitsu Primergy TX150 S8).
            WinSeer (for Win10) - TextSeer - FitbitSeer - HSPI_MoskusSample

            Are you Norwegian (or Scandinavian) and getting started with HomeSeer? Read the "HomeSeer School"!

            Comment


              #7
              Can you post a screen shot of the Status Graphics tab from the device?
              HS 4.2.8.0: 2134 Devices 1252 Events
              Z-Wave 3.0.10.0: 133 Nodes on one Z-Net

              Comment


                #8
                Also, try using the setdevicevaluebyref function. I've seen a few devices for which it works rather than capi (my thermostat I think).
                HS 4.2.8.0: 2134 Devices 1252 Events
                Z-Wave 3.0.10.0: 133 Nodes on one Z-Net

                Comment


                  #9
                  I've tried that too, but not lately. Will try again tonight.

                  Here's the values:
                  HSPro 3.0.0.458, Z-NET with Z-wave plugin 3.0.1.190, RFXCOM + 2x RFXtrx433E, HSTouch, Squeezebox plugin, iTach IP/WF2IR & GC-100-6 with UltraGCIR, BLDenon, NetcamStudio, Jon00s Webpage builder, Harmony Hub plugin, SCSIP (with FreePBX), Arduino plugin, IFTTT, Pushalot plugin, Device History plugin.
                  Running on Windows 10 (64) virtualized
                  on ESXi (Fujitsu Primergy TX150 S8).
                  WinSeer (for Win10) - TextSeer - FitbitSeer - HSPI_MoskusSample

                  Are you Norwegian (or Scandinavian) and getting started with HomeSeer? Read the "HomeSeer School"!

                  Comment


                    #10
                    I've just been playing around with tenscripting and tenscriptaid and found that you can set a custom colour by setting the R,G, and B values independently, which is all that the custom colour dialogue does, but in one action.

                    This script works for me

                    Code:
                    Imports System.Text.RegularExpressions
                    
                    
                        Public Sub Main(ByVal Parms As Object)
                    
                            Dim cc As HomeSeerAPI.CAPI.CAPIControl = hs.CAPIGetSingleControl(1069, True, "Red Level (value)", False, False)
                            cc.ControlValue = 144
                            Dim cr As HomeSeerAPI.CAPI.CAPIControlResponse = hs.CAPIControlHandler(cc)
                    
                            Dim cd As HomeSeerAPI.CAPI.CAPIControl = hs.CAPIGetSingleControl(1070, True, "Green Level (value)", False, False)
                            cd.ControlValue = 247
                            Dim cs As HomeSeerAPI.CAPI.CAPIControlResponse = hs.CAPIControlHandler(cd)
                    
                            Dim ce As HomeSeerAPI.CAPI.CAPIControl = hs.CAPIGetSingleControl(1071, True, "Blue Level (value)", False, False)
                            ce.ControlValue = 10
                            Dim ct As HomeSeerAPI.CAPI.CAPIControlResponse = hs.CAPIControlHandler(ce)
                        End Sub
                    Obviously you set the R,G and B ControlValues to give the colour that you want.

                    (Trying to use CustomColour from TenScriptAid locks it up.)

                    Comment


                      #11
                      A little educated guess here but when you convert the hex value to a decimal value and enter that as value into the device will it work?
                      My guess will be a value for RED will be 16711680, Green = 65280 and Blue 255
                      - Bram

                      Send from my Commodore VIC-20

                      Ashai_Rey____________________________________________________________ ________________
                      HS3 Pro 3.0.0.534
                      PIugins: ZMC audio | ZMC VR | ZMC IR | ZMC NDS | RFXcom | AZ scripts | Jon00 Scripts | BLBackup | FritzBox | Z-Wave | mcsMQTT | AK Ikea

                      Comment


                        #12
                        AIUI the custom colour value is just the three sequential bytes of the three colour controls, the first byte is red, second byte green and third blue. Each colour value has a range of 0-255.

                        Hence full red would be FF0000, green would be 00FF00, etc.

                        Using the capi control for each individual colour you can either use Switch Mulilevel and use a dim value of 1-98%, or use Color Control with a value between 1 and 254, just different ways of doing the same thing.

                        Comment


                          #13
                          Originally posted by billt View Post
                          I've just been playing around with tenscripting and tenscriptaid and found that you can set a custom colour by setting the R,G, and B values independently, which is all that the custom colour dialogue does, but in one action.

                          This script works for me

                          Code:
                          Imports System.Text.RegularExpressions
                          
                          
                              Public Sub Main(ByVal Parms As Object)
                          
                                  Dim cc As HomeSeerAPI.CAPI.CAPIControl = hs.CAPIGetSingleControl(1069, True, "Red Level (value)", False, False)
                                  cc.ControlValue = 144
                                  Dim cr As HomeSeerAPI.CAPI.CAPIControlResponse = hs.CAPIControlHandler(cc)
                          
                                  Dim cd As HomeSeerAPI.CAPI.CAPIControl = hs.CAPIGetSingleControl(1070, True, "Green Level (value)", False, False)
                                  cd.ControlValue = 247
                                  Dim cs As HomeSeerAPI.CAPI.CAPIControlResponse = hs.CAPIControlHandler(cd)
                          
                                  Dim ce As HomeSeerAPI.CAPI.CAPIControl = hs.CAPIGetSingleControl(1071, True, "Blue Level (value)", False, False)
                                  ce.ControlValue = 10
                                  Dim ct As HomeSeerAPI.CAPI.CAPIControlResponse = hs.CAPIControlHandler(ce)
                              End Sub
                          Obviously you set the R,G and B ControlValues to give the colour that you want.

                          (Trying to use CustomColour from TenScriptAid locks it up.)
                          This is very similar to what I do now. Sadly, you'll just set three different colors, so the different colors will flash.

                          First it will set the red, turning the room red, then yellow (because of green) and then whiter (because of blue).

                          I want smooth transittions, and that can be achieved with the Color Picker, but I can't control it with a script.
                          HSPro 3.0.0.458, Z-NET with Z-wave plugin 3.0.1.190, RFXCOM + 2x RFXtrx433E, HSTouch, Squeezebox plugin, iTach IP/WF2IR & GC-100-6 with UltraGCIR, BLDenon, NetcamStudio, Jon00s Webpage builder, Harmony Hub plugin, SCSIP (with FreePBX), Arduino plugin, IFTTT, Pushalot plugin, Device History plugin.
                          Running on Windows 10 (64) virtualized
                          on ESXi (Fujitsu Primergy TX150 S8).
                          WinSeer (for Win10) - TextSeer - FitbitSeer - HSPI_MoskusSample

                          Are you Norwegian (or Scandinavian) and getting started with HomeSeer? Read the "HomeSeer School"!

                          Comment


                            #14
                            If you want smooth transitions then you will have a hard time using RGB. Using HSV is much better for this because it takes brightness also in account.
                            RGB example:
                            Red is 100% ON and you want to go to 100% green then you have to lower red a x amount. The red LED gives 100% light and then the green led will add to this brightness. But the scale isn't lineair. Steps in brightness are larger at the lowest end then the upper end. Also you have to take in account the added brightness of the other LED(s) of the RGB spot. So using HSV is the way to go in this case. However it isn't possible to convert all RGB directly to HSV values. Some averages values will be taken in account for this. Anyway, that is not a real problem.

                            I have some code for the Arduino that does just that. It may be helpful as an example?
                            - Bram

                            Send from my Commodore VIC-20

                            Ashai_Rey____________________________________________________________ ________________
                            HS3 Pro 3.0.0.534
                            PIugins: ZMC audio | ZMC VR | ZMC IR | ZMC NDS | RFXcom | AZ scripts | Jon00 Scripts | BLBackup | FritzBox | Z-Wave | mcsMQTT | AK Ikea

                            Comment


                              #15
                              Originally posted by AshaiRey View Post
                              If you want smooth transitions then you will have a hard time using RGB. Using HSV is much better for this because it takes brightness also in account.
                              RGB example:
                              Red is 100% ON and you want to go to 100% green then you have to lower red a x amount. The red LED gives 100% light and then the green led will add to this brightness. But the scale isn't lineair. Steps in brightness are larger at the lowest end then the upper end. Also you have to take in account the added brightness of the other LED(s) of the RGB spot. So using HSV is the way to go in this case. However it isn't possible to convert all RGB directly to HSV values. Some averages values will be taken in account for this. Anyway, that is not a real problem.

                              I have some code for the Arduino that does just that. It may be helpful as an example?
                              "Smooth transitions" is perhaps the wrong phrase. I want it "smoother than using three separate devices that are updated sequentially".


                              But code is always fun!
                              HSPro 3.0.0.458, Z-NET with Z-wave plugin 3.0.1.190, RFXCOM + 2x RFXtrx433E, HSTouch, Squeezebox plugin, iTach IP/WF2IR & GC-100-6 with UltraGCIR, BLDenon, NetcamStudio, Jon00s Webpage builder, Harmony Hub plugin, SCSIP (with FreePBX), Arduino plugin, IFTTT, Pushalot plugin, Device History plugin.
                              Running on Windows 10 (64) virtualized
                              on ESXi (Fujitsu Primergy TX150 S8).
                              WinSeer (for Win10) - TextSeer - FitbitSeer - HSPI_MoskusSample

                              Are you Norwegian (or Scandinavian) and getting started with HomeSeer? Read the "HomeSeer School"!

                              Comment

                              Working...
                              X