Announcement

Collapse
No announcement yet.

Intermittent device value transition issue

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

  • langenet
    replied
    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

    Leave a comment:


  • vasrc
    replied
    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

    Leave a comment:


  • langenet
    started a topic Intermittent device value transition issue

    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
Working...
X