Arrive/ leave piston with extra present devices

conditions
presence
piston

#1

1) Give a description of the problem
generally working well, but something keeps popping up and I just worked out what it is. When someone comes home and only one of their present devices has triggered, if another person comes home then leaves the house goes to away. I changed line 130 and 136 to AND instead of OR to fix this but that will cause other issues when leaving when one of the present devices has never triggered.

2) What is the expected behavior?
Should only trigger to away when everyone has left the house.

3) What is happening/not happening?
If one of the devices is still away even though the other has triggered it can still go to away vire another person.

4) Post a Green Snapshot of the piston!

5) Attach any logs (From ST IDE and by turning logging level to Full)

no logs needed

my other idea was to try timed present but this would then stop it going to away when we all leave together.


#2

What about setting a variable with the count of present presence devices and triggering the piston only when count(variableName) == 0?


#3

I the issue is sometimes either one of the present devices sometimes completely fail on days I.E today it is my WC present device that’s not working but my ST one is working fine. So I came home and the ST triggered, the piston fired and my my alarm didn’t sound, great! But then I’m at home for a few hours and the wife pops in and the piston fires again to change the mode to home again great, but she then leaves and because both of my devices are not present it goes to away and sets my alarm. So if I do a count variable and they don’t all go to away then the house will stay in home mode :disappointed_relieved:

I just had a idea of forcing a device present if one of them has recently changed to present. ie if A changes to present and B isn’t not present after 2 mins then change to present but unfortunately that’s not a parameter that you can do.


#4

Unless its possible to do something like if A changes to present and B stays not present for 2 mins then ignore B until it changes to present then, if B changes to present and A stays not present for 2 mins then ignore A until it changes to present?

edit: would something like this be useful in the piston


#5

Will check it out and see if we can brainstorm after this work stuff is out of the way :wink:


#6

I’m lost in the conditions, but this is my attempt so far :tired_face:


#7

Are you using two presence sensors for each person in the household?


#8

Yes the ST one and the WC one


#9

So going back to the 8t8b piston, what’s the logic you’re trying to build on that?


#10

yeah that’s the plan, just needed to squash the bug :slight_smile:

The logic is:

If I arrive home during the workday go to ā€œwork at homeā€ mode, unless holiday is on when go to ā€œHomeā€ mode.
If anyone else comes home in the day go to ā€œHomeā€ mode.

If anyone comes home in the evening go to ā€œEveningā€ mode

If anyone comes home at night go to ā€œNightā€ mode

If the music was on when the last person left then as long as you are not returning at night turn that speaker back ON.

when the last person leaves, workout what speakers and lights are on, then turn off them devices. Also set the nest to away mode.

Added in to all of this is the guest fob that only works when we are away but also triggers all the modes.


#11

This is the one I was referring to… maybe if we can build off of this one first just to establish ā€˜present’ and ā€˜not present’ first. In this example, this is just one person, right?


#12

Yes in that example it was just one which if we could get it to work could then be expanded.

The piston I have done allows for multiple people and in theory should work but is very complex and would be a pain to add more people too. So if we could get it to work out if we are home or not and the piston fire from there it would be better.

Is there a easyer way to do comparison like the piston 8t8b? I’ve had to do them a few times and you end up writing everything multiple times.