Announcement

Collapse
No announcement yet.

Battery Value Always Matches

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    #16
    Originally posted by MNB View Post
    Thank-you Randy, I was imitating your example from an earlier posting (see below). I'm a little slow but after reviewing it wasn't sure why I needed to logic wise to declare the same thing twice (thought maybe it had something to do with HS quirk(s)). As this is not the reason, I think I will remove the AND IF's as they do not add any value and would reduce the Event size. Mike
    Originally posted by rprade
    "Yes. An IF or OR IF is a Trigger and is ignored. You can still use those triggers within your event so it will run autonomously, but if you also add an additional AND IF condition to each trigger that matches the trigger, it can run autonomously or manually with the conditions honored.
    What I was referring to is that those conditions allow the event to be run manually from another event, if you are not going to do that they can be removed without hurting anything.
    HS4 Pro, 4.2.19.16 Windows 10 pro, Supermicro LP Xeon

    Comment


      #17
      Did I mention "slow"... thanxs for the expertise and advise, Mike
      Computer: CUK Intel NUC7i7BNH
      Op System: Windows10 Pro - Work Station
      HS Version: HS4 Pro Edition 4.2.19.0

      Plug-Ins: AK Weather 4.0.5.25,APCUPSD 3.3.2.3,BLBackup 2.0.63.0,BLEditor 2.0.11.0,BLGData 3.0.55.0,BLOccupied 2.0.28.0,BLShutdown 1.0.6.0,Blue-Iris 3.1.3.33206,Device History 3.2.0.2,EasyTrigger 3.0.0.76,Harmony Hub 4.0.14.0,iRobot 5.22.41.1,JowiHue 4.0.8.7,Nest 3.0.0.34,NetCam Plugin 1.0.0.5,PHLocation2 3.0.0.64,Pushover 4.0.10.0,Random 3.0.0.2,Restart 1.0.0.7,Ring 1.0.0.9,SDJ-Health 3.1.1.3,Sonos 3.1.0.59,Sonos4 4.0.1.12,UltraCID3 3.0.6681.34300,UltraMon3 3.0.6554.33094,UltraNetCam3 3.0.6413.20219,Unifi 4.0.32.0,Zigbee 4.0.11.0,Z-Wave 4.0.3.0, and Jon00 scripts.

      Comment


        #18
        On a similar topic, I came across another script similar to the one posted here, (see attached) that I like as well. Unfortunately it is printing as integer, I tried to change it as decimal but still print as an integer value. Can anyone please help me figure out where in the script to change the value to appear as 9.2 instead of 9

        9 Battery Level Basement Addition Motion Sensor Basement Addition - Battery Level (8/20/2017 10:46:44 AM)

        Thanks,
        Aldo
        Attached Files

        Comment


          #19
          Originally posted by aldo View Post
          Can anyone please help me figure out where in the script to change the value to appear as 9.2 instead of 9
          I'd start by dimensioning BatteryStatus() as Double. If it's an integer it will not be able to hold the decimal part of the value.
          Dim BatteryStatus(100) As Double
          Also, use DeviceValueEx to retrieve the value. (DeviceValue returns an integer)
          BatteryStatus(i) = hs.DeviceValueEx(Device)
          Mike____________________________________________________________ __________________
          HS3 Pro Edition 3.0.0.548, NUC i3

          HW: Stargate | NX8e | CAV6.6 | Squeezebox | PCS | WGL 800RF | RFXCOM | Vantage Pro | Green-Eye | Edgeport/8 | Way2Call | Ecobee3 | EtherRain | Ubiquiti

          Comment


            #20
            Originally posted by Uncle Michael View Post
            I'd start by dimensioning BatteryStatus() as Double. If it's an integer it will not be able to hold the decimal part of the value.
            Dim BatteryStatus(100) As Double
            Also, use DeviceValueEx to retrieve the value. (DeviceValue returns an integer)
            BatteryStatus(i) = hs.DeviceValueEx(Device)
            Thank you very much , it did it.

            Comment

            Working...
            X