Announcement

Collapse
No announcement yet.

AAG Electronica Weather Station

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

    #16
    Simon,
    I am using AAG Weather station, rain guage, hobby boards lightning sensor and a variety of temperature and temperature humidity sensors with MCS temperature off of one TEMP08 at this time. My temp08 is connected serially to my HS running 1.7X. I have not upgraded yet. Once you have configured your devices to work with MCSTemperature it will remain in a pretty stable state.
    - Pete

    Auto mator
    Homeseer 3 Pro - 3.0.0.548 (Linux) - Ubuntu 18.04/W7e 64 bit Intel Haswell CPU 16Gb- Mono 6.12.X - HSTouch on Intel tabletop tablets
    Homeseer Zee2 (Lite) - 3.0.0.548 (Linux) - Ubuntu 18.04/W7e - CherryTrail x5-Z8350 BeeLink 4Gb BT3 Pro - Mono 6.12.X
    HS4 Pro - V4.1.11.0 - Ubuntu 20.01/VB W7e 64 bit Intel Kaby Lake CPU - 32Gb - Mono
    6.10.0.104
    HS4 Lite -

    X10, UPB, Zigbee, ZWave and Wifi MQTT automation-Tasmota-Espurna. OmniPro 2, Russound zoned audio, Smartthings hub, Hubitat Hub, and Home Assistant

    Comment


      #17
      I like the 1-wire concept and the technology seems sound.

      I have connected via a USB connection and that is all good.

      did you find any issue over calibrating the wind direction? the AAG seems to use a different chip from the Dallas Semi write up and I think the plugin has to synthesise the direction from the 4 voltage signals: mine appears to get the wrong compass points for some of them.

      Did yours work out of the box?

      Simon

      Comment


        #18
        Michael

        one more request.

        It is not clear to me that the direction is being correctly synthesised. I calibrate to get N (though adjusting the setting in the plugin for N in increments of 1 leads to some weird readings - doesn't appear to be a smooth correction).

        Once N is right, I get odd directions eg E for W, yet some of the others are correct (not just N and S). Is there something in the logic the plugin uses for synthesising direcition from the 4 voltages off the DS2450 which needs to be setup calibrate parameters?

        Simon

        Comment


          #19
          The algorithm is based upon 4 voltage readings with each set representing a position on the compass. A 0.25 voltage tolerance is used with expected voltages depending upon the position of the vane. I obtained the table from somewhere on the internet, but do not recall where. I never did empirically confirm it and my gauge is mounted where this analysis is not possible.

          Once the 4 readings are made then I iterate looking for which of the 16 directions the set of 4 corresponds. North is used if it does not fit into any.




          Code:
              conv_table(0) = Array(0.06, 4.64, 4.64, 4.64)
              conv_table(1) = Array(0.06, 0.06, 4.6, 4.6)
              conv_table(2) = Array(4.64, 0.06, 4.64, 4.64)
              conv_table(3) = Array(4.62, 0.06, 0.06, 4.6)
              conv_table(4) = Array(4.64, 4.64, 0.06, 4.64)
              conv_table(5) = Array(4.6, 4.6, 0.06, 0.06)
              conv_table(6) = Array(4.64, 4.64, 4.64, 0.06)
              conv_table(7) = Array(2.36, 4.62, 4.6, 0.06)
              conv_table(8) = Array(2.38, 4.66, 4.66, 4.66)
              conv_table(9) = Array(3.2, 3.2, 4.66, 4.64)
              conv_table(10) = Array(4.66, 2.38, 4.66, 4.66)
              conv_table(11) = Array(4.66, 3.18, 3.2, 4.64)
              conv_table(12) = Array(4.66, 4.66, 2.38, 4.66)
              conv_table(13) = Array(4.66, 4.66, 3.18, 3.18)
              conv_table(14) = Array(4.66, 4.66, 4.66, 2.38)
              conv_table(15) = Array(0.06, 4.62, 4.62, 2.34)
          
              dirTable = Array("N", "NNE", "NE", "ENE", "E", "ESE", "SE", "SSE", "S", "SSW", "SW", "SSW", "S", "SSE", "SE", "ESE", "E", "ENE", "NE", "NNE", "?")
          
          
                  index = 16
                  For i = 0 To 15
                     If (((Voltage(0) <= CSng(conv_table(i)(0)) + 0.25) And _
                          (Voltage(0) >= CSng(conv_table(i)(0)) - 0.25)) And _
                         ((Voltage(1) <= CSng(conv_table(i)(1)) + 0.25) And _
                          (Voltage(1) >= CSng(conv_table(i)(1)) - 0.25)) And _
                         ((Voltage(2) <= CSng(conv_table(i)(2)) + 0.25) And _
                          (Voltage(2) >= CSng(conv_table(i)(2)) - 0.25)) And _
                         ((Voltage(3) <= CSng(conv_table(i)(3)) + 0.25) And _
                          (Voltage(3) >= CSng(conv_table(i)(3)) - 0.25))) Then
                              index = i
                              Exit For
                      End If
                  Next
          
                  If index <> 16 Then
                      If (index - NorthDirection) < 0 Then
                          index = index - NorthDirection + 16
                      Else
                          index = index - NorthDirection
                      End If
                  Else
                      index = 0
                  End If
                  WindDirection = dirTable(index)

          Comment


            #20
            I thought it might be a messy matching process!

            I believe that different devices might be wired differently; that would certainly explain what I am seeing.

            Would it be simple to make the table available perhaps under an advanced button?

            It might be possible to simplify it too: it almost looks to me as if it is meant to have 3 readings: 0V, 2.5V and 5V (all nominal) and it could be fewer false N readings if the algorithm looked for those levels +/- 1V?

            Simon

            Comment


              #21
              If you have you instrument on a test bench then you can collect the 16 set of four readings. AAG makes only one product variety so they should all be the same. If yours varies then we can assess what needs to be done.

              Comment


                #22
                Simon, Yes mine worked "out of the box". I actually have two of them (one spare) and they both work fine. I calibrated initially but never actually did a visual once set up. My weather station is above the roof line of a two story home.(~ 30 feet / 10 meters). As my Temp08/05's are not yet totally set up I can do a quick test with my spare AAG weather station and Michaels MCSTemperature plugin to validate direction in the next couple of days.
                - Pete

                Auto mator
                Homeseer 3 Pro - 3.0.0.548 (Linux) - Ubuntu 18.04/W7e 64 bit Intel Haswell CPU 16Gb- Mono 6.12.X - HSTouch on Intel tabletop tablets
                Homeseer Zee2 (Lite) - 3.0.0.548 (Linux) - Ubuntu 18.04/W7e - CherryTrail x5-Z8350 BeeLink 4Gb BT3 Pro - Mono 6.12.X
                HS4 Pro - V4.1.11.0 - Ubuntu 20.01/VB W7e 64 bit Intel Kaby Lake CPU - 32Gb - Mono
                6.10.0.104
                HS4 Lite -

                X10, UPB, Zigbee, ZWave and Wifi MQTT automation-Tasmota-Espurna. OmniPro 2, Russound zoned audio, Smartthings hub, Hubitat Hub, and Home Assistant

                Comment


                  #23
                  Michael

                  Very kind - it's a dry day so I'm going up the ladder now - and will calibrate this morning.

                  Pete
                  it would be really helpful to have a second set of readings though: then we can give Michael some quality data.

                  I think there might also be a neat algorithm for the encoding which would allow him to simplify his decoding and indicate errors clearly....

                  Simon

                  Comment


                    #24
                    Readings done!


                    In summary: the big similarity is that my readings are within .2 volt of the table you have used.

                    The big DIFFERENCE, however, is that my readings run in the opposite direction to the table - and yes, my device is mounted the right way up and the circuit board is the right way up (I have taken it apart to prove that).

                    One request therefore and one suggestion:

                    Can you include a clockwise/anticlockwise flag on the plugin?

                    The suggestion is that if you don't match a table entry, you set that reading as an error (and the plugin already has neat logic about using previous reading or not for errors) - otherwise, there could be a lot of false N readings. Or set to "Error" if you can't?

                    Simon

                    Comment


                      #25
                      ERROR Alert!

                      I have just noticed an error in your table of directions. I have been reading it subconsciously knowing something was wrong and it finally clicked.

                      It is all wrong post SW....it starts to go back the other way! so you never will get readings WSW to NNW.....

                      That will explain some of the other results I couldn't understand when the vane was up on its pole :-)

                      Once the table has been corrected, a neat way to reverse it might be to change the last line of the routine to:

                      IF reverse THEN WindDirection = dirTable(16-index) ELSE WindDirection = dirTable(index)

                      but it will need N as both entries (0) and (16) in the table.

                      Simon

                      Comment


                        #26
                        That was a good bit of detective work!

                        When looking at the direction table it is clear that the content was not correct on the right side. I believe I fixed it in 4.44.8.

                        I added a checkbox where the other wind settings are entered to allow the direction to be changed between "Wind Comming From" and "Wind Going To" to suit one's orientation. It is the Reverse Wind checkbox. The solution you proposed works well since it allows the angle/compass conversions to be maintained without any changes.

                        I also added the error detection logic so that it will be ignored or recorded as 0 (North) depending upon the Use Previous on Bad Readings checkbox that was already present.

                        Code:
                        dirTable = Array("N", "NNE", "NE", "ENE", "E", "ESE", "SE", "SSE", "S", "SSW", "SW", "WSW", "W", "WNW", "NW", "NNW", "N")
                        
                        
                                If index <> 16 Or Not usePreviousOnBadReadings Then
                                    If ReverseWind Then
                                        index = 16 - index
                                    End If
                                    If (index - NorthDirection) < 0 Then
                                        index = index - NorthDirection + 16
                                    Else
                                        index = index - NorthDirection
                                    End If
                                    WindDirection = dirTable(index)
                                    iTemp = CLng(CSng(index) * 22.5)
                                    If Calibrations > 0 Then
                                        iTemp = CLng(Calibrate(device, CStr(iTemp), jWindDirection))
                                    End If
                                    If hs.DeviceValue(device) <> iTemp Then
                                        hs.SetDeviceValue device, iTemp
                                        hs.SetDeviceLastChange device, Now()
                                    End If
                                    If UseHTML Then
                                        WindDirection = FormatHTML(jWindDirection, WindDirection)
                                    End If
                                    hs.SetDeviceString device, CStr(WindDirection)
                                End If

                        Comment


                          #27
                          I think the logic and table are now right [phew!]. It took me back to my youth to have to work out what was wrong, though it sure helped to have a device to hand.

                          One suggestion: as my readings were up to 0.2 V different from your table, you could move the comparison window from 0.25 to 0.5 and still avoid confusion but perhaps allow for different USB/Com port voltages etc. I'd be worried about production consistency of computers, peripherals, and weather stations.

                          Thank you for attending to this so quickly.

                          Simon

                          Comment


                            #28
                            Couple of subsequent points:


                            1. I note that the plugin is unfriendly at shutdown when HS is run as a service - seems to have started in last couple of versions - it doesn't like the HS service being stopped - goes on running and keeps HS up - reported a High Wind change which normally only happens right at the startup (why?)

                            2. If you have any details of how the DS2438 barometer works, I will try to think of a neat solution to making it work in the plugin without soaking too much resource. Would be nice to have the plugin support the whole set of devices ( :-) )

                            Simon

                            PS Realise I still have to licence the plugin - only 26 days left - which I will - it's great and thank you

                            Comment


                              #29
                              You have been a big help and gone out of your way to get to the bottom of this. Thank you much.

                              The high wind indication is not something I've looked at in a long time. I can look. I can also open the voltage tolerance up a little as you suggest. My concern however, is that if a resistor becomes dislodged then it may be harder to know that a hardware failure has occurred.

                              I'm not aware of what I can do about the shutdown. I'm guessing that it is not version dependent, but timing dependent. When the plugin goes out to read a sensor it releases control to the 1-wire drivers and they hold the cpu because they need to control timing. HS is probably requesting shutdown at a time when the 1-wire drivers have control and expected shutdown timing is not occurring. The bus will be held for about 1/2 second for each temp conversion. If the iteration rate is high or there are many devices then the probability increases that the 1-wire drivers are busy.

                              I just mentioned on another thread that I did find the AAG Baro software, albeit in JAVA, and have converted it to work with the plugin. Dont know what the cpu impact will be. If someone stateside is willing to loan one then I should be able to integrate it.

                              Comment


                                #30
                                High Wind report isn't a worry - just wondered idly in my curious way what it got logged at startup (and no other time).

                                Don't worry about the shutdown. sounds like your explanation is bang on the nail as it describes why it shuts sometimes and not others. and fortunately the software is all so good that we all rarely need or want to shutdown!

                                Very happy to pilot the barometer software if you like. would be quite easy.

                                might be able to set up a virtual PC with the weather kit on it some time if you need and give you access; I could then just tear it down afterwards (really easy cleanup!).

                                simon

                                Comment

                                Working...
                                X