[DEPRECATED Thread: visit community.webcore.co for assistance] webCoRE - Piston Design Help (ask your fellow members for assistance)

Here’s another one for you webCoRE gurus. There has got to be a better way to do this piston. I’ve got a total of 15 doors I would like to monitor. Any help is appreciated.

Roger that, That makes more sense.

Thanks!

1 Like

try with

if
   Any of door 1, 2, 3, .. 15 stays open for 5 minutes
then
   send push notification '{$currentEventDevice} was left open';
end if;
1 Like

The problem with your method is that it only checks one time. If the door is left open for more than 5 minutes, you’re not notified again. I first started off with a similar script to yours.

I later found this post by @rayzurbock to combat the problem; the reply right below it by @ady624 is helpful too!

In case it’s unclear, Switch 1 is a virtual switch. I turn this virtual switch on if I want to purposefully keep a window or door open when the weather is nice.

1 Like

You guys are the best!!

I use this logic. You can modify it for open/close sensors.

2 Likes

I like the use of a device list! Time to clean up my other pistons. :grinning:

Stupid question here.

How can I use function “contains” in an IF comparison?

Basically what I want to do is :

IF
(string) variable1
contains
(string) variable 2
Then…

However, it’s not a selectable condition, either when using “value” or “expression”

Edit : I was dumb and figured myself how to achieve it. If contains(var1,var2) IS True

1 Like

see this post:

1 Like

This piston suppose to turn on the garage light if either the garage door or kitchen door are opened, or if there is a motion in the garage. For some reason, as can be seen from the log, when I open the kitchen door, it is not seeing it as kitchen door state changed to open and therefore does not turn on the garage light. However, if I close the door and then open it again, it does see it as state change to open and turns the light on. What is wrong with my piston?
Any help would be appreciated.

Opening the door first time:

Closing the door:

Opening the door second time:

Piston:

Disable condition traversal optimizations in the piston settings - that will allow all conditions to evaluate on each run, making your triggers run properly. Or rewrite them to have the conditions start with the triggers.

Wow ady624, that was fast. Thank you.
What would be preferable? I would assume that the optimization is there to smooth the process.
When you say change the condition to start with the triggers you mean something like:
if contact sensor 1 or contact sensor 2 change to open
and switch 1 is off
then…

Thanks again.

1 Like

Do you know if this could be modified to work with Life360 presence?

Hi guys

The below piston is supposed to automatically put the house into night mode.
The idea is that usually people go to bed between 10pm and 10.30pm, but most certainly never before 10pm.

As i found out now the below piston only triggers at 11.45pm, but not before, in case all motion sensors go inactive before 10pm. Which makes sense, because the piston isnt triggered.

Is there any elegant way to improve the code and have it execute at the desired time?

I think in all fairness switching mode when all sensors become inactive may not be representative of your intentions. It may be that all of them are briefly inactive but people did not yet go to bed. But if that is what you want, it should work.

I would personally use if all motion sensors stay inactive for X minutes

Hi ady

Thanks alot for the input…the truth is that I have been thinking of a variety of ways to automate mode change, but so far that was the most elaborate way I could come up with - other than a “hard” mode change at say 11pm.
I have been going through the piston example thread looking for ideas - but that one is counting 500 posts already too, so if anyone has any ideas on how they are managing it…Id be more than happy :slight_smile:

My basement pantry inventory piston is at 25 chunk and would greatly benefit from savvy optimization.

Can a charitable man help my poor piston? :hugs:

Once optimized, I will post it as an exemple in the other thread. For those who grabbed my Scotch inventory piston, please note i’ve updated it with clickable tiles. I’ll update my post very soon.

P.S.: IFTTT logs everything I take off the inventory in Google Spreadsheet for basic analytics :slight_smile:

I could not get it to work with the attribute even though I see that method being used to store the attributes of X light so they can be loaded back into the same X light… I guess in this case I am trying to load attributes from X light into Y light. I wonder if there is a way to do it as I believe it would be a cleaner solution.

This piston is doing it the other way I believe you were suggesting (Thanks @Bangali):

thats a heck of a piston :slight_smile: how are the integers Item_one_Remaining, Item_one_Threshold etc set to their initial value?

Manually… That’s why I was waiting for the feature to quickly set values in the piston view page.