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

Not sure I know the difference. Live and learn. I’ll eventually sit down and figure out how I started installing webCoRE and ended up with CoRE, and why there are 2 different CoRE’s alltogether.

What Robin said… :wink:

1 Like

Wanna go ahead and say im sorry. Because im new to CoRE/webCoRE in general. I had a few pistons setup in core and they MOSTLY worked (the only reason they didn’t is due to my ignorance). So i transitioned to webCoRE about a week or so ago. I think right now, my problem is ive been staring at it so long, that my brain is fried. lol. My first idea was to create 3 separate “Arrival” pistons. One for when i came home, One for when my girl friend came home, and one for when we both arrived together. Never could get it to work right. Felt like i was close, but wouldnt do what i wanted. So said screw it, and went back to a single “We’re Home” piston.

Now my question is, would i use “ELSE” to turn certain lights on ONLY after sunset? Is my logic here remotely right? Or did i totally over complicate it all? Again. Dumb easy stuff i know. Sorry, and thanks in advance for any help!

@Townsmcp it was worth a quick try. Let me take a look at that piston in a couple of hours and reply with more data.

Thanks.

EDIT: you are just using your phones as presence sensors? nothing fancy like @ptdalen? :slight_smile:

1 Like

Thanks @bangali. Just using the iPhone ST app for Presence. Unless you can recommend something more reliable? My wife doesn’t use the ST app for anything but has to go into it every few days as it seems to stop tracking her. If you mean the suggestion about using an Asus router and editing the code I don’t have that option

Definitely nothing complex! I guess this is one instance where my simplicity due to lack of understanding paid off :grin:

@Townsmcp ok. yeah, i use iphone ST app as well. strangely have never had an issue with it so long as Background App Refresh is turned ON.

in the piston the if condition at line 29 and 40 seems to be repeated. trying to understand the purpose of doing so?

thanks.

I had the same issue when I first imported your piston. Changed all ifs to changes to. Seemed to work so far. But I think if there are 2 of you leaving or arriving it misses one.
edit: I do see that it missed me coming home.

One uses “any” of presence sensor. The other one uses “All”.

thanks. didnt realize the any or all does not show up in the view screen.

i suspect, if using changes to with all in the if condition, that will not work as desired for this piston. will wait for @Townsmcp to respond:

  1. if it fixes the triple notification problem per user
  2. if it notifies for all users arriving or leaving

@Jeff_Inderbitzin Using the piston as is from the picture above (using ‘present’) then it tracks everyone correctly regardless if everyone left together or separately - its just the annoying multiple notifications with this one saying ‘came home’ followed by ‘left home’ etc.

@bangali - when set ‘present’ to ‘changes to’ for ‘any’ on line 27, it seems to only track one person and wipes out the WhosHome/WhosAway variable. Also, it seems to be reverse tracking (i.e. I have set the virtual sensor to be away and the piston is sending notification user is home and vice versa).

Changing ‘present’ to ‘changes to’ on the ‘all’ statements (and leaving ‘many’ statements as ‘present’) on line 33:

  • 1 leaving/coming home - Tracks who’s home and who’s away in the variables. Double notification of arrival/leaving when actual leaving - first notification is leave, second is arrive. Single notification of arrival when actual arriving.
  • 2 leaving/coming home at the same time (3 seconds apart) - Tracks who’s home and who’s away in the variables. Single notification of just one of the two who have left. SHM doesn’t change. Single notification of just one of the two who came home.
  • 2 leaving/coming home with 5 minute time difference - Tracks who’s home and who’s away in the variables. Double notification (away followed by home) of first person to leave home. Single notification of the 2nd person to leave home - notification is person has left. SHM doesn’t change

TOPIC: Can webCoRE recognize an attempt to change a switch/relay to a state that it is already in?

I am having a bit of a problem. I use Alexa with many real and virtual switches. I have a physical relay that I use to turn my water heater on and off. It does so automatically given a variety of variables. However, I want to maintain the ability to turn it on and off by verbal command when the need or desire arises. Right now, I can simply say, “Alexa, turn on my water heater”. And she replies, “OK”. That’s all fine and well. But I wanted to design a simple piston that would report back “The water heater is now on.”, “The water heater is now off”, “The water heater is ALREADY on”, or "The water heater is “ALREADY” off… using my SONOS speakers. Which brings me to the meat of my question…

Is there a way for webCoRE to know that I have attempted to turn on a switch that is ALREADY on… or turn off a switch that is ALREADY off? I can figure out how to do this using two virtual momentary switches using different Alexa commands for each. One would be “Turn on SWITCH A” when I want to turn it on. Or, “Turn off SWITCH B” if I want to turn it off. But I don’t want to do that. Besides, there are other applications in my mind where this would be useful. I would like to skip the step of having Smartthings report the status to me first. I just want to issue a single command to a single switch and have it perform that operation OR report that the switch is already in the desired state.

As a bonus question. (I can probably figure this one out… but hey, while I’m here amongst you geniuses)… could I get webCoRE to report how LONG the switch has been ON/OFF? Wouldn’t want to hop in the shower if it’s only been on a minute, would I? So, if I said, “Alexa, turn on the water heater.” But the switch is already on, it could report back through my SONOS speakers, "The water heater is already on and has been on for the last XX minutes/hours. Again, I think I can dig through the system variables to figure that out, but while we are here thought I would ask. Thanks in advance.

thanks. the third presence sensor is a virtual presence sensor for the home?

I have a virtual switch that I want to toggle to the “on” position if motion is triggered. However, I only want this switch to toggle once, not on every instance of motion. Is it possible to allow a piston to only run once and then stop? Even with a timer, the piston still runs again when the motion is triggered again. I have a feeling this might be accomplished with piston state changes and task policy, but this still seems to be over my head.

Not totally sure on this but I’m thinking off the top of my head and still very new to st and webcore maybe the others can build on this or improve

So in the Alexa app you would create a group with a custom name and add to it the water heater which it already controls and the other would be a routine you make in smart things that would turn on a virtual switch.

Then in webcore you would make a piston that would basically have a true or false variable like "waterheaterison"where if the statement is false it will turn on the water and if it is true it will read out a message on your sonos speaker

Something like
If virtual switch 1 is on
Then
Set waterheaterison to true

If waterheaterison is true
And
Virtual switch changes to on
Then
Speak and resume " water heater Has been on for {age of virtual switch} amount of time

@bangali yes. It’s a Nest presence sensor. It controls the Nest system going into Eco mode (basically away temperatures to go from say 22°C to 10°C to stop pipes freezing over in winter etc). That’s why it’s set as an item to be changed to away/home based on people presence - basically it’s just a virtual switch really

got it, thanks. will look at piston tomorrow.

thank you! I will try this now. many thanks for the help!

@Townsmcp what is the nested for loops for? bit concerned if its corrupting $device because both loops use $device and one is inside the other.

ok, here is the first pass. should work, but cant test it easily at night. if you are feeling brave, would love to hear whats working or not :slight_smile:

EDIT: please check the change i made to unnest the for loops. maybe they should be nested and i am missing something there …