Announcement

Collapse
No announcement yet.

HS3 Event Scripting Question

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

    HS3 Event Scripting Question

    I would like to make a little "library" of class/functions that I can use inside of the "Execute immediate script command" functionality of event handlers. For things like logging, variable replacement and conditional execution.

    How do I create such a library that is in the namespace that is seen from "Execute immediate script command" ? Can I extend the hs class?

    #2
    The Execute immediate script command is a one-liner that gets 'wrapped' with source code making it a full script. So, for example:
    Attached Files
    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
      I would like to say:

      LogDevices("Motion","123 127 113 112")

      And have this execuate my custom code that makes a log record with the values and strings for each of the listed devices and copies the data via the web to my external logger.

      I can already execute single lines of code if they use the built in hs object, my whole point is that I want my own object that I can use for my own purposes.

      Comment


        #4
        You can do that, I just don't think you can do it with a one-liner. You'll likely have to use a full script.

        Sent from my SM-G935U 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


          #5
          Originally posted by hucker233 View Post
          I want my own object that I can use for my own purposes.
          You will probably attract attention from more people with the expertise you are looking for if you post this question in the HS3 Scripting forum.
          Mike____________________________________________________________ __________________
          HS3 Pro Edition 3.0.0.548, NUC i3

          HW: Stargate | NX8e | CAV6.6 | Squeezebox | PCS | WGL 800RF | RFXCOM | Vantage Pro | Green-Eye | Edgeport/8 | Way2Call | Ecobee3 | EtherRain | Ubiquiti

          Comment


            #6
            Originally posted by rmasonjr View Post
            You can do that, I just don't think you can do it with a one-liner. You'll likely have to use a full script.

            Sent from my SM-G935U using Tapatalk


            Or you can use multiple immediate one line scripts in a single event. Create an immediate script for one of your devices. Once you get it working properly, make multiple copies with different device IDs.



            Sent from my iPad using Tapatalk
            HomeSeer Version: HS3 Pro Edition 3.0.0.368, Operating System: Microsoft Windows 10 - Home, Number of Devices: 373, Number of Events: 666, Enabled Plug-Ins
            2.0.83.0: BLRF, 2.0.10.0: BLUSBUIRT, 3.0.0.75: HSTouch Server, 3.0.0.58: mcsXap, 3.0.0.11: NetCAM, 3.0.0.36: X10, 3.0.1.25: Z-Wave,Alexa,HomeKit

            Comment

            Working...
            X