Announcement

Collapse
No announcement yet.

Ladder logic in HS4

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

    #16
    retiredjeff The logic of an if/then/else is
    IF (Condition)
    THEN (condition is true)
    Do things because the condition is true
    ELSE (condition is false)
    Do things because the conditon is false
    ENDIF

    In HomeSeer, the condition is actually an EVENT/TRIGGER.
    This makes it rather difficult to get an ELSE (event didn't fire/trigger didn't happen)


    Comment


      #17
      Another former Stargate user here and IF-THEN-ELSE programming is one of those things you sorta have to live with to understand and appreciate. Once you learn to use it, it becomes super valuable. I definitely miss it here in HS World. Unfortunately Stargate as a stand-alone died due to a lack of innovation, and while HS2 had a plug-in to harness its excellent I/O capabilities, that was killed off in HS3. So please throw us a bone and give us IF-THEN-ELSE.

      Comment


        #18
        Have you all been following this thread where changes to the Events are being discussed. Currently ELSE is not in the proposed round 1 changes (stated it may be in a future update), but additional sub-conditions are and would allow for an Else type scenario by just doing the opposite IF. It would not work under the initial trigger (wouldn't actually make sense to for many devices such as an On/Off unit as one of the two would always trigger), but would be under the Conditional sections:

        When Device1 is changed to On
        Then
        If Device2 = On
        Set Device3...
        If Device2 = Off
        Set Device4...

        This post in the thread shows a requested END statement to stop processing as well as the current suggested changes (Everything but the Yellow portion).
        Karl S
        HS4Pro on Windows 10
        1070 Devices
        56 Z-Wave Nodes
        104 Events
        HSTouch Clients: 3 Android, 1 iOS
        Google Home: 3 Mini units, 1 Pair Audios, 2 Displays

        Comment


          #19
          Not sure what point you are making metkhoo​ . The way it works would be,
          If time is after 10am
          and if time is before 11am
          then turn light on
          else turn light off

          Comment


            #20
            Originally posted by retiredjeff View Post
            Not sure what point you are making metkhoo​ . The way it works would be,
            If time is after 10am
            and if time is before 11am
            then turn light on
            else turn light off
            So if the the event engine is checking for conditions every 100 Milliseconds for example; between 11am and 10am the next day, it turns the light off (396000 times).

            I should also mention if something else turned the light on, it would be turned off again!
            Jon

            Comment


              #21
              Originally posted by retiredjeff View Post
              Not sure what point you are making metkhoo​ . The way it works would be,
              If time is after 10am
              and if time is before 11am
              then turn light on
              else turn light off
              Instead of viewing HomeSeer in a traditional programming manner using "IF-THEN" logic, I find it useful to think of HomeSeer logic like this:

              WHEN an EVENT is triggered
              AND various CONDITIONS are met
              THEN peform ACTIONS

              Comment

              Working...
              X