First piston attempt - Motion sensor, Time issue


#41

Sorry if my last post seems overwhelming. I tend to think outside the box, LOL

Do you notice the lightning bolts on the left of line 22, 26 & 70? These are the commands that are ‘subscribed’ to… Meaning, the things that webCoRE is told to monitor for this piston. It usually subscribes automatically, but there are other factors in play, so sometimes we have to manually ‘subscribe’ to certain things. I forgot to do this on my example above for the motion sensor.

To fix my boo-boo, you can edit line 31 & 51 (Motion sensor is active)…
Then click the gear at the bottom of the popup window,
and choose Always subscribe under subscription method.

Alternatively, what I do, is keep the three time commands in one piston… and make the sensor commands in another piston. The only change required to do this method is the 2 variables would need to be global instead of local like they are now.


#42

Ok I’ve subscribed on those lines. Let’s see if everything works OK.

Amazing how complex webcore can be. Got a hell of a lot to learn


#43

Just an update for anyone who may find this useful.

I’d like to give @WCmore a massive thank you! As he has basicly written my piston for me and taught me so much about how webcore works. Here’s what he came up with

Piston now works exactly how I first imagined it to and I hope it may help someone else in the future


#44

I just want to add a small note for anyone else trying this code.

This piston uses variables, which will automatically set themselves at certain times of the day. What this means is when you first test it, it will not work (since the variables have not populated yet). You can either (A) Leave the piston running 24 hours and it fixes itself, or (B) On the ‘Piston Status’ page, scroll down to the ‘Local variables’ section and manually enter in the variables yourself