[OBSOLETE] [BETA MILESTONE 1] CoRE (Community's own Rules Engine)

@bamarayne This looks awesome! Gonna try to use this myself. Thanks so much for helping out with the flows.

1 Like

I forgot about that! Sorry, I was eating a milky way.

1 Like

@ady624 have you ever thought about somehow adding the capability to import Pistons so that we can cut/paste rather than click through the UI?

Also, it might be good to get a collection of piston screenshots into a wiki for popular use cases? i.e. Garage Door Auto Closing seems to be popular, etc. We can provide a few examples of how people have built their pistons so they donā€™t always have to come to the forum? Is anyone working on something like this?

1 Like

@bamarayne why did you opt to use a latching piston here? Would an Or-If not work here as well?

It mightā€¦ But i use the latching because itā€™s simpleā€¦ Itā€™s basically two pistons in one in which one is false and the other is trueā€¦ Itā€™s perfect for situations like thisā€¦ I also use it a while lot fire for things like motion turns on a light and no motion turns it offā€¦ Itā€™s just been rock solid for me.

1 Like

If only it were easy. There are some undocumented features that I am going to look into for ā€œpastingā€ pistons in. Copy is easy, but creating a piston programmatically is not, because the Settings fields are read onlyā€¦

2 Likes

@ady624 any ideas about this? Iā€™m not able to use any global variables.

**edit - nevermind, I just looked at the code and see that it requires a $ in front of the variable name. Changed name from GateCounter to $GateCounter and it worked. Rookie mistake :slight_smile:

@ady624 Iā€™m still having issues. Now when I initialize a global variable with the $ at the beginning of the name, it tells me that it was successful, but then no variables show in my list. I have debugging enabled and log debug messages enabled, but nothing is written to the log.

$Test gives me a success message but no variable and no log entries.
@Test and Test give me the permission error and log entry from my post above. The variable shows in my list but not in any of the pistons when viewing in the dashboard.

What am I doing wrong now?

Without wishing to steal @ady624ā€™s thunder, I believe you need to put an @ in front of the variable to make it a global variable.
At least that is what I did.

2 Likes

I just edited my previous post. When I put an @ at the beginning I get the permission error and java null pointer exception in the logs.

Oh. Thatā€™s my knowledge exhausted. :worried:
Perhaps not caps? Just trying to think of something.
I donā€™t have any capital letters in my global variables.

Thanks for the ideas. I tried @test with the same results.

Argh. Just checked the pistons again and the variable are at the bottom of the list, thatā€™s why I wasnā€™t seeing them. I still get the error when creating them but it appears that they are working anyway. I added logic to increment to one of my pistons and it works correctly, and I can see the updated values in other pistons.

I feel dumb :blush:

I fell into that trap as well. My non global variables appear at the top and that was where I was looking also.
Sorry I didnā€™t remember and suggest you look there.

1 Like

Global vars use @

Try updating to the last version 12f

12e and 12d might have some issues with global vars.

Iā€™m on 12f

IMPORTANT ANNOUNCEMENT FOR CoRE PRE-BETA ADOPTERS:

If you installed CoRE early and have any pistons created prior to v0.0.085, you may experience a problem with rebuilding a dead piston. Some ā€œwhen trueā€ individual actions may be regenerated as ā€œwhen falseā€. If you are affected, just go to the affected individual action and scroll down to the state on which the action should run, select true and save the piston. The problem will not occur again, even if you rebuild the piston again at a later time. Thank you

2 Likes

Iā€™ll check the error on variable creation, though that should not be necessary. You do not have to create a variable to use it. Just use it in a Set Variable task and it should show in the list automatically.

If I just do a set variable without initializing, do I get to choose if itā€™s a local or global variable? I thought they defaulted to local.

Yeah, just use an @ in its name. Also, $ variables are read only, you cannot set anything to them.