Need advice on using Echo with motion sensor


#14

I have edited all of your pictures @001jeff so they now reside here on the forums.
(instead of using an outside site)

For future reference, you can upload pics here using this button:

pic


#15

Thanks, I’m trying to figure it out still.


#16

You probably have to initialize the MessageSent variable. I probably should have mentioned that.

Before you run it, just edit the variable in the variable section beside the log section. Just click on the edit(pencil) next to the MessageSent variable and set it to your current time.

You could create code to initialize it if it’s null but once you run it once then your good.


#18

It’s getting to be over my head. I don’t see a pencil symbol on my edit screen…

Screenshot Motion Detected Piston https://imgur.com/gallery/K34hOoB


#19

Apologies, tried to load picture as you described, it wouldn’t go to my gallery.


#20

Its not actually in the edit screen it’s in the screen where you test the piston, look at your logs, etc. If you click the area pointed to, you can change the value of the variable.


#21

Aaah, ok.


#22

I’ve been busy, haven’t had time to follow up. Iet still doesn’t work as I want it to… getting multiple announcements with no two minute wait.


#23

I would suggest something like this:

if motion changes to active
then
   send announcement
end if
While motion is active
    wait 2 minutes        <--never cancel tasks
    send announcement
end while

The only issue will be if the motion ca=hanges to inactive and back to active within the two minutes. Blocking that would require more complex logic.


#24

Therein lies the problem… the idea is to prevent multiple announcements, due to the location of the sensor. The Sensor will definitely change from active to inactive to active to inactive multiple times when someone is moving about the garage. It seems like a 2 minute cooldown period would be a simple thing, but so far it isn’t.


#25

And moving the Sensor is not an option.


#26

As long as someone is moving about, it should never go to inactive. Usually, you need to be still for 30+ seconds for it to go to inactive but it depends on your DTH. If you really want to block no matter what, I would suggest something like:

datetime notifyTimer

if motion changes to active
then
   cancel all pending tasks
   if $now>notifyTimer
   then
      send announcement
      set variable notifyTime=addMinutes($now,2)
   end if
end if
While motion is active
    wait 2 minutes        <--never cancel tasks
    send announcement
    set variable notifyTime=addMinutes($now,2)
end while

#27

The Sensor is located about 7 feet / a little over 2 meters from the south wall of the garage and.points north. Our freezer and my beer fridge sit against the south wall, so the sensor frequently cycles from active to inactive and back to active.


#28

Ahh, we see the source of the problem now. LOL

OK, see if my logic above helps. I think you need a ‘cancel all pending tasks’ in the first if to keep things straight. I edited my post above to show where.


#29

Forgive my ignorance, but how do I insert the ‘cancel all pending tasks’ command? I’m trying to insert an anonymized snapshot, but it’s not working. I was able to get the anonymized piston ID, it’s ooxzs.


#32

try under LOCATION


#33

To add a bit to what Ike said… Notice this command is in the “generic” section (non-device).

pic

This means this command should be available in nearly all blocks.
(Location, Lightbulb, Motion Sensor, Switch, Thermostat, etc)


#34

I’m beyond frustrated.l appreciate your help, but it’s like we’re speaking two different languages. I understand mostlyo when it’s in a Piston, but arrows and dashes are frustrating me to no end. .I can’t make sense of it. I haven’t been doing this long.


#35

I’m done for now. I can’t even get a freaking anonomized snapshot to load.


#36

In my opinion, webCoRE is much easier to program on a full PC browser.