webCoRE - Piston help / do these already exist?


(Tmp R) #1

Hi Guys,

I’m probably just being lazy but I’ve had a quick look to no avail. I am capable of writing these but I was wondering if either something already exists, or someone who knows the syntax off the top of their head could knock these up in a few mins.

Here’s some pseudo code for what I want to achieve…

On Motion Detect

Only trigger if > 5 mins since last trigger 

send push notification

If Home mode
   Change mood lighting to Green and turn on 100%, then revert back to previous state after 1 min
   Flash decking lights on/off 2Hz then revert back to previous state after 30 sec
   If dark
       set front light to 100% brighness, revert back to 40% after 5 min
   endif
Else night/away mode
   if dark
   	  set front light to 100% brightness and turn on, turn off after 5 min
   	  if away mode
   	      wait 5 seconds, turn on hallway light 100%, turn off after 5 mins
   	      wait 10 seconds, turn on diningroom light 100%, turn off after 5 mins
   	  endif
   endif
endif

Thanks in advance!


(Tmp R) #2

Well I’ve more or less cracked it. I didn’t realise it was point and click for a start, I just thought it was a text editor, so the syntax is completely self-explanatory, although it is a little slow to work with. I do have a few questions if anyone can help…

  1. Is there a way to just edit the text or does it all have to be done via the point and click interface?
  2. Drag and drop seems really buggy, is there a better way?
  3. Can you rename a piston you’ve already created?
  4. Is there a simpler way of temporarily changing the state of a device. Say you want to set the colour/level to something then have it revert back to whatever state it was in. I’ve been storing everything to variables and restoring from these but it seems a bit clunky.
  5. What’s the best way of event throttling? So a motion event only fires once in 5mins.
  6. Is there a way to get an image from a URL at the point in time an event fires, then show this image to the user when they view the push notification, or view the events retrospectively on the dashboard?

(Mark) #3

CoRE was given its own sub-category in the forum a few months ago. So I moved your post there, might help you connect with the right people that can answer your questions.


(Robin) #4

No

When using drag and drop, pick up from the < > symbol in the gutter but then drop into the script area. If you try to drop into the gutter it’s not so easy.

You can also click the < > icon to highlight the block and then right click to copy to clipboard. Then, when you click on ‘add a new statement’ you’ll see what you copied (and everything copied before that) ready for pasting.

Yes, when editing a piston you can click on the name of the piston at the very top of the script to bring up the original piston settings window including the name field.

This is one of the few features from CoRE yet to be moved over to webCoRE. @ady624 posted about it somewhere and intends to do it at some point.

IF
{previousAge([device name: motion])} is more than 300000
THEN
do stuff

A future update will hopefully include Twilio integration, at which point things like this should become possible… but not yet.