This is what I was looking for. I cannot find the “cancel on piston change” option. I ony see “execute on pistol change”. Where is this located?
Bottom of the Task building screen “Task cancellation policy”
Thank you! I was looking all over for it.
Just trying some new things out
If i have following piston
If Presence is not Present
Using Location - set mode to x (restricted between 6:30am and 6:00pm)
Using Location - set mode to y (restricted between 6:00pm and midnight)
When time becomes 6:00pm will mode y be set even though presence has not changed or do the restrictions only apply if the initial IF block changes state
Can we better define this?
What are acceptable thresholds? Where do we start seeing problems?
Are there today or are there planned facilities to provide metrics around over subscribed attributes within one’s system? What failures are resulting?
Are there plans to address this long term, through abstracting the device attributes, etc?
I had a similar issue with the GE 12727 (non-dimmer) and 12729 (dimmer). Non-dimmers distinguish between digital and physical but the dimmer does not. Seems like APP_COMMAND is added when the switch is physically pressed.
When working with Jason from support, he mentioned that a feature request would be put in to make both DTH’s similar and use physical or digital to distinguish, but so far I have not noticed a change.
I guess I don’t “get” global and local variables. I understand what they’re for, and have used them in other programming environments. But I just can’t seem to get them to work in CoRE.
If start in the Application Info and tap “Global Variables”, if there’s one there I can tap it and see name, data type, raw value, display value. I can delete the variable. Just now I deleted the one that was there so I could start with a clean slate.
So now if I tap “Initialize variables”, I get a screen that has “Variable to initialize” with the name and initial value already filled in from the last time I tried to use it. If I change the name to “Foo” and enter 0 for initial value and then tap “Initialize!”, I get “You are not authorized to perform the requested function.” But if I go back two screens, it will show me the variable “Foo” with the value 0, and if I tap on the variable name, it will show me that it has a datatype of “decimal”. If I do the same thing but enter “Zero” for the initial value, it shows me that it has a datatype of “string”.
Now, I’m seeing the expected datatypes given the initial values, but I need to be able to store a date & time, not a decimal or a string. If I enter something that looks like a date, or try to use either $now or @now, it still gives me a datatype of “string”.
- How do I create a global variable, and do I have to include the “@” or will it automatically be prefixed?
- How do I set a datatype for a global variable?
- How do I set a global variable to an initial value without getting the “not authorized” message?
- How do I set a global variable to the current value of some system variable? I just need to do this once to “seed” the value; my pistons will update it from there, but they need an initial value in it to test against.
- What is the answer to the ultimate question of life, the universe, and everything?
P.S. The same pretty much goes for local variables - I get the same types or errors when I try to define them in a piston.
I also struggled with how to kick variables off, and had no idea about the @ for globals.
Yes the @ is required, you need to explicitly put it there.
Thanks, I had pretty much figured that was probably true, but beyond that it still has all the other problems I described.
NThere is no need to initialize any variable. Simply use Set variable in an action, prefix it with @ to make it global (all pistons can read/write it) or don’t use the @ sign to make it local (only that piston knows of its existence). Date&time is stored as a long integer, namely unix timestamps. You can Set variable x = $now + 3 months if you want…
How would I do this with a variable?
I have a contact sensor on a door. When I close the door, I want it to trigger a piston that will send a text message every 12 hours, and stop when the door is opened. The catch is, I want the piston to send the message 60 days after the door is closed.
Would this work?
IF Contact sensor changes to closed Set variable $60_days to today's date THEN IF Date is equal to variable $60_days + 60 Happens at every 12 hours Send text message: "open the door"
I had this similar setup in RM using multiple rules. This piston turns the lights on fine but doesn’t turn them off and I’m sure it has to do with the wait location… Or maybe the cancel on state change
I want to wait until the garage door is closed and then wait 3 min and turn the lights off.
I was playing around with the idea of having multiple “Good Morning” messages and somehow having CoRE randomly select one. I was trying it with the Switch and Case options, but I’m not sure how to randomly select a case. If I put in a variable, it will only select the one case each time. In this example, my variable Talking = Talk 1.
I’m not sure if this is the correct way to approach what I’m trying to accomplish.
Most problems with turning lights off seem tp be generated by faulty DTH/devices that do not update in ST. Try disabling command optimizations in the piston options and report back please.
Try setting a variable like this:
Set number variable x = $random * 3
Then use the switch for variable x, but use cases 0, 1, and 2. Zero based.
Guess what the Follow Up piston is used for ;)))
At this point, you would need two pistons:
First, a simple piston called “Chief Door Spy”
IF Door is closed Using location...(cancel on piston state change) Follow up with piston "Warn me, Warn me" in 60 days (may need to use 1440 hours) ELSE Using location... Execute piston "Warn me, Warn me"
The ELSE is there to stop the Follow Up piston.
Secondly, a follow up piston called “Warn me, Warn me”
IF Door is closed THEN Using location... (cancel on piston state change) Send notification: "change the filter already!!!" Follow up with piston "Warn me, Warn me" in 12 hours
The trick: follow up pistons do NOT subscribe to anything, so the first simple piston has to get it both started and stopped. Once started, it will perpetually run every 12 hours due to the follow up, as long as the door is closed. If the door opens, the simple piston runs the follow up which would then evaluate to false, cancelling the current wait but not scheduling a new one, thus breaking the chain… Get it?
Glad I invented the Follow Up piston, you’re welcome looool (too much alcohol at the moment - no power after horrible thunderstorm… lol)
Thanks!!! It’s been a long couple of days here and my brain just wasn’t up to that much thinking… lol
I think I have it, but I’m not understanding how. I just did my test and case 2 was selected each minute during the test. However, my variable keeps displaying 0. With $random having a value between 0.00 and 1.00 I can see how my variable will almost always equal 0 as the probability of getting 0.00 through 0.99 are higher than getting 1.00. Thus 0 * whatever will be 0.
Ok, the problem is with casting - since the variable is number, the setVariables keeps trying to make that variable a number as it proceeds through the algebra. I’ve modified CoRE now to consider “number” as “decimal” during the math calculation, then convert it to “number” at the end. It now results in random numbers: 0, 1, and 2. Tested.
v0.2.13c.20160814 - Beta M2 - Minor fix regarding setting a number variable - allowing decimals during the calculus
Thanks @ady624 for the quick update. After updating, I ran it 3 times and case 2 then case 1 then case 2 was selected. Each time, the variable also updated.