Announcement

Collapse
No announcement yet.

How to read an Insteon device in a script

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    How to read an Insteon device in a script

    Hi Mark,
    The if hs.IsOn on an Insteon device seems that is not triggering. Could you please take a look at the the if below and let me know what I'm missing?


    This is my device:
    Occupancy Button A 13.C1.F2:3 Insteon KeypadLinc V2 Relay Button A Today 1:54:02 PM

    'if Occupancy Button A - Insteon Ref117 is On
    hs.WriteLog("BLRadarLastEcho", "Device" & hs.DeviceExistsRef(splitArray(3)))

    If hs.IsOn(hs.DeviceExistsRef(splitArray(3))) Then

    #2
    are you sure splitarray(3) is returning an integer device reference

    as a test, hardcode the devf ref in the hs.ison(x) call to see if that is working as expected
    Mark

    HS3 Pro 4.2.19.5
    Hardware: Insteon Serial PLM | AD2USB for Vista Alarm | HAI Omnistat2 | 1-Wire HA7E | RFXrec433 | Dahua Cameras | LiftMaster Internet Gateway | Tuya Smart Plugs
    Plugins: Insteon (mine) | Vista Alarm (mine) | Omnistat 3 | Ultra1Wire3 | RFXCOM | HS MyQ | BLRadar | BLDenon | Tuya | Jon00 Charting | Jon00 Links
    Platform: Windows Server 2022 Standard, i5-12600K/3.7GHz/10 core, 16GB RAM, 500GB SSD

    Comment


      #3
      Sorry my coding is terrible. I hard coded it as below. The device is on but I do not see the log.
      I'm attaching the device as well.

      If hs.IsOn(117) Then
      hs.WriteLog("BLRadarLastEcho", "Occupancy Button A On")
      'if A4 People Occupancy off
      If hs.IsOff(hs.DeviceExistsRef(splitArray(4))) Then
      hs.WriteLog("BLRadarLastEcho", "RunEvent HouseVacancy" )
      hs.TriggerEvent(splitArray(2))
      End If
      End If
      Attached Files

      Comment


        #4
        try
        if hs.DeviceValueEx(117) > 0 then

        i seem to recall ison & isoff don't work correct. you can report that do hst
        Mark

        HS3 Pro 4.2.19.5
        Hardware: Insteon Serial PLM | AD2USB for Vista Alarm | HAI Omnistat2 | 1-Wire HA7E | RFXrec433 | Dahua Cameras | LiftMaster Internet Gateway | Tuya Smart Plugs
        Plugins: Insteon (mine) | Vista Alarm (mine) | Omnistat 3 | Ultra1Wire3 | RFXCOM | HS MyQ | BLRadar | BLDenon | Tuya | Jon00 Charting | Jon00 Links
        Platform: Windows Server 2022 Standard, i5-12600K/3.7GHz/10 core, 16GB RAM, 500GB SSD

        Comment

        Working...
        X