Welcome Home message when returning and back door opened


#1

1) Give a description of the problem
Im trying to use Alexa Speaks to play a welcome message when somebody arrives home and the back door is opened.

2) What is the expected behavior?
It should only fire when the presence of the person has been away for more than a defined period of time ( for example an hour ) to prevent it firing every time the back door is opened and the person has truly been away and not just put the rubbish out or something.

I think i may need to somehow use a global variable that only marks them as away after the set period of time that I can then check is true and trigger when the door is opened.

The use of this variable could be used for many other things to determine a ‘true’ away status.

Unless i am completely over thinking this as away should only be triggered I guess if leaving the geo fence ? Where i got stuck on this though was the presence would change to present a good few minutes before the back door is opened so couldnt work out how to wait and see if the door is opened before triggering the ‘do’ .


#2

@Groove200 The simple way would be like this (if I undestand you correctly)

IF Back door CHANGES to OPEN (Trigger)
and
IF presense sensor was not present atleast 1hour (Condition)
then
with speaker
Speak XXXXXXXXX

With this piston, you can open/close the back door all you want, the piston will not be executed because of the condition…


#3

You’ve understood perfectly !

It was the condition but I wasn’t sure how to do and this explains it perfectly , off to have a play !

Thanks for your help :+1:


#4

Have fun:)))
Let me know how it goes and if you have any other questions…


#5

Thanks pal … only just come over to webCoRE after using the original core , so things are all a bit eye opening at the moment and my head is spinning with possibilities … just starting small until I get a grip of it all :wink:


#6

Down the rabbit hole:)))))
When I started just wanted to turn my lights on and off…
Now running the whole house almost over 60 pistons LOL


#7

Had a play this morning , and something is not quite right.

If I just test using the presence sensor it successfully triggers only after my test time of 30secs. Does not trigger if less than so that logic seems to working fine…

Adding in the door sensor is where it goes wrong…

What appears to happen is the following -

If the presence sensor is away and has been for >30 secs and door opened - SUCCESS
If the presence sensor has been away , and changes to present , and the door is opened a couple of minutes later ( time to park the car and walk up the path for example ) - DOESNT FIRE ( see log )

Im thinking its the delay between the first thing becoming true ( presence ) and the second becoming true ( door open ) ??

Not sure how to deal with this ?


#8

Use trigger first and condition later…
Switch places line 19 and line 21


#9

Hey Ike, thanks for coming back again.

Still not working, here is the piston (updated ) and logs


#10

I’ll be out for a couple of hours but I’ll take a look at it today…
I have a feeling AT LEAST 30 seconds is the problem… but not sure yet…


#11

Hey pal . Really is no rush , I appreciate any help but no pressure :+1:


#12

Change it to “is present”, should work.


#13

but in that case it would SPEAK every time door opens…
He just wants to hear it when a new arrival comes…


#14

Yes this … out back door gets used a lot when people are present , letting the dog out , etc … the SPEAK would last about 5 mins before I was told to turn it all off :joy:

It sounded so easy in my head … trust me to pick something so complicated on my first piston :wink:

( what I’ve learnt reign to get this to work hasn’t gone to waste though as I’ve just up a really nice piston in the bathroom for when the wife has her ‘spa’ time in there :+1: )


#15

well it is easy actually… it can be easily done with two pistons:)))) but lesser the better…
I am trying to solve it in a single piston without getting into variables etc…
if anybody around (you masters:)))) please jump in…


#16

@Groove200

damn you Andy :)))) LOL
i went nuts… it sounded so SIMPLE but I just couldn’t figure out how to do it in a single piston…

But I wrote the two piston version (embarrassing:))) or maybe this way is the only way to do it?? (not a coder so my knowledge is limited)

Here are the pistons and explanation of a global variable…
We have a global variable (it’s global because we need to see the value of the variable from two different pistons)
your presense sensor defines the variable value.
Piston #1
Checks your presense sensor
if you are away more than 30 seconds variable is TRUE
If you come back is changes to FALSE

Piston #2
Gets triggered when the door open. It will be triggered everytime door is open BUT it will only play sound if the variable is FALSE
now important part is, after sound is played we have to change the variable BACK TO TRUE… otherwise after you arrive, it will play sound everysingle time because variable reads FALSE.
Please be aware of the letter N (piston 2 - line 22) NEVER CANCEL TASK
I have not tried without it, but this was it worked so I let it sit there.

in this format, you will ONLY hear the annoucement everytime you arrive and you can stay outside as much as you want it will only trigger when the door opens and the variable will only change once sound is played.
let me know if you need help with creating a global variable. (i will not be around on the 31st and 1st but be back on the 2nd)

Mean while,
if anyone can bring this down to a single piston I BEG YOU SHARE:)))) I spent nearly 2 hours to figure it out without success LOL

PISTON #2


#17

Another thought,
maybe we could put all in a single piston???
anyway I don’t want to be insane on the 31st and still thinking about this piston LOL


#18

Lol… omg you are a nutter !

I’m glad I could bring you this brain teaser , if it’s any consolation I’ve spent almost an entire day and got nowhere with it ! Solving a challenge feels good though :wink:

I’ll be running this up this morning and will report back , so when you wake up you may be able to get on With your life :joy:

Thank you so much for persevering with this … every day is still a school day it seems :+1:


#19

@Groove200 the user @ike2018 has left the forum… Sold his Smarthome stuff… Moved to a cabin in Colorado with no electricity. Last time he was in public, got arrested for constantly yelling at people “it could have been done in a single piston”


#20

Well all i can say to that is…

Thank you so much Ike…im not sure id ever have got this working tbh. All ive got to do now is add in the rest of the family’s presence sensors without buggering it up :wink:

Thanks again pal…Happy new Year !