Announcement

Collapse
No announcement yet.

realtime.txt online?

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

    realtime.txt online?

    Hi Jeff,

    I'm guessing that since I'm not getting any data, WeatherXML doesn't pull realtime.txt from online? I don't use Cumulus but I can massage my MeteoBridge to create a realtime.txt file. Does it have to be on a local drive?

    Cheers!

    Chris
    Attached Files

    #2
    It is designed to watch a local or mapped folder. That way anytime the file changes it gets imported.

    I can add to my to do list to have it grab the file every x number of minutes instead of watching a directory.
    --
    Jeff Farmer
    HS 3, HSPhone
    My HS3 Plugins: CFHSExtras, Random, Restart, Tracker, WeatherXML, PanaBluRay
    Other Plugins In Use: APCUPSD, BLOnkyo, Device History, EasyTrigger, HSTouch Server, PHLocation2, Pushover, RFXCom, UltraGCIR3, UltraMon3, UltraPioneerAVR3, X10, Z-Wave

    Hardware: GoControl Irrigation Controler, Schlage Lever Lock, Schlage Deadbolt, Way2Call Hi-Phone, RFXCom RFXrec433 Receiver, WGL 800, TI-103, Z-Net, Pioneer 1120, Pioneer 1021, Pioneer LX302, Panasonic BDT-110, Panasonic BDT-210 x2

    Comment


      #3
      Originally posted by CFGuy View Post
      It is designed to watch a local or mapped folder. That way anytime the file changes it gets imported.

      I can add to my to do list to have it grab the file every x number of minutes instead of watching a directory.
      Before you spend too much time on it Jeff, let me do some work with MeteoBridge to see if I can get the file dropped to a mapped drive. I'll let you know how I fare.

      Cheers!

      Chris

      Comment


        #4
        Hi Jeff,

        I have figured a way to have the file appear in a local drive so no need to make that change on my account. Thanks for looking into it though.

        Cheers!

        Chris

        Comment


          #5
          Here utilize two weatherstations in two geographical locations. Both upload to a hosting service such that I download the realtime txt file for each site and rename it with this script.

          Code:
          Sub Main(ByVal Parm As Object)
          
                  Dim FileSource As String = "http://www.rideauwx.info/realtime.txt" 
                  Dim FileDestination As String = hs.GetAppPath & "\config\realtime-rideauwx.txt"
          
                  If System.IO.File.Exists(FileSource) Then
          
                      System.IO.File.Copy(FileSource, FileDestination)
          
                  Else
          
                      hs.WriteLog("Error", "Cannot access Realtime.txt")
          
                  End If
          
             End Sub
          - 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
          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.7.0 - Ubuntu 18.04/VB W7e 64 bit Intel Kaby Lake CPU - 32Gb - Mono 6.12.x
          HS4 Lite -

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

          Comment


            #6
            Looking at my stuff changed it to one liners for the two sites via a bash script and cron job.

            Code:
            #!/bin/sh
            
            lynx --dump hxxp://hostip/weather-1/realtime.txt[/url] > /HomeSeer/Config/lockport.txt
            lynx --dump hxxp://hostip/weather-2/realtime.txt[/url] > /HomeSeer/Config/longboatkey.txt
            - 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
            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.7.0 - Ubuntu 18.04/VB W7e 64 bit Intel Kaby Lake CPU - 32Gb - Mono 6.12.x
            HS4 Lite -

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

            Comment


              #7
              Very cool. Running in a Windows box but I've been using a replacement command processor, called Take Command (started out as 4DOS), for years now. Cooked up a batch file to download the file every 10 minutes. Posting this from my phone so I can't show you the code right now. I'll post it here when I get home if I think of it.

              For anyone who wants to have a boo, jpsoft.com will let you d/l a 30 day trial of Take Command. Very powerful batch language.

              Cheers!

              Chris

              Comment


                #8
                Originally posted by chrisgrainger View Post
                Cooked up a batch file to download the file every 10 minutes. Posting this from my phone so I can't show you the code right now. I'll post it here when I get home if I think of it.
                Remembered I meant to post this. It is definitely not elegant, but it does work. I run it in a TCC window. Eventually I will massage it to write to the Homeseer log if that is possible... shouldn't be too hard I don't think.


                Code:
                @echo off
                Rem getRealtime.btm
                Rem by Chris Grainger
                Rem Running under TCMD 19.10
                Rem Created to allow automation system access to realtime.txt on a timed basis
                Rem February 22, 2016 - Initial 
                Rem March 2, 2016 - Edits for midnight problem... delay until 00:00:00 doesn't 
                Rem                         work without a date.
                Rem Download 'realtime.txt' from remote directory every 10 minutes
                Rem on the 10's.  Assumes batch file is running in the directory where
                Rem you want the file downloaded.
                
                Rem Start ftp session with iftp and make 'rideauwx' the default 
                Rem remote directory.
                iftp "ftp://Your_ftp_username:Your_FTP_password@Your_FTP_site/directory"
                Rem Initialize some variables
                	set hr=%_hour
                	set min=%_minute
                Rem Start the forever loop
                cls
                do forever
                	Rem Start a loop to time the downloads for every 10 minutes on the 10
                	do i=0 to 60 by 10
                		Rem Start at the nearest next 10 minute mark
                		if %i LT %min iterate
                		Rem zero pad any single digit minute to two digits
                		set t=%@formatn[02.0,%i]
                		Rem Test for Top of hour and for midnight
                		iff %t GE 60 then
                			set t=%@formatn[02.0,0]
                			set hr=%@formatn[02.0,%@eval[%_hour + 1]]
                			iff %hr EQ 24 then
                				set hr=23
                				set t=59
                			endiff
                		endiff
                		echo Next download at %hr:%t:00
                		delay until %hr:%t:00
                		Rem Copy the file via ftp.  Is Bluehost doing something  to time?
                		Rem Have to touch the file to set correct time. 
                		copy /q ftp:realtime.txt
                		touch /q realtime.txt
                                    echo realtime.txt downloaded at %_hour:%@formatn[02.0,%_minute]
                		Rem Add 10 minutes to get next download time
                		set min=%@formatn[02.0,%@eval[%_minute + 10]]
                		Rem Test for Top of hour and for midnight
                		iff %min GE 60 then
                			set t=%@formatn[02.0,0]
                			set min=%@formatn[02.0,0]
                			set hr=%@formatn[02.0,%@eval[%_hour + 1]]
                			iff %hr EQ 24 then
                				set hr=%@formatn[02.0,0]
                				delay 70
                			endiff
                		endiff
                		echo.
                	enddo

                Comment


                  #9
                  Here I think its just related to using Linux and methodology of read of realtime.txt file.
                  - 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
                  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.7.0 - Ubuntu 18.04/VB W7e 64 bit Intel Kaby Lake CPU - 32Gb - Mono 6.12.x
                  HS4 Lite -

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

                  Comment


                    #10
                    Originally posted by chrisgrainger View Post
                    Hi Jeff,

                    I have figured a way to have the file appear in a local drive so no need to make that change on my account. Thanks for looking into it though.

                    Cheers!

                    Chris
                    Hi Chris - sorry for bumping an old thread but I'm trying to do the exact same thing as you with my new Meteobridge PRO and could use some help. Would you mind explaining how you configured your meteobridge to export a properly formatted realtime.txt file? I don't see realtime.txt as an option in the export templates and I'm struggling to figure this out. Any help would be appreciated.
                    Thanks in advance!
                    Dom

                    Comment


                      #11
                      Originally posted by dexterdom View Post
                      Hi Chris - sorry for bumping an old thread but I'm trying to do the exact same thing as you with my new Meteobridge PRO and could use some help. Would you mind explaining how you configured your meteobridge to export a properly formatted realtime.txt file? I don't see realtime.txt as an option in the export templates and I'm struggling to figure this out. Any help would be appreciated.
                      Thanks in advance!
                      Dom
                      Hi Dom,

                      MeteoBridge Pro, eh? I was tempted.... couldn't justify the cost and bought a 2-year extension to my MeteoBridge licence instead. maybe in a couple of years...

                      To answer your question, here's the code I use in realtime-template.txt

                      Code:
                      [DD]/[MM]/[YY] [hh]:[mm]:[ss] [th0temp-act] [th0hum-act.0] [th0dew-act] [wind0avgwind-act] [wind0wind-act] [wind0dir-act.0] [rain0rate-act] [rain0total-daysum] [thb0seapress-act] [wind0dir-act=endir] [wind0wind-act=bft.0] m/s C hPa mm 0.0 [thb0seapress-val60:--] [rain0total-monthsum] [rain0total-yearsum] [rain0total-ydaysum] [thb0temp-act] [thb0hum-act.0] [wind0chill-act] [th0temp-val60:--] [th0temp-dmax] [th0temp-dmaxtime.ij]:[th0temp-dmaxtime.kl] [th0temp-dmin] [th0temp-dmintime.ij]:[th0temp-dmintime.kl] [wind0avgwind-dmax] [wind0avgwind-dmaxtime.ij]:[wind0avgwind-dmaxtime.kl] [wind0wind-dmax] [wind0wind-dmaxtime.ij]:[wind0wind-dmaxtime.kl] [thb0seapress-dmax] [thb0seapress-dmaxtime.ij]:[thb0seapress-dmaxtime.kl] [thb0seapress-dmin] [thb0seapress-dmintime.ij]:[thb0seapress-dmintime.kl] [mbsystem-swversion:--] [mbsystem-buildnum:--] [wind0wind-max10] [th0heatindex-act:--] [wind0chill-act:--] [uv0index-act:0.0] 0.0 [sol0rad-act:0] [wind0dir-avg10.0:--] [rain0total-sum60] [forecast-rule] [mbsystem-isday.0] 0 [wind0dir-avg10=endir] 0 m 0.0 [mbsystem-daylength] 0 0
                      Setting up my Meteobridge like so,

                      Click image for larger version

Name:	Realtime Setup Meteobridge.JPG
Views:	1
Size:	25.1 KB
ID:	1191255

                      gets me a realtime.txt every minute. I should note that I have a Vantage Vue and no solar sensor, hence the hard coded zeros for some of the data.

                      I *think* that the Pro uses the same tags as MeteoBridge, so this should work for you as well.

                      Hope that helps.

                      Cheers!

                      Chris
                      Last edited by chrisgrainger; June 19, 2017, 03:49 PM. Reason: Adding comment re tags on the Pro

                      Comment


                        #12
                        Hey Chris thanks for the quick response. Yeah I really hemmed and hawed about getting the pro and just bit the bullet :-)
                        I'm still learning the device, but if I'm reading your settings correctly, then you are reading the template file from the http location (I assume that's your site?) and then the MB sends a realtime.txt file to an FTP site in the rideauwx/ directory?
                        On the pro there is a separate screen to configure the FTP hostname/credentials, etc - so I assume that's the case for you?

                        Comment


                          #13
                          Originally posted by dexterdom View Post
                          Hey Chris thanks for the quick response. Yeah I really hemmed and hawed about getting the pro and just bit the bullet :-)
                          I'm still learning the device, but if I'm reading your settings correctly, then you are reading the template file from the http location (I assume that's your site?) and then the MB sends a realtime.txt file to an FTP site in the rideauwx/ directory?
                          On the pro there is a separate screen to configure the FTP hostname/credentials, etc - so I assume that's the case for you?
                          Hey there,

                          Yup, you upload the template to your site once. Then Meteobridge uses that template, every time period you set, to upload the specific data that you've set in the template. It winds up in a realtime.txt file. In Meteobridge, the FTP setup is at the bottom of the Services page and looks like this.

                          Click image for larger version

Name:	Capture.JPG
Views:	1
Size:	53.3 KB
ID:	1191267

                          Sounds like Boris moved that to it's own page on the Pro. Once you get it set up, Meteobridge does it's thing and you can use that realtime.txt in any software that knows about it.

                          Like so....

                          Code:
                          20/06/17 13:31:46 21.8 68 15.6 4.0 3.1 245 0.0 0.8 1008.9 WSW 2 m/s C hPa mm 0.0 1009.0 46.2 490.8 6.0 27.0 50 21.8 21.6 22.7 13:04 16.1 06:07 4.0 11:32 7.2 11:00 1009.4 11:14 1006.0 02:35 3.2 11222 7.2 21.8 21.8 0.0 0.0 0 237 0.0 192 1 0 WSW 0 m 0.0 15:35 0 0
                          Cheers!

                          Chris

                          Comment


                            #14
                            OK I think I figured it out, thanks so much for your help!

                            I have a local FTP server (on my NAS) and I've successfully been FTPing the realtime.txt file to it every minute. The PRO has local storage which can be shared via SMB so it would be nice to be able to dump the realtime.txt file to that local storage instead of having another network device in the mix (another point of failure, etc). If that's not possible, then I might just install an FTP server on my HS3 machine and point it there. But I'll take that question over to the Meteobridge forum :-)
                            Thanks again Chris you've been very helpful!
                            Cheers, Dom

                            Comment


                              #15
                              Originally posted by dexterdom View Post
                              I have a local FTP server (on my NAS) and I've successfully been FTPing the realtime.txt file to it every minute. The PRO has local storage which can be shared via SMB so it would be nice to be able to dump the realtime.txt file to that local storage instead of having another network device in the mix (another point of failure, etc). If that's not possible, then I might just install an FTP server on my HS3 machine and point it there. But I'll take that question over to the Meteobridge forum :-)
                              Thanks again Chris you've been very helpful!
                              Cheers, Dom
                              I thought of that... running an FTP server on my HS3 machine... but, AFAICS, you can't have more than one FTP account set up on Meteobridge. And that would kill stuff I have going on with my weather website.

                              Can the Pro be set with more than one FTP account?

                              Chris

                              Comment

                              Working...
                              X