CoRE and Piston Rules Engine, first design steps

Didnt monitor this afternoon and I am mow able to see the scheduler timers associated with the invoking statement - all I have asked for. Awesome - blown away - donated cheers!!! Keep the good stuff coming.

1 Like

After posting this in the wrong thread, here goes:

Okay, hereā€™s the BIG news. v0.0.061.20160602 - Alpha test version - Minor bug fixes. Introducing the Follow-Up piston. Chain them together, delay them forever, do whatever you need with them :slight_smile:

Follow-Up pistons are just like the Simple pistons. The only differences are:

  • does not support triggers
  • does not subscribe to anything

They can be initiated from other pistons via the Follow up with piston task. This task can be delayed just like any other using the Wait task in front of it, so you can technically say "IF (this) Then (that) Else (wait 5 min, follow up with piston).

Even better, you can follow up with the piston over and overā€¦ the follow up piston can follow up with another piston, even itself. Combine that with a global variable counter and you can have a complex solution where something initiates the counter, does things and follows up with a piston that can follow up with itself x times until either your expectations are met, or the counter hits 0, hence giving upā€¦ I guess, unlimited possibilities :slight_smile: Enjoy.

5 Likes

Thank you :slight_smile:

Where would one donate? Iā€™d love to show my appreciationā€¦

1 Like

@Kevin_Prefer

When I get to my phone, Ill be donating too!

1 Like

Thanks for adding the dashboard, it works great.

Do you think at some point you might be able to add a formatting option for variables?

Examples:
{someDate:MM/dd/yyyy}
{someDecimal:#}
{anotherDecimal:#,##0.00}

2 Likes

LOL - Iā€™d have to invent God Mode for thatā€¦ way beyond expert :slight_smile:

UPDATE: I should call this the my-momma-is-an-expert-and-Iā€™m-better-than-her mode.

1 Like

Bam! Done. Use v0.0.061 LOL - I am so happy I decided to go with hexadecimal, or else Iā€™d be running out of numbers 000-999ā€¦ LOL Chrome and Firefox are eating dustā€¦

1 Like

Follow up to this. When I create a new piston and hit ā€œDoneā€, it goes back to the CoRE ā€œhomeā€ page and not to the SmartApps page. And eventually the new piston shows up in the list, so that appears to function as expected. Itā€™s only when you tap ā€œDoneā€ on an existing piston that it skips back over the ā€œhomeā€ page to the SmartApps page.

I gave this a shot and received ā€œYou cannot currently add thisā€ I believe it was.

What canā€™t you add? Hold on, making some changes to the follow up. Will allow any piston, ask for delay, and possibility to return resulting piston state to a variable. Also adding Execute piston which would not have the delay. Also, follow-up pistons should not schedule time events. It does as of now, bug.

[quote=ā€œchickwebb, post:2487, topic:46546ā€]
When I create a new piston and hit ā€œDoneā€, it goes back to the CoRE ā€œhomeā€ page and not to the SmartApps page.
[/quote]Just to add my $.02ā€¦ I am certain this was new behavior, beginning roughly 7-10 days ago.

Iā€™ll look into it. Got an Android tablet that acts like that.

Meanwhile, updated the Follow Up to have a delay and a variable too. So if anyone used that, please revisit that task.

Also added Execute piston (which does an immediate execution on the piston and can return the new state)

v0.0.062.20160602 - Alpha test version - Updated Follow Up and added Execute. Not fully tested yet.

1 Like

Hey guys what would be the best way to create a piston that will wait for my lock to be unlocked for at least 5 minutes before triggering any actions?

You can start with a conditionā€¦
If lock is locked then
Using devices
Wait 5 minutes
Do stuff
Cancel on piston state change

1 Like

Thanks for the quick fix. Looks good on my end. But my end goal of triggering on global variables may not be necessary with the new ā€œFollow-upā€ pistons. Iā€™m still playing around with those.

Thank you @ady624 I knew I was missing something!

1 Like

This:

You need to update the code. And itā€™s probably saying that because it was (at first) only allowing Follow-Up pistons and you havenā€™t yet created any. The latest version allows you to ā€œexecuteā€ any piston. Execute is immediate, whereas Follow Up allows for a time delay (built-in wait). Also, the ā€œFollow-Upā€ pistons never run on their own, only when executed by other pistons.

Gotcha!

So, if the follow up piston does not need to function seperately (other than to have seperate on / off selectability) than is it safe to say it no longer needs itā€™s own trigger?..only that of the lead app?

Hope that made sense.