Announcement

Collapse
No announcement yet.

Trigger event based status change of a number of devices

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

    Trigger event based status change of a number of devices

    Is it possible to run one event based upon the the status change of a number of devices without using RegisterStatusChangeCB?

    I have a bunch of HSM100s throughout the house and I'm creating a virtual device which basically shows if the house is occupied or not. If the house is unoccupied then I want it to run a script that I've written to simulate occupancy.

    Basically I need to run an event when any one of my 12 HSMs change status and do NOT want 12 separate events each running the same script. This script will then check for "Motion" or "No Motion" on the devices and update the virtual device accordingly.

    I'm not keen on using RegisterStatuChangeCB as it will run the script on ANY status change and I can only imagine the overhead that this will cause.

    Any help or ideas would be greatly appreciated.

    Cheers!

    #2
    Try doomotion or blradar plugins. Otherwise you need a bunch of events I believe.

    Comment


      #3
      Could'nt you have 12 condition groups on one event, with each condition being one of the HSM's changing to any status?

      The event should read;

      XX changed to any status

      OR

      YY changed to any status

      OR

      ZZ changed to any status

      etc etc

      I had a similar sort of event to recognise if I was not in the house, the event was similar to the above except I used the 'has been off for at least ' and set it that if any of my PIRs were off for 15mins then the house was unoccupied.

      Comment


        #4
        I think his issue is he would have to setup an event for each motion detector. At that point, the status of the other devices is probably irrelevant. I would think you would do something like:

        Create a virtual device for house status 1=occupied 2=unoccupied.

        Setup an event for each HSM100 that has conditions if house value = 2, then change house device to 1.

        I don't think this can be done with only 1 event since it's a 1:1 relationship between trigger device and event. You would have to do a script with a callback. I had suggested more advanced events as an improvement to HS that could have multiple triggers and multiple actions depending on conditions, but a lot of people shot it down and said just run a script which I think is the general direction HST has taken.

        To do what you want, I would suggest BLRadar since it's cheaper than DooMotion. If you want to do a lot of devices, custom scripting upon motion or occupied status, I prefer DooMotion but it's a bit pricey.

        Both of these will make the task a lot easier. You can setup your motion detectors in the plugin and then assign them to a zone/occupancy sensor. They will give you more advanced features like failsafes to reset motion detectors, delays from when motion was last detected to change occupied status, etc.

        Comment


          #5
          I just looked in the events, not sure why I never noticed this before, but if you go to set the trigger and device status change you can select "Any" as the device. mrHappy, was this what you were suggesting, using the Any device as a trigger rather than the HSM100's? That would be the same as using a callback so I see how that could work with either the conditions you suggest or to trigger a script. Sorry didn't know that existed and didn't get that from what you described above.

          Comment


            #6
            I appreciate your responses.

            Using a condition based on status change Any device change to status Any is exactly like using RegisterStatusChangeCB and will pretty much have all 100+ devices initiate the same script (and often many instances at the same time) on any change even though they're not related to the motions detectors.

            Unfortunately conditions don't work for the HSM100 because with Homeseer while the Trigger type can be status change, the conditions can only be value change (unless I'm overlooking something). So, for the HSM100's I can use 1 device trigger status change to any but each condition will be HSM100 becomes motion (or not motion) but not both.

            As for DooMotion, I had briefly looked into that but by the looks of it, it's no longer being maintained as there are a tonne of problems with Homeseer 2.4 and it as well as problems relating to DooMotion and the HSM100 in specific.

            As for BLRadar, Blade doesn't put a lot of information on his site, isn't active here, and his forum is locked down and for some reason I can't register..

            I defininitely know that I'm going to be writing a script to update the virtual device based upon the the status of the real devices, but I need to get the event run on the status change of a bunch of motion detectors.

            I can't understand why this is so difficult

            Again, thanks for your help and keep the ideas coming!

            Cheers!

            Comment


              #7
              Perhaps I'm missing something, but I'm not following what you want to do. Why do you want to run a script each time a change in state is detected for one of the devices? Doesn't the state change itself imply occupancy?

              I would think you'd want to run the script when you suspect no occupancy - that is, when the devices are not being triggered. Why not run a recurring script that checks the device time of each of the devices to see if any of them have been triggered within some specified time. Then it's just a matter of deciding how long you need to have no activity to declare the house unoccupied.
              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


                #8
                Mike, that thought never even occured to me

                So, lets say that I run an event reoccuring every 5 minutes which runs a script and checks that a) the devices are all "no motion" and that b) X amount of minutes have passed since DeviceLastChange. If so then, run my simulated occupancy script.

                How then would I stop the simulated occupancy IMMEDIATELY when a motion detector becomes "motion"? If the change to motion occurs 1 second after the last run of the reoccuring event, then the motion sensor may turn on a specific group of lights only to have the simulated occupancy turn them right back off as it's "strolling around the house"

                That's the only reason that I was thinking that a virtual device would be the answer. As soon as it becomes "unoccupied" run script and then as soon as it becomes "occupied" again, disable script.

                Perhaps you could throw some more ideas my way on how I'd accomplish this with your example?

                Thanks much!

                Comment


                  #9
                  how about...
                  an event like mrHappy wrote:

                  XX changed to any status

                  OR

                  YY changed to any status

                  OR

                  ZZ changed to any status

                  etc etc

                  Then the action is to set a vitual device called occupancy(q26) to devicetime 0
                  such as &hs.setdevicetime "q26", 0

                  Then all you need to do is use one event
                  If occupancy flag has been on for at least 15 minutes ......

                  Otherwise everytime you get motion it resets the time back to 0.


                  Stuart

                  Comment


                    #10
                    Thanks Stuart. The reason this won't work is because a conditional event (for the HSM100 motion detectors at least) only allows the trigger to be device status change. All subsequent conditions can only be device value change which, unfortunately, Homeseer limits to "is motion" or "no motion"

                    I'm not quite certain why they've limited conditions to value change. If I could make a conditional event run on

                    Trigger: Device A status change to Any
                    or Group 1
                    Device B status change to Any
                    or Group 2
                    Device C status change to Any

                    this would be a cakewalk. Unfortunately Homeseer only allows:

                    Trigger: Device A status change to Any
                    or Group 1
                    Device B is motion for atleast/currently/exactly
                    or Group 2
                    Device C is no motion for atleast/currently/exactly.

                    Thanks for your help!

                    Comment


                      #11
                      manxam, I use doomotion with HS 2.4 with no problems. Blade was very active up to a few months ago. He is still out there as far as I can tell but much less responsive that previously (not sure why the change, others on the board are more familiar with Blade and can maybe speak to his availability). Regarding BLRadar, it runs in trial mode for 30 days and there is a help link within the plugin with basic setup. He also puts a lot of popup help links within the plugin and the rest is filled in by going into the forum (Blade gets the basics into the plugin help but it is by no means thorough). You can probably look there to see if anyone has had problems with the HSM100.

                      At the end of the day, I am guessing both doomotion and blradar register a callback in HS anyway.

                      Comment


                        #12
                        Originally posted by manxam View Post
                        How then would I stop the simulated occupancy IMMEDIATELY when a motion detector becomes "motion"? If the change to motion occurs 1 second after the last run of the reoccuring event, then the motion sensor may turn on a specific group of lights only to have the simulated occupancy turn them right back off as it's "strolling around the house"
                        Thanks much!
                        To handle this side of the problem I would probably do the following:
                        • Create a virtual device to reflect "occupancy".
                        • Add an action to each motion event to turn the virtual device on.
                        • Create an event that triggers on the virtual device changing to status On that disables the simulated occupancy script.
                        • The recurring script would turn the virtual device off (if it decides the house is not occupied).
                        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


                          #13
                          Originally posted by heatvent View Post
                          manxam, I use doomotion with HS 2.4 with no problems. Blade was very active up to a few months ago. He is still out there as far as I can tell but much less responsive that previously (not sure why the change, others on the board are more familiar with Blade and can maybe speak to his availability). Regarding BLRadar, it runs in trial mode for 30 days and there is a help link within the plugin with basic setup. He also puts a lot of popup help links within the plugin and the rest is filled in by going into the forum (Blade gets the basics into the plugin help but it is by no means thorough). You can probably look there to see if anyone has had problems with the HSM100.

                          At the end of the day, I am guessing both doomotion and blradar register a callback in HS anyway.
                          Just as a small piece of information:

                          Blade is currently in disscussion with HST about putting some of his plugins BACK in the HS Updater, I think one of them is actually BLRadar.

                          Hopefully this WILL happen and then the newer users of Homeseer can also benefit from top class plugins with excellent support as lots of us do at the moment.

                          Keep your eyes open for this happening soon, (I Hope),

                          Meanwhile, there is a plugin called BLOccupied that is specifically for occupation think the name gave that away LOL

                          TrOjAn

                          Comment


                            #14
                            The way I achieved basic occupancy detetion is with a callback. Even though the script is called with every device change, the overhead is really minimal.

                            I defined the detectors I wanted to use as either Entry/Exit or Internal type.

                            If a triggered device is in the list, then the script saves the last active sensor type and its triggered time to a global variable and updates a virtual occupancy device to the "occupied" status.

                            An event checks the variable every 5 minutes and if the last active sensor was an Entry/Exit type and it has been more than 5 minutes since the last activity and the virtual device is "occupied", then the virtual device is updated to unoccupied.

                            This works OK for my requirements with only one problem. If someone gets up early and leaves for work say, whilst others are still in bed, then the exit door is the last triggered device, so 5 minutes later the house is updated to unoccupied when in fact it is occupied. As soon as one of the remaining occupants triggers a sensor, then everything returns to normal.

                            This scenario does not happen very often in our house so it works pretty well.

                            Paul..

                            Comment


                              #15
                              If you want to run a script when there has been no motion, how about:

                              Device A status has been OFF for at least x minutes
                              and
                              Device B status has been OFF for at least x minutes
                              and
                              Device C status has been OFF for at least x minutes
                              and
                              Device C status has been OFF for at least x minutes
                              and
                              ....

                              I have not tried this, but the script should run when there has been no motion what so ever for x minutes.

                              Comment

                              Working...
                              X