@bamarayne This looks awesome! Gonna try to use this myself. Thanks so much for helping out with the flows.
I forgot about that! Sorry, I was eating a milky way.
@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?
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.
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ā¦
@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
@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.
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.
Perhaps not caps? Just trying to think of something.
I donāt have any capital letters in my global variables.
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
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.
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
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.