Help me fix my piston please


#1

So what I want to do is, if my phone of my gf home change from non present to present and stay present for st least 2minutes, it changes from away to home and give a message depending who it is.

I also want this to work if the mode is home aka If I’m home and GF arrives

I want it to welcome her

Thanks


#2

Click on the AND between changes to present and stays present for 2 minutes… Change it from AND to FOLLOWED By.

The presence cannot change and stay for two minutes at the same time.

You can also just eliminate the changes to and keep the “stays present for 2 minutes”.


#3

I wrote the following then noticed that @michicago beat me to it whilst I was trying… what the hell, I’ll reply anyway lol

Each of your blocks has two triggers in the IF’s (changes to and stays)… these two triggers cannot happen at the same exact time so your piston will never fire.

You only need the one IF for each block (stays present for 2 minutes).


#4

If I change the and to followed by it now says follows whiting 1 min by stays for 2 min

What should I put there


#5

Just reduce it down to one IF…

IF
iPhone’s presence stays present for 2 minutes
THEN
change mode
Send notification


#6

But I want different conditions

I want that if my phone change to present then it says hi me

While if my gf gets present it says hi her


#7

Yeah… you still keep the two seperate blocks (one for you, one for her)… but only one IF in each block.

IF
Your iPhone’s presence stays present for 2 minutes
THEN
change mode
Send notification you came home

IF
Her iPhone’s presence stays present for 2 minutes
THEN
change mode
Send notification she came home


#8

I see but I don’t understand why doing if this AND this do didn’t work

But ok I guess I need to learn more


#9

You could also do it in a single block using an expression for the notification:

IF
Any of Gyslain’s iPhone or Julie’s iPhone’s presence stays present for 2 minutes
THEN
change mode
Send notification: “welcome home “ ($currentEventDevice = Gyslain’s iPhone ? Gyslain : Julie)


#10

All conditions and triggers need to be true at the exact same moment for an ‘AND’ piston to fire.

At the moment in time that a Presence Sensor changes to present, it hasn’t been present for two minutes, it’s been present for 0 seconds… so the ‘stays present’ part cannot be true.

Basically, you can only have one trigger, everything else needs to be a condition.

This will work:

IF
Trigger
AND
condition

But this won’t:

IF
Trigger
AND
trigger


#11

Make sense but if I do this

IF
Your iPhone’s presence stays present for 2 minutes
THEN
change mode
Send notification you came hom

Won’t that notification each 2 minutes? Which I why I tried when présence change from non présent to present


#12

Yes, that will delay your notification too. You can fix that by having yet another IF statement.

IF your iphone presence changes
Then send message

IF your iphone presence stays for 2 minutes
Then change status


#13

It won’t send every two minutes

It’s not a loop statement, it needs presence to change to cause the two minute counter.


#14

I modified the Gyslain part, would this work or would I nee to put the stays present in an indépendant if?

Maybe I’m trying to think this too many human and not enough computer?

Because what it was doing is, how the GPS report my location was if I get out my parking slot it considérés me away and if I move a lit5le I’m considered present again, so I wanna make sure that the presence change from non present to present AND stays present for 2 minutes before it sends the notification.

I also wanna make sure that AFTER 2 minutes of stay in presence ( after being in non present it change the location to home)


#15

I give up!


#16

Why? I understand that I don’t understand this easily but I wanna understand what I’m doing wrong

I’m visual. Just saying do this wont make me understand I need to see a full configuration like what I wanna do to understand


#17

I gave you the solution in post 7.

I explained that ‘Stays present’ only fires once.

I explained you can’t do a trigger inside a trigger

You create a new piston doing the complete opposite.


#18

Guess I forgot to answer that my mistake

But I get notifications each 2 minutes since the piston always run I woke up with like 200messagea sayin* welcome home


#19

Anyway I appreciate your help and sorry if I was a bother

I’ll just try to reread the full wiki from start to end.

I know that I’m slow but I really wanna learn this

So once again thanks for trying


#20

Hi please don’t get mad at me but i got another question

I copied everything in post 7 and it seems to work but only if we arrive at the same time

EXEMPLE I am home all day, and she arrives

It will fire Welcome home julie + welcome home gyslain

and vise versa