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:
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:
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.
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
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.
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.
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.
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.
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
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.
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.
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.
To add a bit to what Ike said… Notice this command is in the “generic” section (non-device).
This means this command should be available in nearly all blocks.
(Location, Lightbulb, Motion Sensor, Switch, Thermostat, etc)
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.