Announcement

Collapse
No announcement yet.

Issue with light script

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

    Issue with light script

    I have a script that runs in the AM to do various things, one of them to turn off specific lights. I know I can do this through the event GUI, but for organization purposes I'm doing it through vb.net scripting. Here's one of the commands I run.

    hs.setDeviceValueByRef(110,0,True) 'turn off the lights

    It does work. However, the light randomly turns back on a few minutes later. This happens to all of the lighting in this script. It makes no sense. I looked in the debug logs and I see the lights being turned off by the script. But then the values change a few minutes later and I cannot tell what is changing it. Any help would be appreciated.
    Attached Files

    #2
    Odd that the command works, as you should be using the CAPI commands to control devices under HS3 (search the board for CAPI to find examples). I'm guessing that what you are seeing is related to not using the CAPI commands, but I would have expected that they would not have worked at all. What type of light is it?


    Sent from my Phone using Tapatalk
    HS 4.2.8.0: 2134 Devices 1252 Events
    Z-Wave 3.0.10.0: 133 Nodes on one Z-Net

    Comment


      #3
      Jasco 45609 switches to control the lights. Yeah if I manually run the event it works every time.

      I'll try the CAPI commands. So what would be the purpose of functions like setDeviceValueByRef in HS3 if you shouldn't be using them in scripting?

      Comment


        #4
        You can use those commands to control virtual devices, but for zwave switches, you definitely need to use CAPI.


        Sent from my Phone using Tapatalk
        HS 4.2.8.0: 2134 Devices 1252 Events
        Z-Wave 3.0.10.0: 133 Nodes on one Z-Net

        Comment


          #5
          Thanks sparkman. This CAPI command seems to work fine:
          hs.CAPIControlHandler(hs.CAPIGetSingleControl(112,True,"On", False,False))

          For checking a zwave device's value in my logic, can I still use something like this?
          If hs.deviceValue(110) = 255 Then.....

          Or do I need to use the control api to get status as well?

          Comment


            #6
            Great, you can use the devicevalue command to check current value.

            Cheers
            Al


            Sent from my Phone using Tapatalk
            HS 4.2.8.0: 2134 Devices 1252 Events
            Z-Wave 3.0.10.0: 133 Nodes on one Z-Net

            Comment


              #7
              To better explore CAPI commands available for each of your devices, check out:

              http://tenholder.net/tenWare2/tenScriptAid/default.aspx


              tenholde
              tenholde

              Comment

              Working...
              X