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

It seems you could eliminate the first “Guest presence changes to not present”. It looks like it could cause problems since something can’t change yet stay the same for 10 minutes. Sorry I can’t test it right now.

Just to add to the conversation, I use Sharptools + Tasker on my phone for presence.

I had a couple of different problems. One was unreliable presence using my phone. The other was that my phone as presence would stop functioning as a device. So repeatedly, I had to pull my phone out of all my rules, pistons, smartapps, etc., remove it, re-add it, then build it back into everything - very tedious to have to do several times.

I added a simulated presence sensor through the IDE and built that into all my rules. So, that fixed one problem, I didn’t have to rebuild stuff anymore.

I can use webCoRE to to trigger the simulated presence using whatever criteria I want. One way is standard presence … now if my phone stops working again, I only have to rebuild that one rule rather than 20 odd pistons, smartapps, action tiles, etc.

Nice thing with a simulated presence is that I can just tap it in the app too, if everything fails, to set me as home/away.

But I used Tasker + Sharptools to flip a presence switch. I use various combinations of virtual switches for different things. Tasker can detect bluetooth and wifi connections. So I use wifi near (rather than connected since connection takes more time it seems to me) in Tasker with my home network to flip a switch in ST through Sharptools. Switch on = I’m home, switch off = I’m not. I also use bluetooth for various connections, such as when I’m connected to my bicycle computer, lots of creative uses for these features I’m just starting to get into.

I don’t know if the simulated presence can be manipulated directly using Sharptools… I didn’t try it, I already had the presence switch for other things, so I kept using it.

I’m not great at describing, sometimes. But basically, Tasker sees me connect to home wifi, tasker uses sharptools to flip my home switch, webCoRE sets my simulated presence as home when the switch is on.

THis way you can use network connection regardless of router brand.

This whole ramble is only applicable for Android … I didn’t check to see if that’s applicable to the conversation.

2 Likes

That’s true. Not sure how that would work. I could eliminate the first condition, but then that action would likely run whenever any other subscriptions had a state change, and I would only want it to run one time. I’ll try out the code you have and report back, but I’m guessing you are correct in that needs to be coded in another way.

I suppose I could simply check it once then check it again ten minutes later, but that seems like a hacky way of doing it, plus then it only checks it once at the end.

Hi, I have some light switches and the $Status isn’t returning what I thought it would. I am checking for:
Dining Room Lights $Status is ‘ON’
In the Logging I see : Comparison (string) ONLINE is (string) ON = false (3ms)

It’s returning ONLINE instead of ON.

How would I be able to tell if the light switch state is ON or OFF?

I am using Eaton RF9540-NAW ASPIRE Single-Pole Multi-Location Master Dimmer Light Switch

What about this? Or something similar using seconds to make sure it is captured?

Capture

Yes, SharpTools can directly control the arrived() and departed() commands of a Simulated Presence Device:

Here’s some documentation on taking an approach similar to yours with WiFi Near:

And a SmartThings community member put together a really nice profile using GeoFences with AutoLocation which provides high precision presence detection with low battery consumption:

This can help you reliably trigger presence based events in webCoRE. :smiley:

2 Likes

You should be checking for ‘switch’ is on or off.

Thanks. I’ll give that one a shot. Can you tell me how to enter the “followed within” command. I can’t seem to figure that out.

This is brilliant. I’m going to do this now before I create too many pistons.

I’ll give Sharptools a look. Thank you.

1 Like

Click on the “and” and change the logical operator. To edit the “followed by” part, edit the second expression.

Fantastic, thank you. I’ll give that a shot!

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