Closed krlaframboise closed 8 years ago
Let's add the variable formatting here too? :) Some of the above functionality can be achieved by using Follow-Up pistons, but that would be cumbersome. Haven't given up the idea of having loops. There is also a "Repeat whole action" task that would repeat all the tasks of an action indefinitely. Loops are close.
I actually got the beeping escalation portion to work using the repeat action and a variable that gets incremented each time it ran, but I couldn't find a way to use that variable to make it stop repeating. I'll play around with the new Follow-Up piston feature tonight.
Variable Formatting:
Last week a user reported the Thermostat Operating State wasn't evaluating to true, but it ended up being because the SmartThings DTH they were using sets that attribute to something like "cooling to 74F" instead of just "cooling".
Considering how flexible CoRE is, I wanted to see if I could create a way to get around that so I created a variable that stored the thermostat operating state in it. I also created a variable that combined the words "cooling to " with the cooling setpoint and the temperature unit.
If the Thermostat Operating State is cooling, those variables should have the same value.
Unfortunately I wasn't able to get it to work because when the cooling setpoint was saved to the variable, it formatted it as 74.0 instead of 74 so that's the main reason I asked about the ability to format variables.
The ability to apply regular expressions would be really cool, but that's probably pushing it...
I can add a few more comparisons for strings:
contains does not contain starts with does not start with ends with does not end with matches pattern (regexp) - nothing is "pushing it"
One other thing I could do is modify the cast from string to int/float to remove all non-digit characters before attempting to convert. This would fix your problem.
I think adding those comparisons options would be a huge help.
The matches pattern comparison should allow you to compare anything you want so removing the non-digit characters probably isn't need and might not be wanted in some situations.
Edit: You said "modify the cast from string to int/float to remove all non-digit characters", wouldn't that be the other way around or did I misinterpret what you were suggesting?
Would the matches pattern comparison have an implicit cast to string so it would work with all data types?
Can this be closed?
Yes, it works exactly as I hoped it would. Thanks.
This isn't a bug or feature request, but you said I should post it here so it doesn't get lost...
Any suggestions on how to implement the logic below or if it's even possible at this point?
I'm trying to avoid having to do something like: