Announcement

Collapse
No announcement yet.

A simple vb.net script to track the status of a set of lights and update a KPL btn

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

    A simple vb.net script to track the status of a set of lights and update a KPL btn

    All,

    the attached script will monitor the status of any number of devices and then update a kpl btn according to the following algorithm.

    if any light is on, the kpl will turn on (if it is not already on). if all the lights are off, the kpl btn will turn off.

    To install do the following:

    1. put the DeviceCallback.vb file in your \scripts folder.

    2. customize the device codes according to your needs

    3. add the following line to your startup.txt file
    hs.runex "DeviceCallback.vb","register", ""

    4. Restart hs

    Each time you modify the source file, i suggest you restart hs.

    Note: You may use this and customize as you wish, but i can not provide vb.net programming help on this; i'm running out of bandwidth right now.
    Attached Files
    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

    #2
    Cross-links on KPL buttons?

    Mark,

    Are your KPL buttons (other than load button) cross-linked to devices?

    I've adapted you script and it does what it should: sends out the right commands according to the specified criteria. But what is driving me crazy is that the KPL seems to have a mind of its own.

    If only one of 2 lights currently on gets turned off, I even have the script proactively turn the KPL button On, just in case. But what I see is the script being reentered because the KPL apparently turned off its button when I manually turned off that one light.

    Also, turning On or Off the KPL buttons manually from HS has no effect on the physical KPL buttons, although HS displays the appropriate On status and the script is entered because of a status change of KPL buttons.

    So my theory for now is that the KPL reacts to one of its linked devices being turned Off or On.

    So what's your situation with KPL buittons linked to devices?

    Comment


      #3
      i do not have any of the lights linked to the kpl (in either direction). I setup a insteon group the contains all the lights (except the kpl). so when i turn off the kpl btn, hs runs a group off action. turning the kpl btn on manually does nothing.
      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


        #4
        Mark,

        I sporadically get in the log:
        Script Script DeviceCallback_KPL.vb is currently running, waiting for it complete before its run again
        I'm not doing all that much in my script, but I do use a few HS functions.
        I thought VB was reentrant, no?

        Am I loosing any input or is it just queued up?

        Any way to avois this?

        Comment


          #5
          i see these msgs too. the second call is being queued by hs.

          i have tried to optimize the script so it run quickly and exits asap
          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