Announcement

Collapse
No announcement yet.

Intermittent device value transition issue

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

    Intermittent device value transition issue

    I have a script which runs each night which reads the value of a few devices, updates a couple of virtual devices with the values, then zeros the devices which it just read. This works fine for my rain measuring devices and 99.99% of the time for my electricity consumption reading. Essentially, all I do is read the total daily power consumption from CC and write the log and update a "Previous Day Consumption" device with what was used the prior day.

    The few lines of code for this particular device are:

    eVal = hs.DeviceValue(30) 'electricity

    hs.WritelogEx ("Info", "Daily KW-Usage " & eVal & " kWH","#0000FF")

    'Electricity Yesterday
    hs.SetDeviceString (205, "<img src='\Images\MyImgs\Electricity.png' align=absmiddle> " & "<font size = 2 color='Green'> <b>" & eVal & " kwh used previous day</b>", true)

    I see this in the log.

    Jul-13 11:59:45 PM Info Daily KW-Usage 0 kWH

    Jul-13 11:59:45 PM Info Day total Sump Pump Count: 0

    Jul-13 11:59:45 PM Info Day total rain: 1.4 mm

    Jul-13 11:59:45 PM Event Running script in background: C:/Program Files/HomeSeer HS3/scripts/CountersCleared.vb


    Again, this works 99.99% of the time. But I can't figure out why it doesn't work 100%

    Any idea?

    Robert
    HS3PRO 3.0.0.500 as a Fire Daemon service, Windows 2016 Server Std Intel Core i5 PC HTPC Slim SFF 4GB, 120GB SSD drive, WLG800, RFXCom, TI103,NetCam, UltraNetcam3, BLBackup, CurrentCost 3P Rain8Net, MCsSprinker, HSTouch, Ademco Security plugin/AD2USB, JowiHue, various Oregon Scientific temp/humidity sensors, Z-Net, Zsmoke, Aeron Labs micro switches, Amazon Echo Dots, WS+, WD+ ... on and on.

    #2
    Originally posted by langenet View Post
    I have a script which runs each night which reads the value of a few devices, updates a couple of virtual devices with the values, then zeros the devices which it just read. This works fine for my rain measuring devices and 99.99% of the time for my electricity consumption reading. Essentially, all I do is read the total daily power consumption from CC and write the log and update a "Previous Day Consumption" device with what was used the prior day.

    The few lines of code for this particular device are:

    eVal = hs.DeviceValue(30) 'electricity

    hs.WritelogEx ("Info", "Daily KW-Usage " & eVal & " kWH","#0000FF")

    'Electricity Yesterday
    hs.SetDeviceString (205, "<img src='\Images\MyImgs\Electricity.png' align=absmiddle> " & "<font size = 2 color='Green'> <b>" & eVal & " kwh used previous day</b>", true)

    I see this in the log.

    Jul-13 11:59:45 PM Info Daily KW-Usage 0 kWH

    Jul-13 11:59:45 PM Info Day total Sump Pump Count: 0

    Jul-13 11:59:45 PM Info Day total rain: 1.4 mm

    Jul-13 11:59:45 PM Event Running script in background: C:/Program Files/HomeSeer HS3/scripts/CountersCleared.vb


    Again, this works 99.99% of the time. But I can't figure out why it doesn't work 100%

    Any idea?

    Robert
    Try using DeviceValueEx and define eval as a double integer.

    Z

    Comment


      #3
      Originally posted by vasrc View Post
      Try using DeviceValueEx and define eval as a double integer.

      Z
      Thanks.. I'll try DeviceValueEx . Though not shown, I did have eval defined as double.

      Robert
      HS3PRO 3.0.0.500 as a Fire Daemon service, Windows 2016 Server Std Intel Core i5 PC HTPC Slim SFF 4GB, 120GB SSD drive, WLG800, RFXCom, TI103,NetCam, UltraNetcam3, BLBackup, CurrentCost 3P Rain8Net, MCsSprinker, HSTouch, Ademco Security plugin/AD2USB, JowiHue, various Oregon Scientific temp/humidity sensors, Z-Net, Zsmoke, Aeron Labs micro switches, Amazon Echo Dots, WS+, WD+ ... on and on.

      Comment

      Working...
      X