Announcement

Collapse
No announcement yet.

Device value don't work

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

  • Device value don't work

    Hi all ,

    i have a power script to monitor my gas..

    now here is the thing, my script writes to a virtual device string but not to the value... the value keeps 0 and the string is updated... what am i doing wrong..

    here is a part of the script



    PHP Code:
    dim TodayDev As String "3401" 
    Dim NewValue As Double
    Used 
    Meterdecimal LastRead 

    NewValue 
    Used
    NewString 
    =(FormatNumber(NewValue 13)) 
    hs.SetDeviceValueByRef(TodayDevNewValue)
    hs.SetDeviceString(TodayDevNewStringTrue

    Output log

    PHP Code:
    Nov-10 09:11:59         NewValue    0.0599999999999454
    Nov
    -10 09:11:59         LastValue    0
    Nov
    -10 09:11:59         Used    0.0599999999999454
    Nov
    -10 09:11:59         Meterdecimal    1326.307
    Nov
    -10 09:11:59         MeterDev    1326.307
    Nov
    -10 09:11:59         Lastread1    1326.247 

    It correctly writes the string but no the value ..
    Attached Files
    Preferred -> Jon's Plugins, Pushover, Phlocation, Easy-trigger,
    Rfxcom, Blade Plugins, Pushbullet, homekit, Malosa Scripts




    HS3Pro 3.0.0.531 on windows 7 ultimate X64 on hp quadcore laptop 8 GB.

  • #2
    Being as though the value is very small you probably need to be setting up a value pair with a decimals setting. Although with HS3 you should be able to do this with a device value alone.
    My Plugins:

    Pushover 3P | DoorBird 3P | Current Cost 3P | Velleman K8055 3P | LAMetric 3P | Garadget 3P | Hive 3P |
    Yeelight 3P | Nanoleaf 3P

    Comment


    • #3
      hs.SetDeviceValueByRef has 3 parameters.

      Try:

      hs.SetDeviceValueByRef(TodayDev, NewValue, True)

      Details here.
      Jon

      Comment


      • #4
        Originally posted by jon00 View Post
        hs.SetDeviceValueByRef has 3 parameters.

        Try:

        hs.SetDeviceValueByRef(TodayDev, NewValue, True)

        Details here.

        thanksfor your time it works !!
        Preferred -> Jon's Plugins, Pushover, Phlocation, Easy-trigger,
        Rfxcom, Blade Plugins, Pushbullet, homekit, Malosa Scripts




        HS3Pro 3.0.0.531 on windows 7 ultimate X64 on hp quadcore laptop 8 GB.

        Comment

        Working...
        X