LarryCRetired Posted October 4, 2020 Posted October 4, 2020 I have created a variable in the ISY and I am using that variable to compare to the voltage level shown for the Wireless Tags. Here is my program. The value for the Tag Battery Voltage in the ISY is 2.753 and the value of the variable - $i_Env_Tag_Voltage_Min_Level is 2.800 volts. The Precision is set for three decimals. The program does run but the If statement ends up being False. Any thoughts would be appreciated. Thanks
larryllix Posted October 4, 2020 Posted October 4, 2020 27 minutes ago, LarryCRetired said: I have created a variable in the ISY and I am using that variable to compare to the voltage level shown for the Wireless Tags. Here is my program. The value for the Tag Battery Voltage in the ISY is 2.753 and the value of the variable - $i_Env_Tag_Voltage_Min_Level is 2.800 volts. The Precision is set for three decimals. The program does run but the If statement ends up being False. Any thoughts would be appreciated. Thanks The program can only ever run true when the ISY clock runs the program at exactly 1:37 PM. I am not sure how you are testing it. The 2.8 volts will alarm with the batteries about 50% left, in cold environments, and almost dead in warm environments.
LarryCRetired Posted October 4, 2020 Author Posted October 4, 2020 larryllix The program shown is my little test case. I also tried the program with an else statement to verify it was running. At an earlier time, the program ran the else when it should have run the Then. Could the value of the voltage in the ISY be treated as an alpha numeric and is that why the program IF statement believes it is not True. I have used the Tag values for Temperature in the ISY and the IF statements work fine
garybixler Posted October 4, 2020 Posted October 4, 2020 (edited) If you just do a run using either the then or the else setting your variable to the tag voltage you may see that it is not corresponding. Temp and battery level works but it seems that voltage loads a different number. Some tag values expressed as raw don't seem to load the correct number into the variable. Else $Tag_Voltage = 'Polisy Nodes / Tags / Home / 0 Taga' Battery Voltage Edited October 4, 2020 by garybixler
larryllix Posted October 5, 2020 Posted October 5, 2020 As per @garybixlerabove but take the time condition out of the If section, and then you can either wait for the value to change, or run the If section manually to your hearts content, until you have it figured out. Then replace the time restraint condition.
garybixler Posted October 5, 2020 Posted October 5, 2020 (edited) Unfortunately I think that the 'tag voltage' is being seen as text rather than a number because a variable can't be set to equal it unlike the other numerical values. So the 'tag voltage' could never be compared to a variable. At least that is what I am seeing after doing some testing. Edited October 5, 2020 by garybixler
larryllix Posted October 5, 2020 Posted October 5, 2020 (edited) This has come up before where two variables are compared. What you see is a rounded off value based on the NS programmer's algorithm which may not be the same value the ISY rounds off to. 2.99999999 is not 3.00000000 The < should have worked though. Edited October 5, 2020 by larryllix
garybixler Posted October 5, 2020 Posted October 5, 2020 True but what I am seeing is that the 'tag voltage' can't be equaled into a variable which leads me to think that it is a non-numerical value. All the other numerical tag values can be equated. Doing the following seems to be ignored with no value entered. $Tag_Voltage = 'Polisy Nodes / Tags / Home / 0 Taga' Battery Voltage. Using different precisions has no effect either.
Javi Posted October 5, 2020 Posted October 5, 2020 43 minutes ago, garybixler said: True but what I am seeing is that the 'tag voltage' can't be equaled into a variable which leads me to think that it is a non-numerical value. All the other numerical tag values can be equated. Doing the following seems to be ignored with no value entered. $Tag_Voltage = 'Polisy Nodes / Tags / Home / 0 Taga' Battery Voltage. Using different precisions has no effect either. The value is numerical but raw. I believe "a.bcd" would be equal to "abcd". That said it appears you are correct that the voltage does not update its value to a variable so there may be an issue with the nodeServer or this may not be a comparable type. Maybe @Jimbo will know. "Battery level" appears to work so this may be a work around until the Voltage issue can be resolved. Jimbo, is it possible that this does not work because there is no "prec" declared in the Editor? 2
Jimbo.Automates Posted October 5, 2020 Posted October 5, 2020 The value is numerical but raw. I believe "a.bcd" would be equal to "abcd". That said it appears you are correct that the voltage does not update its value to a variable so there may be an issue with the nodeServer or this may not be a comparable type. Maybe @Jimbo will know. "Battery level" appears to work so this may be a work around until the Voltage issue can be resolved. Jimbo, is it possible that this does not work because there is no "prec" declared in the Editor? That's possible, I'll try to take a look.Sent from my Pixel 3 XL using Tapatalk 1
LarryCRetired Posted October 5, 2020 Author Posted October 5, 2020 Thanks to everyone for your thoughts. Jimbo, please don't go through a lot of work for me. Unless this is something others want, I can just email the voltages every morning and scan for any battery issues. Now that I know it is not something I am doing wrong, I can move on from here. Thanks for everything you have done. 1
Jimbo.Automates Posted October 6, 2020 Posted October 6, 2020 @Michel Kohanim or @Chris Jahn, or anyone, I have fixes ready to release, but have an issue. I have this editor: <editor id="VOLT"> <range uom="72" min="0.001" max="999.999" prec="3"/> </editor> Which is referenced in the nodedef for CV: <!-- Tag 13 F --> <nodeDef id="wTag13F" nls="tag13"> <editors /> <sts> <st id="ST" editor="BOOL" /> <!-- Status, online? --> <st id="GPV" editor="I_TAGID" /> <!-- TagId (SlaveId) --> <st id="GV1" editor="I_TAGTYPE" /> <!-- TagType --> <st id="GV13" editor="I_INTEGER" /> <!-- Time --> <st id="GV14" editor="I_INTEGER" /> <!-- Seconds since update --> <st id="GV8" editor="BOOL" /> <!-- Out Of Range --> <st id="CC" editor="SIGDBM" /> <!-- signaldBm --> <st id="ALARM" editor="I_EVST" /> <!-- Event State --> <st id="GV7" editor="I_LIT" /> <!-- Light --> <st id="CLITEMP" editor="I_TEMP_F" /> <!-- Temperature --> <st id="CLIHUM" editor="I_HUM" /> <!-- Humidity --> <st id="BATLVL" editor="BATLVL" /> <!-- Battery Percentage --> <st id="CV" editor="VOLT" /> <!-- Battery Voltage --> <st id="GV2" editor="I_MOTION" /> <!-- Motion --> <st id="GV3" editor="FLOAT" /> <!-- Orientation --> <st id="GV4" editor="FLOAT" /> <!-- X-Axis --> <st id="GV5" editor="FLOAT" /> <!-- Y-Axis --> <st id="GV6" editor="FLOAT" /> <!-- Z-Axis --> <st id="GV9" editor="I_TMST" /> <!-- Temperature State --> <st id="GV10" editor="I_CPST" /> <!-- Moisture State --> </sts> <cmds> <sends /> <accepts> <cmd id="SET_LIGHT"> <p id="" editor="I_LIT" init="GV7" /> </cmd> <cmd id="SET_URL_CONFIG" /> <cmd id="QUERY" /> </accepts> </cmds> </nodeDef> and it shows up properly on the admin console: But this program always shows true: TestLux - [ID 0089][Parent 0001] If 'WirelessTags / Home / Back Patio' Battery Voltage is not '$i.test.p3 Volts' Then $i.test.p3 = 'WirelessTags / Home / Back Patio' Battery Voltage Volts Else - No Actions - (To add one, press 'Action') I can run the program and it properly sets the variable, but it always shows True? 1
Javi Posted October 7, 2020 Posted October 7, 2020 @Jimbo , I think you are on to something. This appears to be the behavior in other nodeServers as well as the following will always be true also. NodeDef <st id="GV16" editor="UV"/> Editor <editor id="UV"> <range uom="71" min="0" max="15" prec="1"/> </editor> Variable Test - [ID 0084][Parent 000F] If 'WeatherBit Weather' UV Index is not '$Int_test UV Index' Then Set 'Devices / Basement / Basement Computer Room Lights' Beep $Int_test = 'WeatherBit Weather' UV Index UV Index Else - No Actions - (To add one, press 'Action')
Javi Posted October 7, 2020 Posted October 7, 2020 Maybe the above is not true as when the prec of the variable is set to match the prec of the value it will now work as desired
Jimbo.Automates Posted October 7, 2020 Posted October 7, 2020 I had my variable precision to match, so not sure.The changes are released if anyone wants to try. See the readme for info.Sent from my Pixel 3 XL using Tapatalk 1 1
Javi Posted October 7, 2020 Posted October 7, 2020 15 minutes ago, Jimbo said: I had my variable precision to match, so not sure. The changes are released if anyone wants to try. See the readme for info. Sent from my Pixel 3 XL using Tapatalk The battery voltage program is woking over here. I did reboot my ISY just in case. Thanks! 1
Michel Kohanim Posted October 7, 2020 Posted October 7, 2020 Sorry @Jimbo and @Javi, is it working or not working? With kind regards, Michel
Javi Posted October 7, 2020 Posted October 7, 2020 1 minute ago, Michel Kohanim said: Sorry @Jimbo and @Javi, is it working or not working? With kind regards, Michel Working on my end 1
Chris Jahn Posted October 7, 2020 Posted October 7, 2020 17 hours ago, Jimbo said: @Michel Kohanim or @Chris Jahn, or anyone, TestLux - [ID 0089][Parent 0001] If 'WirelessTags / Home / Back Patio' Battery Voltage is not '$i.test.p3 Volts' Then $i.test.p3 = 'WirelessTags / Home / Back Patio' Battery Voltage Volts Else - No Actions - (To add one, press 'Action') I can run the program and it properly sets the variable, but it always shows True? What is the precision of variable i.test.p3? When you look at i.test.p3 the variable table, does it show the expected value?
LarryCRetired Posted October 7, 2020 Author Posted October 7, 2020 Jimbo Thanks for fixing this. My program now works comparing the voltage to a variable with a three precision and also comparing to a value in the drop down option. Thanks again. 1
Jimbo.Automates Posted October 7, 2020 Posted October 7, 2020 Thanks all, yes it is working. I must have not reopened the AC or something...Sent from my Pixel 3 XL using Tapatalk
Recommended Posts