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.
Any ideas what the issue is? I have about 20 other dimmers using this script without issue.
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 }
Comment