Announcement

Collapse
No announcement yet.

Capi Control not working for new 200 series switch

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

    Capi Control not working for new 200 series switch

    I recently replaced an old GE switch with the new 200 series dimmer from homeseer. (side note, the replace node function was a total joke and completely jacked up my network. I recommend excluding / deleting the old node first, then add your new switch.)

    I have an existing script that I've been using for a while with my other dimmers, but the capi control doesn't seem to be working with the new one.

    Code:
    // Arg 1 - Device ID with on/off dictating whether to control light or not
    // Arg 2 - Device ID with desired light level
    // Arg 3 - comma sep. list of lights to control
    public void Main(Object[] args) 
    {
    char[] argDelimiterChars = { '|' };
    string[] args_arr = args[0].ToString().Split(argDelimiterChars);
    int shouldControl = hs.DeviceValue(Int32.Parse(args_arr[0]));
    if(shouldControl == 1) 
    {
    
    int desiredLightLevel = hs.DeviceValue(Int32.Parse(args_arr[1]));
    int lightId = 0;
    
    char[] lightDelimiterChars = { ',' };
    string[] lights = args_arr[2].ToString().Split(lightDelimiterChars);
    
    foreach (string i in lights)
      {
        lightId = Int32.Parse(i);
        
        HomeSeerAPI.CAPI.CAPIControl cc = hs.CAPIGetSingleControl(lightId, true, "Dim (value)%", false, false);
        cc.ControlValue = desiredLightLevel;
        HomeSeerAPI.CAPI.CAPIControlResponse cr = hs.CAPIControlHandler(cc);
    
      } // end foreach
    
    
    } // end if should control
    }
    Any ideas what the issue is? I have about 20 other dimmers using this script without issue.

    #2
    What dim level are you attempting to set the switch to? What kind of light bulb are you using?
    💁‍♂️ Support & Customer Service 🙋‍♂️ Sales Questions 🛒 Shop HomeSeer Products

    Comment


      #3
      Just curious, are the lights not dimming correctly, or not at all? There have been some complaining that the new 200 series switches don't dim well with LEDs.
      Don

      Comment


        #4
        I am setting level between 0 and 99. When I manually ran this script a bunch of times trying to figure out why this particular switch wasn't working, I was specifically testing 90 as the level.

        I am using LED (non zwave) bulbs. I have no problems turning the lights on, off, dimming to varying degrees manually at the switch. Same goes for controlling it through the home seer UI, or hstouch, all of that works great, but my script no longer works.

        I've tried using the device ID from all 3 "devices" that get created for the switch, with no luck on any of them.

        Comment


          #5
          Have you checked that the label on the Status Graphics tab for the dimmer still is "Device (level)%". I see some devices included during the last 4-5 months are labeled this way...
          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


            #6
            Ah.. Clearly I didn't understand how capi control works. I didn't even realize it relied on the formatting of your status graphic stuff.

            I was able to get it to work by adding "Dim " to the prefix so that it matched to older switches. Thanks for the pointer!

            Comment


              #7
              Originally posted by smikkelsen View Post
              I recently replaced an old GE switch with the new 200 series dimmer from homeseer. (side note, the replace node function was a total joke and completely jacked up my network. I recommend excluding / deleting the old node first, then add your new switch.)

              I have an existing script that I've been using for a while with my other dimmers, but the capi control doesn't seem to be working with the new one.

              Code:
              // Arg 1 - Device ID with on/off dictating whether to control light or not
              // Arg 2 - Device ID with desired light level
              // Arg 3 - comma sep. list of lights to control
              public void Main(Object[] args) 
              {
              char[] argDelimiterChars = { '|' };
              string[] args_arr = args[0].ToString().Split(argDelimiterChars);
              int shouldControl = hs.DeviceValue(Int32.Parse(args_arr[0]));
              if(shouldControl == 1) 
              {
              
              int desiredLightLevel = hs.DeviceValue(Int32.Parse(args_arr[1]));
              int lightId = 0;
              
              char[] lightDelimiterChars = { ',' };
              string[] lights = args_arr[2].ToString().Split(lightDelimiterChars);
              
              foreach (string i in lights)
                {
                  lightId = Int32.Parse(i);
                  
                  HomeSeerAPI.CAPI.CAPIControl cc = hs.CAPIGetSingleControl(lightId, true, "Dim (value)%", false, false);
                  cc.ControlValue = desiredLightLevel;
                  HomeSeerAPI.CAPI.CAPIControlResponse cr = hs.CAPIControlHandler(cc);
              
                } // end foreach
              
              
              } // end if should control
              }
              Any ideas what the issue is? I have about 20 other dimmers using this script without issue.
              And FWIW, I believe the "replace" function only works if you are replacing with the exact same type of switch. There appear to be some workarounds that I've seen on different threads, but none are guaranteed, and probably take about as much time as just adding as a new device.

              Comment

              Working...
              X