Announcement

Collapse
No announcement yet.

Single line (or script file) to prevent or continue with the current event

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

  • Single line (or script file) to prevent or continue with the current event

    Hi,
    I wish to compare two values and then either stop the current event, or continue to the next THEN in line. Can you control further event execution in one line?
    I just started with scripting, so not quite sure where to proceed (and I got stuck in some endless loops as well).

    I tried EasyTrigger but I am having some troubles, and would like to manually log and inspect what is going on.
    So I would like to write somemething like this
    if hs.devicevalue(1234) < hs.devicevalue(5678) then thisEventContinue, else thisEventStopRightThere

    Is this possible? or would I have to split it in two events, and then if true just call the other event? (uglier solution, but if it works...)

  • #2
    The long story : https://homeseer.com/support/homeseer/HS3/HS3Help.pdf and the short one is to compare and substitute your device for this : https://www.youtube.com/watch?v=6mamsNIfeEc In other words, <your device> in HomeSeer with a Virtual Device. Set your events based on that Virtual device.You can do a lot with the same setup.

    "Else" was never introduced in HomeSeer. There is "OR IF" but that will introduce an extra line.


    Eman
    The People's Advocate.

    Comment


    • #3
      Originally posted by dakipro View Post
      Hi,
      I wish to compare two values and then either stop the current event, or continue to the next THEN in line. Can you control further event execution in one line?
      Event actions do not execute in sequence. It is possible to do what you want, I think, but you will need two events. The first event will have the actions you want to run always and an event action to run the second event - if the event conditions on the second event are satisfied. The second event can have a 'Manual' trigger and will have the condition that compares the two values (the EasyTrigger plug-in makes comparison fairly easy.) It will execute the remaining event actions.

      Mike____________________________________________________________ __________________
      HS3 Pro Edition 3.0.0.548

      HW: Stargate | NX8e | CAV6.6 | Squeezebox | PCS | WGL 800RF, Rain8Net+ | RFXCOM | QSE100D | Vantage Pro | Green-Eye | X10: XTB-232, -IIR | Edgeport/8 | Way2Call | Ecobee3

      Comment


      • #4
        Thanks Uncle Michael , that is how I understood it as well.
        Could this script be writen as oneliner, do you have some example of oneliner for if statement?
        I will look more into this, maybe writing one script with parameters just for this one case I need.

        I tried EasyTrigger and it works great for other cases, but for some reason it is not working in this particular case, that is why I wanted to go with scripting to investigate a bit more.I guess my virtual device is quite different then the device I am coparing against, not sure

        Comment


        • #5
          It might help if you could post a screen shot of your event and the status graphics tab of your virtual device.

          The way to do this in a script would be run the script as an event action of the first event, then in the script you would have whatever comparisons you want along with logging statements, etc.
          To "continue" with the event, you would need a line something like what you proposed:
          if hs.devicevalue(1234) < hs.devicevalue(5678) then hs.TriggerEvent ("Event2")


          There is no need for an "else" in this case (that I can see). If the condition is met the dependent event runs. If it is not met, it does not run.
          Mike____________________________________________________________ __________________
          HS3 Pro Edition 3.0.0.548

          HW: Stargate | NX8e | CAV6.6 | Squeezebox | PCS | WGL 800RF, Rain8Net+ | RFXCOM | QSE100D | Vantage Pro | Green-Eye | X10: XTB-232, -IIR | Edgeport/8 | Way2Call | Ecobee3

          Comment

          Working...
          X