Announcement

Collapse
No announcement yet.

How to control a device from within a script?

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

    How to control a device from within a script?

    I have a dry contact binary switch that I am using to do zone control in a heating system by comparing various temperatures.

    I have all the control logic working in a script but can't turn the switch on and off inside the script (ie - works fine as an Action).

    Here is a simple test script of just the on/off attempt:
    hs.WriteLog "Test", "Current device status is " & hs.DeviceStatus("q51")
    hs.SetDeviceStatus "q51", 3

    where the first line logs a 2 if it is ON and a 3 if it is OFF, so I know I am talking to the right device. The second line seems to cause a log entry saying the device is being set to what it already is (regardless of being a 2 or a 3 or anything in the second line).

    I'm sure I'm doing it wrong - how would a single status value of 4(DIM) for instance set a dim level??

    Can someone please point me to an example of device control in a script, or explain how to do what I am trying to do above?

    Thanks in nadvance,
    bob

    #2
    To control the device, you would use hs.transmit "Q51","On"

    Setting the device status is purely for HS's benefit - it doesnt actually control the device...
    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
      Originally posted by rmasonjr View Post
      To control the device, you would use hs.transmit "Q51","On"

      Setting the device status is purely for HS's benefit - it doesnt actually control the device...
      Thanks! I had seen that command in the scripting section of the user's guide but all references are to x10 and I couldn't find anything similar as applies to Z Wave.

      That command works in my script and opens a wide range of possibilities.

      Thanks again,
      bob

      Comment


        #4
        yeah, I'm (finally) off X10 and I feel 'dirty' when I use "hs.execx10" in my scripts to control z-wave devices
        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


          #5
          All,

          I am running into the same problem, except I am trying to control a Schlage Z-Wave lock. Hs.transmit and Hs.SetDeviceValue are not working. I have an open ticket with HomeSeer, however, if anyone has bene able to control a Z-Wave lock, I would very much appreciate your help!

          Thanks!

          Comment


            #6
            Originally posted by lamanmi View Post
            All,

            I am running into the same problem, except I am trying to control a Schlage Z-Wave lock. Hs.transmit and Hs.SetDeviceValue are not working. I have an open ticket with HomeSeer, however, if anyone has bene able to control a Z-Wave lock, I would very much appreciate your help!

            Thanks!
            I have one and the way I do it from within a script is to first create 2 events: lockDoor and unlockDoor. Then, within your script, just use: hs.triggerEvent "lockDoor" or hs.triggerEvent "unlockDoor"
            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

            Working...
            X