Announcement

Collapse
No announcement yet.

Local Ambient Weather Data

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

  • Local Ambient Weather Data

    My intent for this thread is going to end up as a how-to using Jon00DataScraperHS3 in order to bypass the Internet and gather local data directly from the ObserverIP module used with Ambient Weather weather stations. I currently know little about the script - except that it almost certainly can do what is needed. Setting myself up for success here!

    There are already two good plug-ins that do this via the Internet and API's. I bought jeubanks Ambient Weather plug-in and in a very short time - he has turned it into an excellent way to get data from your weather station via the Internet.

    As I like my data as real-time as possible - scraping from the ObserverIP module will be (IMHO) the most foolproof method - Internet connectivity be damned. I'm not wanting every drop of data - like the plug-ins provide. I want to scrape data as a supplement to what they provide, then use it when necessary.

    Off to figure it out, RTFM, etc! Anyone already contemplating this - PLEASE feel free to post / give advice.

  • #2
    First thing is to see if you can grab the web page and generate a text file which contains the data.

    All that is needed in the Jon00DataScraper.ini file is:

    [Grab1]
    Path=<URL>
    TextFile=1

    If you run the script as per the docs for [Grab1], you should find a file called grab1.txt located in your Data/Jon00/datascraper folder.

    You then need to list what data you need and send me grab1.txt
    Jon

    Comment


    • #3
      FYI.... I'm in the process of adding local ObserverIP data to the plugin.

      Comment


      • #4
        Originally posted by jeubanks View Post
        FYI.... I'm in the process of adding local ObserverIP data to the plugin.
        I'll be looking out for that too!! No way what I'm trying to do here is going to accomplish the full-blown plug-in.

        Comment


        • #5
          Originally posted by jon00 View Post
          First thing is to see if you can grab the web page and generate a text file which contains the data.

          All that is needed in the Jon00DataScraper.ini file is:

          [Grab1]
          Path=<URL>
          TextFile=1

          If you run the script as per the docs for [Grab1], you should find a file called grab1.txt located in your Data/Jon00/datascraper folder.

          You then need to list what data you need and send me grab1.txt
          Worked good.
          Here is the result - currently trying to do just one thing - Outdoor temperature. Its data is in this line

          Code:
          <td bgcolor="#EDEFEF"><input name="outTemp" disabled="disabled" type="text" class="item_2" style="WIDTH: 80px" value="88.0" maxlength="5" /></td>

          I will eventually include other things like outdoor humidity, indoor temperature & humidity, etc. An example with whatever grep you use will point me the right way.
          Thanks!
          Attached Files

          Comment


          • #6
            Here you go:

            10 is the maximum of patterns/devices that can be formed under a single [GrabX] entry:

            Code:
            [Grab2]
            Path=<URL>
            TextFile=1
            Encoding=
            Username=
            Password=
            Options=
            UserAgent=
            Devicemode=0
            StripHTML=0
            Pattern1=(?s)outTemp.*?value="(.*?)"
            Pattern2=(?s)outHumi.*?value="(.*?)"
            Pattern3=(?s)windir.*?value="(.*?)"
            Pattern4=(?s)gustspeed.*?value="(.*?)"
            Pattern5=(?s)inTemp.*?value="(.*?)"
            Pattern6=(?s)inHumi.*?value="(.*?)"
            Pattern7=(?s)AbsPress.*?value="(.*?)"
            Pattern8=(?s)RelPress.*?value="(.*?)"
            Pattern9=(?s)solarrad.*?value="(.*?)"
            Pattern10=(?s)"uv".*?value="(.*?)"
            DeviceName1=Outdoor Temperature
            DeviceName2=Outdoor Humidity
            DeviceName3=Wind Direction
            DeviceName4=Gustspeed
            DeviceName5=Indoor Temperature
            DeviceName6=Indoor Humidity
            DeviceName7=Absolute Pressure
            DeviceName8=Relative Pressure
            DeviceName9=Solar Radiation
            DeviceName10=UV
            DeviceText1=[0]&deg;F
            DeviceText2=[100]%
            DeviceText3=[200]&deg;
            DeviceText4=[300] mph
            DeviceText5=[400]&deg;F
            DeviceText6=[500]%
            DeviceText7=[600]"
            DeviceText8=[700]"
            DeviceText9=[800]
            DeviceText10=[900]
            DeviceValue1=[0]
            DeviceValue2=[100]
            DeviceValue3=[200]
            DeviceValue4=[300]
            DeviceValue5=[400]
            DeviceValue6=[500]
            DeviceValue7=[600]
            DeviceValue8=[700]
            DeviceValue9=[800]
            DeviceValue10=[900]
            You can add your own icons as you wish.
            Jon

            Comment


            • #7
              Originally posted by jon00 View Post
              Here you go:

              10 is the maximum of patterns/devices that can be formed under a single [GrabX] entry:

              Code:
              [Grab2]
              Path=<URL>
              TextFile=1
              Encoding=
              Username=
              Password=
              Options=
              UserAgent=
              Devicemode=0
              StripHTML=0
              Pattern1=(?s)outTemp.*?value="(.*?)"
              Pattern2=(?s)outHumi.*?value="(.*?)"
              Pattern3=(?s)windir.*?value="(.*?)"
              Pattern4=(?s)gustspeed.*?value="(.*?)"
              Pattern5=(?s)inTemp.*?value="(.*?)"
              Pattern6=(?s)inHumi.*?value="(.*?)"
              Pattern7=(?s)AbsPress.*?value="(.*?)"
              Pattern8=(?s)RelPress.*?value="(.*?)"
              Pattern9=(?s)solarrad.*?value="(.*?)"
              Pattern10=(?s)"uv".*?value="(.*?)"
              DeviceName1=Outdoor Temperature
              DeviceName2=Outdoor Humidity
              DeviceName3=Wind Direction
              DeviceName4=Gustspeed
              DeviceName5=Indoor Temperature
              DeviceName6=Indoor Humidity
              DeviceName7=Absolute Pressure
              DeviceName8=Relative Pressure
              DeviceName9=Solar Radiation
              DeviceName10=UV
              DeviceText1=[0]&deg;F
              DeviceText2=[100]%
              DeviceText3=[200]&deg;
              DeviceText4=[300] mph
              DeviceText5=[400]&deg;F
              DeviceText6=[500]%
              DeviceText7=[600]"
              DeviceText8=[700]"
              DeviceText9=[800]
              DeviceText10=[900]
              DeviceValue1=[0]
              DeviceValue2=[100]
              DeviceValue3=[200]
              DeviceValue4=[300]
              DeviceValue5=[400]
              DeviceValue6=[500]
              DeviceValue7=[600]
              DeviceValue8=[700]
              DeviceValue9=[800]
              DeviceValue10=[900]
              You can add your own icons as you wish.
              Sweet! thanks - off to test this out,,,,,,,

              Comment


              • #8
                First testing works out well.
                Is there any error checking built in - that is to say what's the worst that I get if I get a corrupt grab or - whatever? Maybe shoves bad data into a device?

                Click image for larger version

