Announcement

Collapse
No announcement yet.

Mathematical operation

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

    Mathematical operation

    Hello.
    I'm testing the Power meter with Arduino and AC721 (current sensor) and I would need to
    create an event that changes me consumption as the total consumtions exceeds a certain
    value.
    For example : the ' photovoltaic system produces 3 kW / h and my total consumption of 3.7 kW / h ( 1kW / h kitchen , 1 kw / h bathroom, 1 kw / h bedroom and 0.7 kW / h other consumption ) .
    *My event is to make the sum of consumption and if the total is larger than it produces photovoltaic should begin to detach consumption ( with a certain priority ) until consumption are smaller production . In my example, I first off the other consumption . If consumption is anchored larger or equal to the production I detach a part of the consumption of the bathroom. If consumption is smaller then everything ok . If they are still larger than or equal with the production then I detach a part of the consumption of the bedroom ......

    How can I do the math?

    Thanks,
    Marian

    #2
    Originally posted by mihaium View Post
    Hello.
    I'm testing the Power meter with Arduino and AC721 (current sensor) and I would need to
    create an event that changes me consumption as the total consumtions exceeds a certain
    value.
    For example : the ' photovoltaic system produces 3 kW / h and my total consumption of 3.7 kW / h ( 1kW / h kitchen , 1 kw / h bathroom, 1 kw / h bedroom and 0.7 kW / h other consumption ) .
    *My event is to make the sum of consumption and if the total is larger than it produces photovoltaic should begin to detach consumption ( with a certain priority ) until consumption are smaller production . In my example, I first off the other consumption . If consumption is anchored larger or equal to the production I detach a part of the consumption of the bathroom. If consumption is smaller then everything ok . If they are still larger than or equal with the production then I detach a part of the consumption of the bedroom ......

    How can I do the math?

    Thanks,
    Marian
    Hi Marian.

    I would suggest that you make a virtual device for displaying the totals then have an event that runs a script and calculates the values every time the input value changes. This way you can do any maths that you want on the value.

    Greig.
    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
      thanks for your opinion.
      For the moment, i don't know how.
      But....


      Thanks again

      Comment


        #4
        did you have any luck figuring out how to do this. The maths function will give strange values when saved within the plugin, I have had no luck with it for analog values. Can anyone post an example to get started. I really want to use this feature, but can't get started. I need a proper value to display and then have movable set points to trigger events .

        Comment


          #5
          Originally posted by Daggy67 View Post
          did you have any luck figuring out how to do this. The maths function will give strange values when saved within the plugin, I have had no luck with it for analog values. Can anyone post an example to get started. I really want to use this feature, but can't get started. I need a proper value to display and then have movable set points to trigger events .
          Can you post what you would like from it and I will tell you how as there are lots of ways to calc the values.

          The easiest way is to create a virtual device in homeseer then when the Arduino device changes value run a script to calc the value and update the virtual device. This way you also have both values.

          Something like this should do.

          PHP Code:
          Sub Main

          End Sub

              Sub SetParam
          (ByVal Parm As String)

                  
          Dim ArduinoDevice As Integer 1234
                  Dim VirtualDevice 
          As Integer 5678
                  Dim CalcValue 
          As Integer 0

                  CalcValue 
          hs.DeviceValue(ArduinoDevice) * 50 3


                  hs
          .SetDeviceValueByRef(VirtualDeviceCalcValueTrue)
                  
          hs.WriteLog("Arduino""Value Calculated =  " CalcValue)

              
          End Sub 
          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


            #6
            Thanks for your help.

            Comment

            Working...
            X