So I’m setting up a good morning greeting, and it does, among other things, say things like how much precipitation in the last 24 hours via my weather station. However, if there hasn’t been any rain my weather station sets the variable to (not set) which when read as text is blank or null, and I would much prefer it either say 0, or different text. So I’ve setup on my variable updating piston a command that says ‘if variable is equal to (not set) then set variable to this’, but that doesn’t work. I’ve also tried null which didn’t work, etc. How can I get a piston to trigger off the state of a variable being (not set) ?
Triggering Piston off Null Variables?
No, I am using my BloomSky outdoor weather station that tracks not only if it is raining/snowing, but at what rate and total overall. I’ve found where I live that the general ‘weather’ reports for my area are waaay different than what I actually get, including wind speeds, etc. I am at the extreme north end of the area in which the weather reports are for my area. That said, getting exact readings from my back yard is just better anyways
That said, someone did help me in the smartthings forums on this, I had to use an expression.
“Try using an expression instead, try isEmpty(variableName),”
I have always compared these values to $args.$null
which is just an arbitrary argument that you know won’t be provided to the piston and will therefore not be set. isEmpty
is more elegant, thanks for that!