WebCore amateur looking for piston help


#1

1) Give a description of the problem

I’m trying to create a piston that turns on a switch when on one of my ST sensors is 17 degrees or below. But I only want this to happen between a set time each morning and for the switch to turn off once it is outside of this bracket.

I’ve attached my attempt, but I’m a little confused by all of the many options and definitions. Could someone help me understand if what I’m doing is correct, perhaps someone could also help me understand how to use ‘else-if’ command in layman’s terms? I’ve Googled a few explanations but I’m still finding it a little confusing unfortunately… :confused:

Many thanks for your help :slight_smile:

4) Post a Green Snapshot of the pistonimage
(UPLOAD YOUR IMAGE HERE)


#2

Here’s my second attempt, this time using a boolean variable, is this better the the above? It would be great to get some direction if I’m on the right path here :slight_smile:


#3

I suggest just using one if/then/else. Both your pistons have multiple if/then in them.

Example:

If
Contact sensor is less than…
And
Time is between …

Then

With switch
Turn on

Else
With switch
Turn off


#4

Thanks @jkp

If I took your approach does the switch (in this case my heater) turn off after 6.45am even if it was triggered due to a low temp?

Thanks again :slight_smile:


#5

Yes, because your time is defined and when it is out of the time range, it will shut off as set up in the else section.


#6

Great thanks @jkp it’s things like this that are really helpful to understand.


#7

Scan through the example piston section for ideas of what can be done using WebCORE.


#8

Thanks again @jkp

I’ve adjusted the piston according to your recommendations, does it look ok to you?


#9

Still not right. You have that second if embedded that is not needed, also not set up properly since if is not defined.


#10

Ah sorry, yes I see what you mean now, a remnant of my messing around. Does this look any better, again, sorry for my amateurishness!


#11

That should do it. I was about to attach an example (which I should have done earlier) but you did it! Only thing I may suggestion… perhaps removing the only while night on the turn on. You already have it defined in the if section. Also, when is your night set to end? it might cause issues with your set time depending on when it is set to end.


#12

Thanks @jkp .

I put it in because I don’t want it switching on if I am away. Is there a better way to do this?


#13

You can use when location mode is not away instead of location is night.


#14

Brilliant, thanks for the tip. Updated below:


#15

Just saw the ‘only while night’ element in the ‘then’ section, will remove that too!


#16

You can take out that “only while night” in the turn on command :slight_smile:


#17

And click on test and select trace at the bottom of your piston for fun.


#18

Hi again @jkp

I’m having issues with the above piston. Basically the logs are showing that the piston is polling the temperature sensor at random intervals and if the temp is +17° then it’s sending an off command. Polling is seemingly not patterned and happening at random times, sometimes every 30mins sometimes every hour/2 hours etc.

All well and good, but I only want this automation to enact during the scheduled window. For example this eve I manually put the heater on then it switched off automatically 15mins due to the piston polling the temp sensor and sending an off command.

Can you tell me how to stop this from happening? Here’s the piston in its current state.

Many thanks again for your help.


#19

Here’s the log that switched off the heater this eve:

30/10/2017, 20:14:56 +467ms
+1ms ╔Received event [Kitchen Door].temperature = 19 with a delay of 493ms
+190ms ║Runtime (37589 bytes) successfully initialized in 83ms (v0.2.0fb.20171026) (188ms)
+192ms ║╔Execution stage started
+923ms ║║Executed [Heater].off (710ms)
+926ms ║╚Execution stage complete. (735ms)
+929ms ║Setting up scheduled job for Tue, Oct 31 2017 @ 6:00:00 AM GMT (in 35102.605s)
+943ms ╚Event processed successfully (943ms)


#20

Can anyone help me with this piston’s polling issue that turns off the switch outside of the prescribed window? Is it possible to limit the requests to a certain time frame? Or perhaps there’s something I could change with the piston?

If it’s just a nuance I need to accept, that’s fine too, but I’d just like to know either way :slight_smile: