Announcement

Collapse
No announcement yet.

Acceptable math functions for "sum" field?

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

  • Acceptable math functions for "sum" field?

    Sorry if this is noted somewhere, I wasn't able to find the answer...

    I'm looking to enter a formula into an Analog sensor's "sum" field.

    I know simple arithmetic stuff works, but I'm wondering what the acceptable conventions are for things like exponent notation, square root, log, etc.

    thanks!
    Dave

  • #2
    I figured the lack of response was suggesting the answer was clearly stated somewhere... which I see this in the manual:

    Greig... will you be able to add further functionality down the road, such as "^" for exponent, as well, squares, log, lin, etc.? As well, to allow the use of brackets to define order of operation.

    thanks!
    Dave

    Comment


    • #3
      Originally posted by dhalsall View Post
      I figured the lack of response was suggesting the answer was clearly stated somewhere... which I see this in the manual:



      Greig... will you be able to add further functionality down the road, such as "^" for exponent, as well, squares, log, lin, etc.? As well, to allow the use of brackets to define order of operation.

      thanks!
      Dave
      Dave,

      Sorry I missed your first post on this. As you have found the answer to your own question I just wanted to add that there is support for brackets that was added in a recent build but I have had a report that there is a problem with this and it is the next thing for me to look at in the plugin.
      I can not see me adding much more that this to the plugin as it was just added to do basic calculations. I have had other users run a basic script on the device input change that then performs the required calculations and adds it to a virtual device.

      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


      • #4
        Thanks for the reply Greig,

        Good to know the bracket aspect works with the newer build. I'll probably do my next project with the newer build on a Windows platform and might begin in API mode to have more flexibility.

        Take care,
        Dave

        Comment


        • #5
          Hi Greig, I have a quick question about this still if you have a moment...

          I can't move to the new build as it seems to create problems with my existing board setup. I am trying to make my formula for one sensor work in a single line without brackets. I'm close, but need to multiply by -1 to get the value inverted.

          However, without brackets, this seems impossible. I tried tricking the "string" of the text box with quotes, etc. I thought you might have a work-around perhaps? I also tried creating a global variable called "invert" with a value of -1, but that didn't seem to work either.

          here's the formula:

          Code:
          155.26-Value*0.0182149
          and essentially I need to add *-1 at the end to get the value positive.

          Thanks for your insight!

          Dave

          Comment


          • #6
            Originally posted by dhalsall View Post
            Hi Greig, I have a quick question about this still if you have a moment...

            I can't move to the new build as it seems to create problems with my existing board setup. I am trying to make my formula for one sensor work in a single line without brackets. I'm close, but need to multiply by -1 to get the value inverted.

            However, without brackets, this seems impossible. I tried tricking the "string" of the text box with quotes, etc. I thought you might have a work-around perhaps? I also tried creating a global variable called "invert" with a value of -1, but that didn't seem to work either.

            here's the formula:

            Code:
            155.26-Value*0.0182149
            and essentially I need to add *-1 at the end to get the value positive.

            Thanks for your insight!

            Dave
            Dave this may be the bug that has been reported to me and I am looking in to.
            Can you not invert the value on the board then use a calculation?
            Sorry I am not to great at maths

            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


            • #7
              Hi Greig,

              There is a difference unfortunately. That "invert" (which I am using in this example) would reverse the range of the Analog input ... What I'm trying to do is take the result of my formula (which corrects for the linearity and offset of my sensor) and present the value as a positive integer.

              In other words, my result is -X. And I would like it to be positive by multiplying by -1.

              However, with the bracket bug I can't get there.

              I just wasn't sure if you knew another backdoor method like using quotes or some other character to separate the * from -1.

              Anyway, sounds like it's not possible, and I'll just have to forge ahead with negative integers for this device.

              As always, thanks for your time,

              Dave

              Sent from my SGH-I337M using Tapatalk

              Comment

              Working...
              X