Announcement

Collapse
No announcement yet.

Light control on|off

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

    Light control on|off

    Trying out the plugin and loving the voice recognition, how do you control lighting on|off.

    Can it be done with the grammar on|off in the one event or does each change/status (ie on) need it's own event.

    Cheers

    Liquid Chef

    #2
    you can do it using one event but you need script

    set something like this as the phrase to be recognized:
    Code:
    Turn the light <on|off>
    see syntax guide for more details

    then add a script action to your event
    the following is a C# script that should work

    Code:
    public object Main(object[] Parms)
    {
        string var0 = (string)hs.GetVar("kinectvar0");
        int dvRef = 888; //ref of your light device
        HomeSeerAPI.CAPI.CAPIControl control;
        
        if(var0 == "on")
           control = hs.CAPIGetSingleControlByUse(dvRef, ePairControlUse._On);
        else
            control = hs.CAPIGetSingleControlByUse(dvRef, ePairControlUse._Off);
        control.ControlValue = value;
        hs.CAPIControlHandler(control);
        
        return 0;
    }

    Comment


      #3
      I have all my devices just toggle via script and when the Kinect hears the word light it just toggles the light. I usually never say the words on or off. Maybe I'm just lazy. Not much of a talker either.

      Comment

      Working...
      X