Announcement

Collapse
No announcement yet.

IF THEN ELSE

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

    #16
    Originally posted by Schly View Post
    This is exactly what I'm trying to do.
    Are there still details that you have questions about or has everything been resolved?

    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


      #17
      I think we are all in agreement that the biggest problem here is achieving an accurate, concise, and complete specification of the problem.

      Originally posted by Uncle Michael View Post
      What is missing?
      The only thing that comes to mind as something that might be missing in your problem description is a specification of the basis of the two logical entities <Gate is Open> and <Gate is Closed>. This may be relevant.

      In his post #1, Schly provides a photo of his existing gate control event suite. In it he references a device he calls "Garage Gate". From his condition and action statements it appears that "Garage Gate" is both a status and control device. His action "THEN Set Garage Gate to On" is expected to cause gate closure. We know that gate closures don't happen instantaneously, so it is unclear what the status condition "AND IF Garage Gate ..." might be if the test is made while the gate is in motion.

      I can see a couple of ways Garage Gate status might be updated, depending on actual hardware involved. Ideally, the gate would work something like my Schlage door lock: I issue via HS3 a lock the door command, which causes the lock motor to run. The lock detects that the bolt is fully extended, and it then reports to HS3 that the door is locked. Thus, closed loop control.

      In contrast, if I issue an HS3 command to turn on a light via X10 interface, it's strictly a one-way (open loop) control. HS3 issues the command via the hardware interface, then it marks the light on, assuming that the command was successful. I'm not sure about Z-wave interface lighting control devices, but my guess is that they are generally also open loop.

      So, if Garage Gate is a closed loop communication device, I see no fundamental problem. Conversely, if Garage Gate status is open loop, then timing might be a concern, for reasons I attempted to address in this thread's post #8.

      Comment


        #18
        Schly , can you confirm that, when you want to open your gate, the only event that Alexa directly triggers is the one you have named "Open The gate"? I am confused by your reference to the "middle" event:

        The event in the middle is the event that is used to trigger either the one above it or the one below it, that’s all.

        Comment


          #19
          I took this statement in post #4 to mean that the sensor was an independent magnetic switch that unambiguously determines open/closed status.

          Originally posted by Schly View Post
          I should have mentioned that the gate is controlled by a simple MIMO lite with a magnetic contact switch for open/closed status.
          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


            #20
            Originally posted by Uncle Michael View Post
            Are there still details that you have questions about or has everything been resolved?
            I'll try to put it into practice and let you know.

            Comment


              #21
              Originally posted by Uncle Michael View Post
              I took this statement in post #4 to mean that the sensor was an independent magnetic switch that unambiguously determines open/closed status.
              Good point -- I had forgotten that. When I just now read the MIMOlite functional description, I got the distinct impression that the device has a single dry contact input, and a single SPDT relay output, and what you do with them is more or less up to you. If so, I would expect that Z-wave device inclusion would produce a parent and at least two child devices, one to collect status of the magnetic switch input, and one to control the relay output. The description implies that input and output are completely independent unless you go out of your way to hook them together with either jumpers or Z-wave configuration.

              So, if there is one child device that reads the magnetic switch input, and another to control the relay, that calls into question the event definitions provided in the photo of post #1. Schly is using the same device name "Garage Gate" both to read the magnetic switch and to control the gate motor.

              Does that make any sense?

              Comment


                #22
                Originally posted by ericg View Post

                Good point -- I had forgotten that. When I just now read the MIMOlite functional description, I got the distinct impression that the device has a single dry contact input, and a single SPDT relay output, and what you do with them is more or less up to you. If so, I would expect that Z-wave device inclusion would produce a parent and at least two child devices, one to collect status of the magnetic switch input, and one to control the relay output. The description implies that input and output are completely independent unless you go out of your way to hook them together with either jumpers or Z-wave configuration.

                So, if there is one child device that reads the magnetic switch input, and another to control the relay, that calls into question the event definitions provided in the photo of post #1. Schly is using the same device name "Garage Gate" both to read the magnetic switch and to control the gate motor.

                Does that make any sense?
                That is the concern I have. Using the same device for control and status seems problematic, as does using a value of greater than 50 or 0 instead of the actual status.

                It would be helpful to see screenshots of the involved device(s).
                HS4 Pro, 4.2.19.0 Windows 10 pro, Supermicro LP Xeon

                Comment


                  #23
                  Originally posted by rprade View Post
                  That is the concern I have. Using the same device for control and status seems problematic, as does using a value of greater than 50 or 0 instead of the actual status.

                  It would be helpful to see screenshots of the involved device(s).
                  Mimolite is being used as a dry contact switch. There is an additional channel on it that has a magnetic sensor wired to it.

                  I use "50" because I'm new to this and at the time I was writing it, I only knew that "0" was closed and "255" was Open. Without thinking, I assumed that the gate would have multiple positions between "0" and "255".

                  I realize now that that is silly in this case. The sensor only understands two positions. It's in contact at "0" (closed) or it's not in contact at "255" (opened). When I fix this, I'll state that part differently, but either using "Not equal to Zero" or "Equals 255".

                  Images of device attached.

                  EDIT: Also, when I build an event and choose a device, I have two options for Gate. One gives me the option of "On/Off" the other allows me to choose a numeric value, so the first is the Mimolite Contact switch and the second is the contact sensor.

                  SECOND EDIT: I'm also going to change the name of the dry contact sensor to "Gate Sensor" to minimize confusion going forward.

                  Comment


                    #24
                    Originally posted by Schly View Post

                    Mimolite is being used as a dry contact switch. There is an additional channel on it that has a magnetic sensor wired to it.

                    I use "50" because I'm new to this and at the time I was writing it, I only knew that "0" was closed and "255" was Open. Without thinking, I assumed that the gate would have multiple positions between "0" and "255".

                    I realize now that that is silly in this case. The sensor only understands two positions. It's in contact at "0" (closed) or it's not in contact at "255" (opened). When I fix this, I'll state that part differently, but either using "Not equal to Zero" or "Equals 255".

                    Images of device attached.

                    EDIT: Also, when I build an event and choose a device, I have two options for Gate. One gives me the option of "On/Off" the other allows me to choose a numeric value, so the first is the Mimolite Contact switch and the second is the contact sensor.
                    No! They are both controlling the Mimolite output. The status and value are the same, they do not reflect two separate functions. Read here and the whole thread.

                    SECOND EDIT: I'm also going to change the name of the dry contact sensor to "Gate Sensor" to minimize confusion going forward.
                    This explains why your event is not working. You are trying to read the values of the control child as position, which will not work. “Gate” is the control and “Sensor Binary” is the position. I can show you 6 events that will work a little later this evening.

                    I would change the status “Off-Closed-No Motion” to “Closed” and “On-Open-Motion” to “Open”. Then use the status of Open and Closed instead of values for your Conditions.
                    HS4 Pro, 4.2.19.0 Windows 10 pro, Supermicro LP Xeon

                    Comment


                      #25
                      Originally posted by rprade View Post
                      No! They are both controlling the Mimolite output. The status and value are the same, they do not reflect two separate functions. Read here and the whole thread.
                      This explains why your event is not working. You are trying to read the values of the control child as position, which will not work. “Gate” is the control and “Sensor Binary” is the position. I can show you 6 events that will work a little later this evening.

                      I would change the status “Off-Closed-No Motion” to “Closed” and “On-Open-Motion” to “Open”. Then use the status of Open and Closed instead of values for your Conditions.
                      Wow! I'm pretty sure that was it! I was choosing something else. I found "Garage Binary Sensor" Garage is the room. I changed it to read Gate Binary Sensor. I changed the event to read that sensor instead of whatever sensor I was reading that wanted a value. Here is the updated Event series.

                      NOTE: I can't try this until I get home, or I'll accidentally release the hounds.
                      Attached Files

                      Comment


                        #26
                        Originally posted by rprade View Post
                        No! They are both controlling the Mimolite output. The status and value are the same, they do not reflect two separate functions. Read here and the whole thread.
                        This explains why your event is not working. You are trying to read the values of the control child as position, which will not work. “Gate” is the control and “Sensor Binary” is the position. I can show you 6 events that will work a little later this evening.

                        I would change the status “Off-Closed-No Motion” to “Closed” and “On-Open-Motion” to “Open”. Then use the status of Open and Closed instead of values for your Conditions.
                        I just got home and tested this. If the gate is closed and I ask Alexa to Open the Gate, it opens. If I ask Alexa to Open the Gate a second time, nothing happens since the gate is already open. So it is working, but I don't get any verbal feedback to Alexa. Is this something that Homeseer does or do I have to add a plugin or something else?

                        THANK YOU FOR YOUR HELP!

                        Comment


                          #27
                          Originally posted by Schly View Post

                          I just got home and tested this. If the gate is closed and I ask Alexa to Open the Gate, it opens. If I ask Alexa to Open the Gate a second time, nothing happens since the gate is already open. So it is working, but I don't get any verbal feedback to Alexa. Is this something that Homeseer does or do I have to add a plugin or something else?

                          THANK YOU FOR YOUR HELP!
                          Do you have a speaker client and speaker attached to your HS server? What are you running HomeSeer on? Linux, Windows, Raspberry Pi? HomeSeer is not able to have Alexa speak back. This is an Amazon limitation, not a HomeSeer shortfall. HomeSeer can speak through its own speaker client and HSTouch clients. It can also speak through Sonos and other speakers with a supporting plug-in.
                          HS4 Pro, 4.2.19.0 Windows 10 pro, Supermicro LP Xeon

                          Comment


                            #28
                            Here are some sample Events. I made an assumption that your gate control is momentary contact (most are). For that reason the two events that control the gate will set the Mimolite back to Off after 2 seconds. If that is not the case, skip the wait and second device control on each of the events (1c and 2b). I also added a 1 second wait in each control event so that you are assured that both will be evaluated prior to the gate beginning travel. This should not be necessary, but will not do anything other than make the Events very reliable. You would launch Event 1a to open the gate and Event 2a to close it.

                            Click image for larger version  Name:	Capture.PNG Views:	0 Size:	100.9 KB ID:	1309876

                            Click image for larger version  Name:	Capture1.PNG Views:	0 Size:	393.2 KB ID:	1309877
                            HS4 Pro, 4.2.19.0 Windows 10 pro, Supermicro LP Xeon

                            Comment


                              #29
                              Originally posted by rprade View Post
                              Do you have a speaker client and speaker attached to your HS server? What are you running HomeSeer on? Linux, Windows, Raspberry Pi? HomeSeer is not able to have Alexa speak back. This is an Amazon limitation, not a HomeSeer shortfall. HomeSeer can speak through its own speaker client and HSTouch clients. It can also speak through Sonos and other speakers with a supporting plug-in.
                              I’m using Win 10 on a micro pc. It does have the speaker client and I can hear if it makes verbal statements, but it’s not in a location where I can hear it easily. I intend to all sonos in the future. I’ll have to wait for that.

                              Comment


                                #30
                                Big5 plug-in has native “ if ...than ...else... “

                                In Big5 action menu you put just this

                                ${if {val123} =0, 1, 0}

                                all values as well as the logic condition = are samples you can put anything there including complex conditions of several devices. You can manipulate numbers and/or strings.

                                In the simplest example above Big5 will send out 1 if true and 0 otherwise.

                                Now there is one more step. As far as Big5 is communication plug-in you’ll need to setup a receiver to get the info. It’s easy and you can choose various protocols. TCP is simple and straightforward.

                                It may look complex but it is not and once you setup a single transmission and receiving profile you can use them in multiple cases such as math calculations, logical expressions etc. without any programming skills.

                                Comment

                                Working...
                                X