Announcement

Collapse
No announcement yet.

How to set the value of a virtual switch ?

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

    How to set the value of a virtual switch ?

    I want to set the value of a virtual switch via a script. The virtual switch can have value 14,18,20 or 21.

    Sub Main(ByVal parm as Object)

    Dim Value As Integer
    Value = hs.devicevalue(227)
    'Heating main thermostat heat setpoint

    If Value = 14 Then
    set device 416 to 14
    ElseIf Value = 18 Then
    set device 416 to 18
    ElseIf Value = 20 Then
    set device 416 to 20
    ElseIf Value = 21 Then
    set device 416 to 21

    End If


    End Sub

    so I need the correct command for 'set device 416 to'

    #2
    You need to use hs.SetDeviceValueByRef(227,Value,True) where 227 is your Ref number..

    Robert
    HS3PRO 3.0.0.500 as a Fire Daemon service, Windows 2016 Server Std Intel Core i5 PC HTPC Slim SFF 4GB, 120GB SSD drive, WLG800, RFXCom, TI103,NetCam, UltraNetcam3, BLBackup, CurrentCost 3P Rain8Net, MCsSprinker, HSTouch, Ademco Security plugin/AD2USB, JowiHue, various Oregon Scientific temp/humidity sensors, Z-Net, Zsmoke, Aeron Labs micro switches, Amazon Echo Dots, WS+, WD+ ... on and on.

    Comment


      #3
      This section of the help file may help you: http://homeseer.com/support/homeseer...ast_change.htm


      Cheers
      Al
      HS 4.2.8.0: 2134 Devices 1252 Events
      Z-Wave 3.0.10.0: 133 Nodes on one Z-Net

      Comment

      Working...
      X