Announcement

Collapse
No announcement yet.

Last Indoor Motion

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

    Last Indoor Motion

    I have a number of X-10 motion sensors that I use with DooMotion for determining location occupancy. They are both inside and outside the house. I have a script that needs to know the location of the last motion inside the house. Any suggestions on how to do this?

    I figured I could do this with a support script that would be triggered when the DooMotion LastMotion device value/status changed. I would examine the value of the device string and then store that new value in a vurtual device (last indoor motion), if the value was not one of the strings that represented an outdoor sensor.

    Unfortunately, I discoverd that HS won't trigger my event when the LastMotion device changes its string. I tried both "Device Status Change" and "Device Value Change" for the triggers. But perhaps those values aren't updated if only a device string changes?

    Anyway, I could have my script be triggered every 30 seconds. But that's not clean nor does it always work. So I'm wondering is there a better way to do this?

    Thanks!

    Bob

    #2
    Try "Device Status Changed" "To Anything"
    sigpic
    A founder member of "The HA Pioneer Group" otherwise known as the "Old farts club!"

    Comment


      #3
      I did. I tried "Changed to Anything" and "Set to Anything". Didn't work.

      Comment


        #4
        How, 'bout when you save the string in the virtual device, just increment the virtual device value. That should trigger an event.

        Comment


          #5
          You are correct. Just tried a test event.

          Although DM updates the device including the time, HS does not pick up the change for some reason!

          You could achieve what you wish using a recurring script and another virtual device to compare the previous status with, although it is another script running and more mem used, however, as it stands it may be your only route.

          One danger here, not sure if DM asks HS for free devices when it starts up, in which case if it does it's going to keep changing the device code.
          sigpic
          A founder member of "The HA Pioneer Group" otherwise known as the "Old farts club!"

          Comment


            #6
            Yup, the recurring event is what I tried, hoping for a better way.

            It works, unless it misses one because two or more changes occur during the polling window. So, it's not perfect...

            I could try "Device: Any" - "Changed to Any Status" to trigger my script. That way it would catch the motion sensor status change. Don't know how often that script would execute. But my main concern would be if there is a race condition between the script and DooMotion updating the Last Motion device string.

            Comment


              #7
              Originally posted by skoocat2 View Post
              .............I could try "Device: Any" - "Changed to Any Status" to trigger my script. That way it would catch the motion sensor status change. Don't know how often that script would execute. But my main concern would be if there is a race condition between the script and DooMotion updating the Last Motion device string.
              That could turn into a nightmare. Remember it going to trip every time anything happens in HS, plus motion sensors as you walk about constantly change.
              sigpic
              A founder member of "The HA Pioneer Group" otherwise known as the "Old farts club!"

              Comment


                #8
                Quite awhile ago, I asked about getting a companion device for each Occupancy Sensor created that would track last motion as I use it in my security settings. Nothing happended with it. Maybe it's time to ask again.
                Regards, Bob

                Comment


                  #9
                  Originally posted by itanic View Post
                  Quite awhile ago, I asked about getting a companion device for each Occupancy Sensor created that would track last motion as I use it in my security settings. Nothing happended with it. Maybe it's time to ask again.
                  I understand where you are coming from, but, and it is a big but, should not be required.

                  I think the question here is how on earth is DM managing to change both the date stamp and device string without HomeSeer noticing.

                  Doc, Tink, Rich an all, any input would be welcome.
                  sigpic
                  A founder member of "The HA Pioneer Group" otherwise known as the "Old farts club!"

                  Comment


                    #10
                    Originally posted by Gogs View Post
                    ...not sure if DM asks HS for free devices when it starts up, in which case if it does it's going to keep changing the device code.
                    DM only needs a plugin "house code" for the three plug-in devices. All sensors are simply used as is with DM manipulating device strings and device change times. I am not aware of the plug-in code being changed once it is first set.
                    Jim Doolittle

                    My Twitter
                    My Hardware & Software

                    Comment


                      #11
                      Originally posted by itanic View Post
                      Quite awhile ago, I asked about getting a companion device for each Occupancy Sensor created that would track last motion as I use it in my security settings. Nothing happended with it. Maybe it's time to ask again.
                      Not sure what my response was earlier. This is a highly customized application that what have limited use for the majority of DM users.

                      One option would be to create a Custom Action Code or Custom Functions. The latter would apply to all sensors so that you would not have to copy code to all your sensors.

                      Don't know why HS isn't recognizing the device string changes but DM will make Custom Action Code/Custom Functions calls with these changes. DM will also trigger DM events as well. So, DM event triggers are another option.
                      Jim Doolittle

                      My Twitter
                      My Hardware & Software

                      Comment


                        #12
                        Duh! I just remembered that there is Custom Function for the Last Motion Device changes. Put your scripting code within that function and you should be good to go. In retrospect, I thought that this function would be useful but until now I really didn't have a good example of when it would be used.
                        Jim Doolittle

                        My Twitter
                        My Hardware & Software

                        Comment


                          #13
                          I haven't written the code yet, but I was planning to do this to keep track of last motion on, and potentially limit which sensors are included, since the DM device tracks any change in sensors, typically it is the last motion off received if there is no activity currently taking place.

                          Bill

                          Comment


                            #14
                            Just started looking at this, and the custom function is only called when security mode is enabled. I don't see any custom function that is called when sensor status changes.

                            This could be done by adding a call from each sensor on CAC that I wanted to track, to a common function in custom functions. I will probably do it this way, unless there is an undocumented custom function that I can use...

                            Bill

                            Comment


                              #15
                              Originally posted by bdickhaus View Post
                              Just started looking at this, and the custom function is only called when security mode is enabled. I don't see any custom function that is called when sensor status changes.

                              This could be done by adding a call from each sensor on CAC that I wanted to track, to a common function in custom functions. I will probably do it this way, unless there is an undocumented custom function that I can use...

                              Bill
                              You run the risk of bogging down the purpose of HS if everytime a sensors triggers an action must be taken, such as a CAC changing a device.

                              Doc., why is it that DM update the status of the last mation device, including the time it changed, but HS will show the change, but does not see the change?
                              sigpic
                              A founder member of "The HA Pioneer Group" otherwise known as the "Old farts club!"

                              Comment

                              Working...
                              X