Jump to content

Wireless Tag Voltage Monitoring in ISY


LarryCRetired

Recommended Posts

Posted

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

693079867_BatteryLevelPrograminISYforTagVoltage.JPG.f152e5aa8daa5aa40eb952f75edd8496.JPG

 

Posted
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

693079867_BatteryLevelPrograminISYforTagVoltage.JPG.f152e5aa8daa5aa40eb952f75edd8496.JPG

 

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.

Posted

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

Posted (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 by garybixler
Posted

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.

Posted (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 by garybixler
Posted (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 by larryllix
Posted

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.

Posted
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?

 

  • Like 2
Posted
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

  • Like 1
Posted

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.

  • Like 1
Posted

@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:

image.png.087be8cef630806169e952b7b0a156f2.png

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?

 

  • Like 1
Posted

@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')

 

 

Posted

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

Posted
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!

  • Like 1
Posted
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?

Posted

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.

  • Like 1
Guest
This topic is now closed to further replies.

  • Recently Browsing

    • No registered users viewing this page.
  • Who's Online (See full list)

  • Forum Statistics

    • Total Topics
      37k
    • Total Posts
      371.4k
×
×
  • Create New...