Announcement

Collapse
No announcement yet.

Set Device Value in a script issue

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

    Set Device Value in a script issue

    I cannot get a simple script to turn a light device on or off even though the script does change the value of the device.
    'Study is Location 1 and SpotLights is the device name
    hs.SetDeviceValueByName("Study SpotLights", 100)

    I write the device value to the log from the script and it shows the value change to 100 (from 0)
    Also, I have a hstouch label displaying the value and the value shown in the label changes from 0 to 100

    hs.SetDeviceValueByName("Study SpotLights", 0)
    I also have a test script to turn off the light as shown above.

    The light does not turn off with the above script even though the value changes to 0.

    I can turn on or off the light from the device home page or from a hstouch label that when released toggles the device

    I also tried hs.SetDeviceValueByRef(50, 100, True) and hs.SetDeviceValueByRef(50, 0, True)

    Same result as using set value by name, the light does not turn from off to on or from on to off, but the value changes.

    Any help would be very much appreciated.

    #2
    Those statements do not actually control the device. Search the board for CAPI.

    Sent from my Galaxy S7 Edge using Tapatalk
    HS4Pro on a Raspberry Pi4
    54 Z-Wave Nodes / 21 Zigbee Devices / 108 Events / 767 Devices
    Plugins: Z-Wave / Zigbee Plus / EasyTrigger / AK Weather / OMNI

    HSTouch Clients: 1 Android

    Comment


      #3
      Set Device Value in a script issue

      Thanks for the tip on CAPI. I got the light and lock working using CAPI. The statement to lock the door lock is below:
      hs.CAPIControlHandler(hs.CAPIGetSingleControl(hs.GetDeviceRe fByName("Z-Wave LivingRoom_DoorLock"),True,"Lock",False,False))

      Thanks much!

      Comment


        #4
        Check out a tool that will generate CAPI statements for each of your HS devices:

        tenScriptAid


        tenholde
        tenholde

        Comment


          #5
          Thanks Rob. I used the CCAPI commands and it worked.

          Comment

          Working...
          X