Announcement

Collapse
No announcement yet.

Decimal values from Omnistat?

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

    Decimal values from Omnistat?

    I've been using Jon00's graphing plugin to plot my Omnistat temperatures over time. This has worked quite well, but since my temps only fluctuate by a few degrees the charts aren't very interesting to look at

    Does the Omnistat serial output include any decimal places or is it only whole numbers? If decimal, is there a way to get this output from your plugin?

    Here's an example of my plot:

    Click image for larger version

Name:	zone temps.jpg
Views:	1
Size:	136.4 KB
ID:	1209940

    #2
    - Pete

    Auto mator
    Homeseer 3 Pro - 3.0.0.548 (Linux) - Ubuntu 18.04/W7e 64 bit Intel Haswell CPU 16Gb
    Homeseer Zee2 (Lite) - 3.0.0.548 (Linux) - Ubuntu 18.04/W7e - CherryTrail x5-Z8350 BeeLink 4Gb BT3 Pro
    HS4 Lite - Ubuntu 22.04 / Lenovo Tiny M900 / 32Gb Ram

    HS4 Pro - V4.1.18.1 - Ubuntu 22.04 / Lenova Tiny M900 / 32Gb Ram
    HSTouch on Intel tabletop tablets (Jogglers) - Asus AIO - Windows 11

    X10, UPB, Zigbee, ZWave and Wifi MQTT automation-Tasmota-Espurna. OmniPro 2, Russound zoned audio, Alexa, Cheaper RFID, W800 and Home Assistant

    Comment


      #3
      Thanks Pete. I've been using up too much of my Saturday tuning in the graphs but it's really fun!

      Kirby - any way to get decimal values?


      I've got a stack of 1-wire probes that I'm going to integrate into my system here shortly. I'm still working out how to bus them together... thinking about using a reel of RJ11 cable I have lying around. How did you do it Pete?

      (I realize this is off topic... maybe PM me regarding the DS1820's)

      Comment


        #4
        As usual I typed before thinking this question through.

        Per the "OmniTemps.pdf" document kindly attached to the 1st message in this thread it appears that the Omnistat only provides 8 bits (0-255) of temperature data. For some reason they decided they wanted to represent temperatures all the way from -40F up to 190F. Of course this limits the available resolution to (40+190)/255 = 0.9 deg. F increments, so even though one could use the exact conversion of the OmniTemp (which would include the first decimal place) you'd only be getting a 10% increase in precision.

        If I had my druthers I'd take that extra 10% but maybe there's something that made that challenging for the plugin. I'm curious to hear Kirby's take.

        Jeff

        Comment


          #5
          Jeff,
          Early on in the development of the plugin, the opinion of the early testers and one that I shared, was that the temperature displayed by the device should match what was displayed by the thermostat. That meant that Fahrenheit temps would be whole numbers and Celsius would be in half degree increments.

          You can get the temps to one decimal place but it would require you to write a script. In the script, you would call GetRegister(tstatID, reg) to get the raw Omnitemp value from the thermostat. Then use a conversion routine to get the F temp. The C# script below may work for you. You can't use the Omnitemp2Temp method because that returns a whole number.

          Code:
          public Object Main(object[] parm)
                  {
                      return null;
                  }
                  public double GetFTemp(int tAddress)
                  {
                      double[] tempArray = new double[]
          	        {-40.0,-39.1,-38.2,-37.3,-36.4,-35.5,-34.6,-33.7,-32.8,-31.9,-31.0,
                          -30.1,-29.2,-28.3,-27.4,-26.5,-25.6,-24.7,-23.8,-22.9,-22.0,-21.1,
                          -20.2,-19.3,-18.4,-17.5,-16.6,-15.7,-14.4,-13.9,-13.0,-12.1,-11.2,
                          -10.3,-9.4,-8.5,-7.6,-6.7,-5.8,-4.9,-4.0,-3.1,-2.2,-1.3,-0.4,0.5,
                          1.4,2.3,3.2,4.1,5.0,5.9,6.8,7.7,8.6,9.5,10.4,11.3,12.2,13.1,14.0,
                          14.9,15.8,16.7,17.6,18.5,19.4,20.3,21.2,22.1,23.0,23.9,24.8,25.7,
                          26.6,27.5,28.4,29.3,30.2,31.1,32.0,32.9,33.8,34.7,35.6,36.5,37.4,
                          38.3,39.2,40.1,41.0,41.9,42.8,43.7,44.6,45.5,46.4,47.3,48.2,49.1,
                          50.0,50.9,51.8,52.7,53.6,54.5,55.4,56.3,57.2,58.1,59.0,59.9,60.8,
                          61.7,62.6,63.5,64.4,65.3,66.2,67.1,68.0,68.9,69.8,70.7,71.6,72.5,
                          73.4,74.3,75.2,76.1,77.0,77.9,78.8,79.7,80.6,81.5,82.4,83.3,84.2,
                          85.1,86.0,86.9,87.8,88.7,89.6,90.5,91.4,92.3,93.2,94.1,95.0,95.9,
                          96.8,97.7,98.6,99.5,100.4,101.3,102.2,103.1,104.0,104.9,105.8,106.7,
                          107.6,108.5,109.4,110.3,111.2,112.1,113.0,113.9,114.8,115.7,116.6,
                          117.5,118.4,119.3,120.2,121.1,122.0,122.9,123.8,124.7,125.6,126.5,
                          127.4,127.3,129.2,130.1,131.0,131.9,132.8,133.7,134.6,135.5,136.4,
                          137.3,138.2,139.1,140.0,140.9,141.8,142.7,143.6,144.5,145.4,146.3,
                          147.2,148.1,149.0,149.9,150.8,151.7,152.6,153.5,154.4,155.3,156.2,
                          157.1,158.0,158.9,159.8,160.7,161.6,162.5,163.4,164.3,165.2,166.1,
                          167.0,167.9,168.8,169.7,170.6,171.5,172.4,173.3,174.2,175.1,176.0,
                          176.9,177.8,178.7,179.6,180.5,181.4,182.3,183.2,184.1,185.0,185.9,
                          186.8,187.7,188.6,189.5};
                      int omnitemp = hs.PluginFunction("Omnistat 3", "", "GetRegister", new object[]{tAddress,64}));
                      int index = (omnitemp >= 0 && omnitemp <= 255) ? omnitemp : 0;
                      return tempArray[index];
                  }

          Comment


            #6
            Kirby,
            I'm 100% aligned with using the value displayed on the thermostat. That makes total sense for what the typical user would want. Of course I'm not that typical and tend to make more work for myself than necessary, so I appreciate the addition of the script.

            I haven't played with scripting yet on HS3 but I'll give it a shot. Many thanks for working this up for me!

            Jeff

            Comment


              #7
              Your welcome. BTW, I didn't actually try the script but it should work. Let me know if you have any issues. The first time you run a C# script on HS (at least under Linux) you will get a whole page of errors in the HS log. Just rerun the script and the errors will go away ( I know, don't ask ).

              Comment

              Working...
              X