Announcement

Collapse
No announcement yet.

Is there a way to trigger events off of a "button"?

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

    Is there a way to trigger events off of a "button"?

    Hello,

    I was wondering if there is way to trigger an event off of a button. I have several of the touch panels around the house and would like to be able to set up several buttons that will cause Homeseer to run events. For example, I have Homeseer adjusting the thermstats during the day based on armed status and so on. I'd like to have a button that did the same thing. I want two buttons right now since I'm still installing switches but I can see the need for more later.

    I want these two buttons to trigger two events, one will be called "Comfort Mode - Hot" and the other "Comfort Mode - Cold". These modes will adjust the thermostats up or down 2 degrees from the common setting in the case that my wife or myself just are not happy.

    The problem is that I can't seem how to find how to trigger an event off of a HAI or On-Q button press. I can send a button press, just can't do anything if it's pressed on a panel.

    If worse comes to worse, I guess I can set up something where the button press sets a light in the attic to 12% and then homeseer picks up on that and does an event and turns that light back off... kind of using some if then else logic triggered by the button press program that was created in PC Access.

    #2
    Hi Chris,

    I still run HS 1.7 and an old (stable) HAI Plugin so I'll tell you how I do it and see if it works for you.

    In my version of the plugin, there isn't a trigger for a button press, so I used a trigger for "Device Value Change". When device "HAI System Button Pushed", change type "Button Name Here" then do whatever.

    Now this will work ONCE, as when you push the same button again the device won't change as it has the same value as it was going to change to, so there is no "device value change" trigger. So in the Event that I trigger with the above example, as well as speaking some, or doing something I reset the "HAI System Button Pushed" device. So in the same event I use device actions and set "HAI System Button Pushed" to "Any Value".

    This allows another push of the same button to register an event so you can keep pressing the same button over and over and it'll trigger every time.

    You obviously have to config the plugin to support buttons.

    Regards,

    Ross.

    Comment


      #3
      Gee, thanks for the dig Ross!

      The is the way by design that buttons are triggered, by device value change, and I thought at one time I did address the double-button problem? Can somebody using the "unstable" version test that and let us know? If not, I will try to remember to test it later today and will report back.
      Regards,

      Rick Tinker (a.k.a. "Tink")

      Comment


        #4
        It still does not reset, and I think that was due to wanting to display the name of the last button pushed instead of resetting it, but there was a command added to HomeSeer that allows me to change the value of a device without triggering any events, and so now I can change the plug-in to do that after a button is pushed. Thus, I will add that to the todo list - Ross's information about resetting the button will work for now, just keep in mind that any events set to trigger on the button device changing to "Any Value" will be triggered by resetting it to "any value"...

        When I address this in the code, I will either provide a value for each button that does not appear in the device values list so that (for example) if the value of button 4 is "4", the reset value will be "904" or something like that so that it will still display button 4 as the last one pushed, but it will be a different value such that pressing button 4 again will trigger the device value trigger again.
        Regards,

        Rick Tinker (a.k.a. "Tink")

        Comment


          #5
          Thanks Guys!

          Rick, So I'm guessing you are saying that the HAI/On-Q plug-in is a little outdated verses HS2.0 and some of the new Homeseer features will be better able to work with an updated HAI/On-Q plug-in?

          If this is the case, when do you think an update will be available. Reason I ask is because I'm still in the playing stages and can wait a few weeks/months before I get into hard core Event programming.

          Comment


            #6
            Originally posted by rirvine
            Hi Chris,

            I still run HS 1.7 and an old (stable) HAI Plugin so I'll tell you how I do it and see if it works for you.

            In my version of the plugin, there isn't a trigger for a button press, so I used a trigger for "Device Value Change". When device "HAI System Button Pushed", change type "Button Name Here" then do whatever.

            Now this will work ONCE, as when you push the same button again the device won't change as it has the same value as it was going to change to, so there is no "device value change" trigger. So in the Event that I trigger with the above example, as well as speaking some, or doing something I reset the "HAI System Button Pushed" device. So in the same event I use device actions and set "HAI System Button Pushed" to "Any Value".

            This allows another push of the same button to register an event so you can keep pressing the same button over and over and it'll trigger every time.

            You obviously have to config the plugin to support buttons.

            Regards,

            Ross.

            Ross, I'm good until the "So in the same event I use device actions and set "HAI System Button Pushed" to "Any Value"." part.

            I don't see anywhere to change the status of the button in the Actions page.

            Comment


              #7
              Rick, No dig. Seriously.. Not on purpose!

              As a side note Rick, I had a look at the HAI NetProtocolLib (HAI_NetLib.DLL). They couldn't have made it any harder to use if they tried! Try and get that R_OMNI_LINK_MESSAGE structure into something VB like (even vb.net). They also only cater for the "standard" commands. Eg No Set time calls which is command 0x10 by the way (let me know if you want the structure!), no support for downloading the panel config etc. So I don't think it's going to help you much.
              The only thing they did well is to use WM_CopyData as a callback for the result of the command, so the function call returns ok (yes I got the command) but the command response data comes back as a callback when it's ready.
              I think it'll be easiler to add network support to your existing plugin, as you already have send/recieve functions, encoding and decode for the different commands etc. Wrapping that stuff with sockets won't be hard.. The offer of help still stands, for selfish reasons of course, I want ethernet support..

              Now, back on track, Chris: I don't have a HS 2 machine currently up and running to give you a screenshot, so I'm doing this from memory.

              In your event select "Devices" under action.
              Under "Devices to Control:" select "HAI System Button Pushed"
              Up the top part of the screen from memory it'll show:
              "HAI System Button Pushed" "Your First Button Name" "Time Delay Field"
              The "Your First Button Name" pulldown list should have "Any Value" as the last option. Select that, then click submit.

              Ross.

              Comment


                #8
                Chris/Ross,

                The HAI plug-in is very much up-to-date with HomeSeer 2. The issue is, that in order to fix the communication problem with the II series panels, at least to fix it using HAI's best guess at a fix, I need to create a queue and a procedure to send a command from the queue and wait for a response. In .NET, I can create a separate thread to process the queue faster than you can say "Omni", and that will take care of all kinds of re-entrant problems and COM CPU problems. Also, .NET has special collection types made just for queues that will also make this a slam dunk.

                Secondly, to address what Ross is backing me up on, VB6 is the worst platform to try to do the network interface support in because A) it requires a window, which the plug-in has very few of these days, and B) the samples and documentation they provided is for 3 other languages that could not be farther from VB if they tried. By going to .NET, I can add their sample C.NET code to the project, and that will allow me to use it very easily - thus, if their own sample code does not work, I will be able to get them to help me fix it.

                Here is the only slight drawback... .NET 2 includes a serial communications class, .NET 1.1 does not, so I have to use .NET 2. We are about to convert HomeSeer 2 to .NET 2 so this is not a big deal, but I will not be able to release anything for testing until HS 2 based upon .NET 2 is at least out in the hands of beta testers.
                Regards,

                Rick Tinker (a.k.a. "Tink")

                Comment


                  #9
                  Thanks Ross! I got it to work! Boy, that is kind of hidden in there.

                  Rick, thanks!!! You've got a great piece of software here! I remember when it first came on the scene! It's taken off from there!

                  If you need a beta tester, let me know. Being an IT director, I have lots of computers around and access to all sorts of stuff. Being an IT Director for a company that does residential systems helps even more!

                  Comment


                    #10
                    Glad to help!

                    Ross.

                    Comment


                      #11
                      What is an HAI?

                      Temperature controller?

                      Thanks!

                      --Dan
                      Tasker, to a person who does Homeautomation...is like walking up to a Crack Treatment facility with a truck full of 3lb bags of crack. Then for each person that walks in and out smack them in the face with an open bag.

                      Comment


                        #12
                        HAI is the Company name that makes a range of Alarm/Home Automation controllers known as the "Omni" range of products.
                        The Omni's support Temp Sensors, HAVC + heaps of other stuff.
                        See: http://www.homeauto.com for more info.

                        Comment


                          #13
                          On-Q is a brand that uses a lot of HAI stuff but is really branching out and they have joined forces with several other to make things that HAI doesn't. Prerry trusted technology IMO because most its been around for many years.

                          Comment


                            #14
                            To add to what they write...

                            HAI is the OEM for OnQ and so HAI and OnQ security and automation panels are compatible. HAI was also the OEM for the Aegis panels, and the Aegis had some additional voice capabilities, but the company that had exclusive marketing of the Aegis systems went under. I have no idea the background on the company that now sells products under the Aegis label and what their status is with HAI - might be selling the exact same products still for all I know.

                            HAI also makes some very powerful / high quality thermostats. The thermostats configured in one mode communicate via 3 wires to the HAI and OnQ security/automation controllers, and then in another mode operate as standalone pseudo RS-232 thermostats that use 3 wires to communicate with a PC. There is a plug-in for controlling the thermostats connected in this way, which is why there are a couple of HAI named forums on this message board. When used in the RS-232 mode, the thermostats have more features and are even supported by other panels, such as the Elk M1.

                            Hope that helps.
                            Regards,

                            Rick Tinker (a.k.a. "Tink")

                            Comment


                              #15
                              FYI... Since being slapped in the face with the realization that Jim was not the only one having the startup problem with the plug-in (see, told you I do not read these message board posts that often/well), I have found my (stupid) mistake and Jim is testing the fix. Since I have to do a release anyway, I implemented the change discussed in this thread.

                              When a button is pressed, today the button pressed device is changed to the name of the button, and the value becomes the button number. Your device value trigger is set showing the button name, but it is actually checking the value.

                              After this 2.0.0.17 or later release, the button device will be set to the button name and the value set to the button number, so your event will trigger, but then the device will immediately be set to button name + "(Reset)" and the value will be set to the button number + 700. By having the value set in this way, it allows the event based upon the button value to be triggered again when the same button is pressed.

                              I will test this and will post it soon.
                              Regards,

                              Rick Tinker (a.k.a. "Tink")

                              Comment

                              Working...
                              X