This is the forum archive of Homey. For more information about Homey, visit the Official Homey website.
The Homey Community has been moved to https://community.athom.com.
This forum is now read-only for archive purposes.
The Homey Community has been moved to https://community.athom.com.
This forum is now read-only for archive purposes.
Detecting Null variable
vaderag
Member
I have a particular Z-wave PIR that occasionally (yet frequently) decides not to report luminance
I have a flow that uses this luminance, however obviously if there is no value it does not activate. I would like this to activate when luminance is 'null'
I have tested outputting the value to my phone and it receives the string 'null', although the display next to the tag in Homey is '-'
I have tried setting up a logic variable as an OR command for #Luminance = null (and every card variant of it that i can) and also tried with the - but neither seem to activate
Can anyone advise how I can use this value?
Thanks!
Edit: I've even noticed that the Battery alarm is also reporting null when this issue occurs, so tried the following and still no dice...
I have a flow that uses this luminance, however obviously if there is no value it does not activate. I would like this to activate when luminance is 'null'
I have tested outputting the value to my phone and it receives the string 'null', although the display next to the tag in Homey is '-'
I have tried setting up a logic variable as an OR command for #Luminance = null (and every card variant of it that i can) and also tried with the - but neither seem to activate
Can anyone advise how I can use this value?
Thanks!
Edit: I've even noticed that the Battery alarm is also reporting null when this issue occurs, so tried the following and still no dice...
Comments
E.g if luminance < 30
If we could establish the string / value for null I'm sure it could work.
I think part of the problem however may be that it's a number value tag and I'm trying to match it to the string which is reported
If value fails then do something?
Maybe best to open a GH issue then for adding the -
I think if we tell @Kees de Vries that the temperature is null he will call for Rayonhoofden as he doesn't know the difference with the Temperature of 0 ;-)
If you really want to know it is possible using an one-liner in Homeyscript.
I tested two numeric Tags from which one is a 'null'
Paste below in a new script ( testForNull.js )
And drop the tag in the "Run a Script with an argument" but remove the spaces around the tag!
Keeping the Homeyscript open shows the result when testing.
Thanks so much for the script - worked a treat (once I'd worked out how to actually add a HomeyScript!!