Announcement

Collapse
No announcement yet.

IncrementLight for HS3

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

    IncrementLight for HS3

    This script will just take the current dim level for a device, and then add +1 to it. You need to call the sub Main, of course, and then use the device reference of the device you want to control as the parameter.

    Code:
        Public Sub Main(ByVal _deviceRef As Object)
            Dim deviceRef As Integer = Integer.Parse(_deviceRef)
            Dim deviceValue As Integer = hs.DeviceValue(deviceRef)
    
            'Exit if the device is already at maximum, i.e. "On"
            If hs.CAPIGetStatus(deviceRef).Status = "On" Then Exit Sub
    
            'Find the correct CAPI control to execute. I really miss Linq!!!
            For Each cc As HomeSeerAPI.CAPIControl In hs.CAPIGetControl(deviceRef)
                If cc.ControlValue = (deviceValue + 1) Then
    
                    'Set the correct dim level
                    hs.CAPIControlHandler(cc)
    
                    'We're done, so let's exit!
                    Exit Sub
                End If
            Next
        End Sub
    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
    OK, this script looks like it will do what I am trying to do, that is, soft start and soft off z-wave dimmable devices.

    I understand it is called from parameters, is it possible to set the perimeter to the dim level rather than just on or off?

    Could you post and example event?

    Thanks,
    sigpic
    A founder member of "The HA Pioneer Group" otherwise known as the "Old farts club!"

    Comment


      #3
      Originally posted by Gogs View Post
      I understand it is called from parameters, is it possible to set the perimeter to the dim level rather than just on or off?
      I'm not sure what you are asking.

      The parameter here is the device ID for the device to be controlled. It basically just adds 1 to the current devicevalue, finds the correct CAPI control, and runs that so that the command is actually executed.

      How fast the light will turn brighter is therefore just dependent on how often you execute the script. If you run it every second, it takes 1 minute and 40 seconds for a light to go from Off to On. If you run it every 18 seconds, it takes 30 minutes.
      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


        #4
        Thanks for quick reply.

        I am looking for a way to ramp X10 and z-wave to a desired level, say 60%, rather than them just coming straight on and off.

        Soft start if you like.
        sigpic
        A founder member of "The HA Pioneer Group" otherwise known as the "Old farts club!"

        Comment


          #5
          Will this script flood the zwave bus, so to speak; making all other zwave transmissions and receptions paused until it's done?
          HW: HS3 w/ Win8.1 on ASRock C2550d4i. Digi AnywhereUSB, Hubport, Edgeport, UZB, Z-trollers, PLCBUS, SONOS, GC-100, iTach IP2SL, WF2IR, IP2IR, RFXtrx433, Harmony Hubs, Hue, Ademco Vista 128BP, NetAtmo, NetAtmo Welcome

          Google Search for HomeSeer Forum

          Comment


            #6
            Originally posted by LeoS View Post
            Will this script flood the zwave bus, so to speak; making all other zwave transmissions and receptions paused until it's done?
            No, it will only send a command each XX seconds.
            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
              Originally posted by Moskus View Post
              No, it will only send a command each XX seconds.
              Good to hear that, thanks
              HW: HS3 w/ Win8.1 on ASRock C2550d4i. Digi AnywhereUSB, Hubport, Edgeport, UZB, Z-trollers, PLCBUS, SONOS, GC-100, iTach IP2SL, WF2IR, IP2IR, RFXtrx433, Harmony Hubs, Hue, Ademco Vista 128BP, NetAtmo, NetAtmo Welcome

              Google Search for HomeSeer Forum

              Comment


                #8
                Should this be able to control a BLRussound volume device? I'm trying to get this to slowly increase the volume of a Russound zone as well as a light.
                Originally posted by rprade
                There is no rhyme or reason to the anarchy a defective Z-Wave device can cause

                Comment


                  #9
                  Originally posted by S-F View Post
                  Should this be able to control a BLRussound volume device? I'm trying to get this to slowly increase the volume of a Russound zone as well as a light.
                  I have no idea. But you can check that by looking at the ValueStatus'es for the device.

                  Can you post a screenshot?
                  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
                    Originally posted by Moskus View Post
                    I have no idea. But you can check that by looking at the ValueStatus'es for the device.

                    Can you post a screenshot?

                    I thing I've found the issue. The plugin volume can only be set to even numbers. The amp has volume settings from 1 to 50. Can the script be modified to increment the device by 2 instead of 1?

                    Attached is a screenshot of the advanced tab for one of the volume devices.
                    Attached Files
                    Originally posted by rprade
                    There is no rhyme or reason to the anarchy a defective Z-Wave device can cause

                    Comment


                      #11
                      Post the next tab too (the "Status Graphics" tab), then I can see what needs to be changed.
                      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


                        #12
                        Here you go!
                        Attached Files
                        Originally posted by rprade
                        There is no rhyme or reason to the anarchy a defective Z-Wave device can cause

                        Comment


                          #13
                          OK, try this. It now stops if the value = 100, and is increasing the volume by 2 instead of 1.

                          Code:
                              Public Sub Main(ByVal _deviceRef As Object)
                                  Dim deviceRef As Integer = Integer.Parse(_deviceRef)
                                  Dim deviceValue As Integer = hs.DeviceValue(deviceRef)
                          
                                  'Exit if the device is already at maximum, i.e. Status =  "On" or Value = 100
                                  If hs.CAPIGetStatus(deviceRef).Value = 100 Then Exit Sub
                          
                                  'Find the correct CAPI control to execute. I really miss Linq!!!
                                  For Each cc As HomeSeerAPI.CAPIControl In hs.CAPIGetControl(deviceRef)
                                      If cc.ControlValue = (deviceValue + 2) Then
                          
                                          'Set the correct dim level
                                          hs.CAPIControlHandler(cc)
                          
                                          'We're done, so let's exit!
                                          Exit Sub
                                      End If
                                  Next
                              End Sub
                          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
                            Nice!

                            I'm assuming that if I change Value = 100 to Value = 30 it will stop at 30%? 100% volume is pretty loud!
                            Originally posted by rprade
                            There is no rhyme or reason to the anarchy a defective Z-Wave device can cause

                            Comment


                              #15
                              Originally posted by S-F View Post
                              Nice!

                              I'm assuming that if I change Value = 100 to Value = 30 it will stop at 30%? 100% volume is pretty loud!
                              Yes, it should.
                              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