New to Webcore - Couple of Questions RE my Piston


#1

Hi, im new to webcore and have a couple of questions. I read the wiki but its a little lacking in some areas.

Basically my simple piston turns on a switch which activates a fan if the room temp is above 62F, its in night mode and its less than the room temp outside.

The issue I have is that it seems the temp changing for the outside temp doesnt actually trigger the webcore in my testing. so i switched to an every 5 min check which does in fact work but I am wondering if i am doing it correct and if its normal that the temp change eventdoes not trigger the webcore? I am guessing maybe this is related to having to poll twcweather?

Another question is I noticed the memory usage % has been going up while this is running for half a day, it started at like 9% and now its up to 49% and i am assuming its going to hit 100% soon. Is this normal? will it do some kind of garbage collection at some point or will it just crash?

Thanks


#2

I actually don’t think you need to have it execute every 5 minutes. I believe it will monitor these conditions and when they are true the light will turn on and when they aren’t true anymore the light will turn off.


#3

@pcgirl65 is correct although you need to change your first condition to motion sensor 1’s temperature becomes greater than 62 to make it a trigger. Leave the others as conditions and remove the every and this will do everything for you.


#4

Try it this way:

As the others stated, get rid of the ‘Every 5 Minutes’; it’s not needed.

IF
-Motion Sensor 1’s temperature is greater than 62*F <------this is your trigger
–Then
–IF
—Location Mode is Night
—and
—{{twcweather.conditions.temperature}} is less than Motion Sensor 1’s temperature
—THEN
----WITH
-----Switch 1
----Do
-----Turn On
----end with
—ELSE
----WITH
-----Switch 1
----Do
-----Turn Off
----end with
–end if
-end if


#5

Thank you every one for the replies.

I redid the piston as you all recommended and it SEEMS to be working based on the debug log. The only issue is it seems the twcweather is not updated very often or triggered often enough as it evaluated when the outside temp was 45 and then didnt run and evaluate again to over an hour later when the temp was 56. I am not sure if it will trigger instantly though when the twcweather temp exceeds the sensor temp though as that hasnt happened yet.

Only issue is the memory is still rising, its up to 70% now. Still not sure if this is normal or if its heading to an issue when it hits 100%


#6

You should change your first if to

 if motion sensor 1's temperature rises above 62 F            <--- trigger
then

That will make it the only trigger and the weather will be evaluated when only when the temperature drops below 62. Then this should work as expected.


#7

@guxdude I am curious how rises above 62F is different than the way I have it? It says my sensor 1 temp greater than 62F is also a trigger (with the little lightning bolt next to the line).

I would just like to understand how webcore treats these two things differently, thanks much.


#8

Right now all your conditions have lightning blots (are triggers) because they are all conditions: Things that are true right now. When all your ifs are conditions, they all become triggers. When you switch the first to ‘rises above’, it looks at a transient event. Once you change one to a trigger, the others will no longer be triggers. So making this change will reduce your triggers down to one so that will be the only thing to make this piston run. Then once it runs, it can check the current condition of the other items to see if it should proceed to turn on the heater. This is the appropriate logic. e.g., You don’t want the switch to turn on just because the outside temperature is less than inside so you shouldn’t trigger on it. Here is more on triggers vs conditions:

One other note I neglected to mention. When you change your first if to ‘rises above’ you really should separate your ‘else’ into a second, separate if looking for ‘falls below’ to know when to turn off the heater.


#9

Sorry… I should have caught that in my example.

Something “is” something… is not a trigger.

Something “becomes” something… is a trigger


#10

Thanks much for the help.

now i am trying to expand things so that i can adjust the set temp. i created a variable in the define seciton and my plan is to have it so when i press or hold the smartthings button it will change the variable but i can NOT for the life of me figure out how to set a variable. it doesnt say in the wiki and i see other people in their code have do x2 set variablename = setting but i cant figure ouit how to do this! its driving me nujts. i have show variables enabled.

also, the button only shows pressed and held as actions, it seems to be missing the double tapped option that is available within smartthings.


#11

If you create a variable up top, and leave it (no value set), then at anytime in the code below, you can change the variable to whatever you want.

temp


#12

@wcmore thank you so much, your example made me realize what i was doing wrong. I didnt realize i had to do “With location” first before I could set the variable! I didnt see that in the docs at all.


#13

Set variable and many other commands are built-in to webCoRE, meaning they can be placed inside any block. Location just happens to be the default that I use.