I need some dumbed down explanation of CAPI or something.
I've tried so many variations of examples i've found for controlling devices but for some reason continue to have problems.
So, i'm hoping to get a clear example of the following:
How do you control an on / off switch?
How do you control a dimmer switch?
I've got something like this, among other examples that i've tried:
I will have a var with the device in it (should it be just the device ID, or does it need to be another reference to the device?
I will also have a var with the level that the light should be set to (1-100). (for dimmers)
For on/off switches, I will have a var that represents on or off.
if I can get an example that sets these vars, and controls the device, that would be a huge help. This is just not something that makes sense to me for some reason.
I've tried so many variations of examples i've found for controlling devices but for some reason continue to have problems.
So, i'm hoping to get a clear example of the following:
How do you control an on / off switch?
How do you control a dimmer switch?
I've got something like this, among other examples that i've tried:
Code:
hs.CAPIControlHandler(hs.CAPIGetSingleControl(lightId,false,val,false,true));
I will also have a var with the level that the light should be set to (1-100). (for dimmers)
For on/off switches, I will have a var that represents on or off.
if I can get an example that sets these vars, and controls the device, that would be a huge help. This is just not something that makes sense to me for some reason.