Announcement

Collapse
No announcement yet.

API Mode and Floats

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

    API Mode and Floats

    Hi,
    Firstly thank you for authoring this fantastic plugin. Secondly I have a problem of course.
    I am using the plugin in API mode as Aquarium & Aquaponics monitors. I am reading temperature values from the output array but unfortunately the plugin seems to be configured for integers not floats. Which means at the Homeseer end I am not getting anything beyond the decimal point. Am I missing something? Is there a way to get my float value?

    #2
    Nothing?

    Comment


      #3
      HI mrgrumpy

      Sorry I you are having the problem. I will have a look at the code tonight and see why this is happening. I guess this is in the Arduino but it may be a plugin problem. I will get back to you.

      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
        MrGrunmy,

        I have had a little look but am a little confused. So you are using a API Input and it is displaying wrong. What do you mean when you say "I am reading temperature values from the output array" is this form the monitors?
        Can I ask how you have the input update set in the config? is it value string or both?
        If you enable debug is it showing as expected in the log? Can you send me a log?

        Thanks.

        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


          #5
          Fixed it myself

          Thanks Greig

          Sorry not array, function. You have defined the data in the SendToHS function as a long. It is also defined as a long again when the function is called. The first time I changed it to float I only changed one of them and it didn't work hence the post. Now that I have changed it in both places it works just fine.

          Comment


            #6
            Originally posted by mrGrumpy View Post
            Thanks Greig

            Sorry not array, function. You have defined the data in the SendToHS function as a long. It is also defined as a long again when the function is called. The first time I changed it to float I only changed one of them and it didn't work hence the post. Now that I have changed it in both places it works just fine.
            Good news that it is working for you.
            I have tried my best to cover as much as possible but I guess I cant cover everything. The API.ino is one that may need some changes depending on the use.

            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
              Hello,

              I'm having this issue as well. Reading some DS1820 temperature sensors in the API.ino and trying to send them to Homeseer using SendToHS(). In HS the decimal part is lost. My kludge is to multiply by 100 in the arduino and divide by 100 in Homeseer, but I'd rather not do that if it's not necessary.

              Originally posted by mrGrumpy View Post
              You have defined the data in the SendToHS function as a long. It is also defined as a long again when the function is called. The first time I changed it to float I only changed one of them and it didn't work hence the post. Now that I have changed it in both places it works just fine.
              I'd love to change the definition, but I have no idea where these definitions are located. They don't seem to be in the API.ino. Any pointers?

              Comment


                #8
                Found it! I hadn't realised that there was anything below the page of blank lines in the api.ino file.

                Comment


                  #9
                  FYI there is fixed in the latest version that is under testing. I have one problem to fix and then I will send it to the updater.
                  The next move is to try and get some kind of display working in the standard plugin.

                  Wish me luck

                  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


                    #10
                    Originally posted by enigmatheatre View Post
                    FYI there is fixed in the latest version that is under testing. I have one problem to fix and then I will send it to the updater.
                    The next move is to try and get some kind of display working in the standard plugin.

                    Wish me luck

                    Greig.
                    Hi Greig,

                    this was an old post but I have a similar issue.
                    I'm sending a temperature data back to HS using the last API version.
                    The data is a float.
                    It seems the plugin receives it correctly but then when it is shown, it drops the decimal point (1594C instead of 15.94C)
                    No matter if I use string, value or both.
                    Any idea?

                    Code:
                    5/2/2017 ,15:01:29.292 Board 2, Device Ref = 149, API Input 1, Value = 1612
                    15/2/2017 ,15:01:29.297 New UDP Text Recieved = 2 API 1 16.12




                    Thanks

                    Comment


                      #11
                      Originally posted by doppiaemme View Post
                      Hi Greig,

                      this was an old post but I have a similar issue.
                      I'm sending a temperature data back to HS using the last API version.
                      The data is a float.
                      It seems the plugin receives it correctly but then when it is shown, it drops the decimal point (1594C instead of 15.94C)
                      No matter if I use string, value or both.
                      Any idea?

                      Code:
                      5/2/2017 ,15:01:29.292 Board 2, Device Ref = 149, API Input 1, Value = 1612
                      15/2/2017 ,15:01:29.297 New UDP Text Recieved = 2 API 1 16.12




                      Thanks
                      This is a different problem from above. The device is set to 0 Dec Places. Go to the device status graphic page and try setting Dec Places to 2. If that dose not work I will have to look at this more.

                      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


                        #12
                        Originally posted by enigmatheatre View Post
                        This is a different problem from above. The device is set to 0 Dec Places. Go to the device status graphic page and try setting Dec Places to 2. If that dose not work I will have to look at this more.

                        Greig.
                        I've tried what you said but the result still doesn't change. I needed to create a range quite large as 14.92 degrees are presented as 1492.
                        However, it still doesn't show the decimal point.

                        Comment


                          #13
                          doppiaemme,

                          Can I ask what version of the plugin you are running?

                          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


                            #14
                            Originally posted by enigmatheatre View Post
                            doppiaemme,

                            Can I ask what version of the plugin you are running?

                            Greig.

                            Now I'm running
                            Available Sketch Version = 1.0.0.134, API Version = API1.0.0.136

                            the same one I'm using to test the other board
                            (I have an arduino uno and a NodeMCU)

                            still missing the decimal point

                            Comment


                              #15
                              Originally posted by doppiaemme View Post
                              Now I'm running
                              Available Sketch Version = 1.0.0.134, API Version = API1.0.0.136

                              the same one I'm using to test the other board
                              (I have an arduino uno and a NodeMCU)

                              still missing the decimal point
                              I checked this on this version and it worked fine. Can you send me a debug log of this so I can see what is going on.

                              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

                              Working...
                              X