Name:	Capture.PNG
Views:	43
Size:	34.6 KB
ID:	1239756

                Comment


                • #9
                  If you have a UV of 334 then I'm afraid of where you are at

                  Comment


                  • #10
                    Originally posted by jeubanks View Post
                    If you have a UV of 334 then I'm afraid of where you are at
                    Pripyat reactor room 4 possibly...

                    Comment


                    • #11
                      Originally posted by Fellhahn View Post

                      Pripyat reactor room 4 possibly...
                      LOL Killin me !!

                      jon00 calculations are possible with your script, no?


                      Edit - OK I see I thought it was a matter of converting the Watts per Square Meter to Lux, which would be cool. In this case it's a matter of labeling it would appear. Will look more closely but the UV should be single digits.
                      Last edited by Monk; August 13th, 2018, 08:02 AM. Reason: add text

                      Comment


                      • #12
                        The corrected UV Index - looks much safer. No incineration will occur.
                        UVI is the number I'd like there.

                        This is from the local ObserverIP module
                        Click image for larger version

Name:	Capture.PNG
Views:	41
Size:	5.8 KB
ID:	1239832

                        But keep in mind - this is no fancy plug-in.

                        (buy jeubanks Ambient Weather Plug-in! I did, it's worth it!)

                        This is manually specifying the data you want to stuff into a HS variable, at a recurrence that you specify via whatever method you choose to run the script. For fun - and I do call this fun, I grab data from the URL every five minutes. Just something to do - while I figure out something new to do with it.

                        I'm getting the UV (Index?) and calling it "UV" and it is now bearable!

                        Note - that the indoor temperature shown here are the AW indoor temp module that I have located in a humidor right now.

                        Click image for larger version

Name:	Capture2.PNG
Views:	41
Size:	55.9 KB
ID:	1239833




                        Comment


                        • #13
                          Originally posted by Monk View Post
                          First testing works out well.
                          Is there any error checking built in - that is to say what's the worst that I get if I get a corrupt grab or - whatever? Maybe shoves bad data into a device?
                          Unless the web page changes, the pattern match should be fairly robust. If no data is found, it would be replaced by a -
                          Jon

                          Comment


                          • #14
                            Originally posted by Monk View Post


                            jon00 calculations are possible with your script, no?

                            .
                            No!

                            Jon

                            Comment


                            • #15
                              Originally posted by jon00 View Post

                              No!
                              Gracias!

                              Comment

                              Working...
                              X