Announcement

Collapse
No announcement yet.

calculations on a device value

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    calculations on a device value

    Hi,
    I have a sensor that returns a value ("J99" power consumption).
    I would like that in hstouch appear the "powerOK" value:


    dim power
    power =hs.DeviceValue("J99")

    if power < 46 then
    powerOK =-275.3+(35.68*power)-(1.334*power^2)+(0.01727*power^3)
    end if

    if power >= 46 then
    powerOK =22.53+(4.247*power)-(0.002338*power^2)+(0.000006*power^3)
    end if

    How can I integrate this script directly in hstouch?
    I'd like to see the "powerOK" value in real time on the hstouch screen without having to trigger the script every second (realtime)

    Thanks a lot

    Cris

    #2
    Can you not trigger the script on device J99 value change so you only trigger the script when needed and save the "powerOK" value in a new device to display in HSTouch.

    Sent from my HTC One using Tapatalk 4
    Zwave = Z-Stick, 3xHSM100� 7xACT ZDM230, 1xEverspring SM103, 2xACT HomePro ZRP210.
    X10 = CM12U, 2xAM12, 1xAW10, 1 x TM13U, 1xMS13, 2xHR10, 2xSS13
    Other Hardware = ADI Ocelot + secu16, Global Cache GC100, RFXtrx433, 3 x Foscams.
    Plugings = RFXcom, ActiveBackup, Applied Digital Ocelot, BLDeviceMatrix, BLGarbage, BLLAN, Current Cost, Global Cache GC100,HSTouch Android, HSTouch Server, HSTouch Server Unlimited, NetCAM, PowerTrigger, SageWebcamXP, SqueezeBox, X10 CM11A/CM12U.
    Scripts =
    Various

    Comment


      #3
      Hi Greig!!!
      I'm using your arduino plugin (fantastic!!!)

      But I need to see in realtime the power on hstouch.

      I wanted to enter the mathematical function directly in the arduino.ini file but there are two conditions (if) in my script...

      One solution could be to run the script when there is a device value change and then place the result into a virtual device, but if the changes are continuous, there is the risk of overloading HomeSeer with the continuous calculations?

      EDIT:
      Solved!
      No problem for HomeSeer to run script on a device change.
      Last edited by khriss75; September 16, 2013, 07:36 AM. Reason: SOLVED!

      Comment

      Working...
      X