Page 1 of 1

Klartextdatei für WetterCam

Posted: Tue Jan 06, 2009 7:12 pm
by CarstenKR
Hallo,

ist es möglicht, dass Meteohub selbstständig eine TXT-Datei erstellen kann, in welcher frei auswählbare Werte im Klartext vorhanden sind?

Mein Vorhaben: Ich arbeite für meine WetterCam mit Vision GS. Dieses Programm kann in das WebCam-Bild automatisch eine belibige TXT-Datei einbetten, so dass dieser Text über das Bild gelegt wird. Jetzt würde ich gerne einfach ein paar Wetterdaten im Bild anzeigen lassen. Diese müssen Vision GS aber im Klartext vorliegen. Beispiel: Temperatur -11°C, Niederschlag 0mm... Einfach alles hintereinander weg.

Ist es möglich Meteohub eine Funktion zu implementieren, die in einstellbaren Abständen eine solch einfache Datei mit frei selektierbaren Werten generiert und zur Verfügung stellt, so dass Vision GS sich diese einfach abholt und in das Bild einbaut? Da ich kein Programmierer bin, ist mir das mit den bereits zur Verfügung stehenden Mitteln und Dateien des Meteohubs zu kompliziert... :dry:

Re:Klartextdatei für WetterCam

Posted: Tue Jan 06, 2009 10:47 pm
by majland
Sorry to answer in english bur my written german is not good ...

Metetohub can replace the text in a template with the weather values.

It uses a template in i.e /public/graphs/test-template.html

Mine now looke like:
<table border="0" cellpadding="0" cellspacing="2">
<tr>
<td>Temperatur</td>
<td>[actual_th0_temp_c]</td>
<td>°C</td>

etc.

and the result is http://majland.org/weather/NyesteMaaling.html

I can't see any reason why this should not work without the html tags.

Try just to strip out all the html of your sample template and let metohub upload the resulting file as a graph and see if it works like you want it to.

Re:Klartextdatei für WetterCam

Posted: Wed Jan 07, 2009 11:17 am
by CarstenKR
Yes - OK... So I try to reply in english... ;)

Your suggest won't work, because Vision GS shows exactly the content, which the file contains. If I take your solution, the result is show in the added picture... :blush: So it's neccesary, that Meteohub can create a file, which only contains clear text like: Temperatur: -11,0 °C, Wind: SW 2 Bft...

However, with the whole added weather networks, this wish should be simply to be fulfilled by Boris as my afterwards birthday present... Image

Re:Klartextdatei für WetterCam

Posted: Wed Jan 07, 2009 6:06 pm
by skyewright
CarstenKR wrote:So it's neccesary, that Meteohub can create a file, which only contains clear text like: Temperatur: -11,0 °C, Wind: SW 2 Bft...
But it can.

There is no requirement at all for 'html' markup in files that use the template variables, e.g.

Code: Select all

Temperatur: [actual_th0_temp_c] °C
might produce

Code: Select all

Temperatur: -11,0 °C
N.B. You don't want your Vision GS application to include the template itself, you want it to include a file created from the template. Maybe that is a source of confusion?

Re:Klartextdatei für WetterCam

Posted: Wed Jan 07, 2009 6:49 pm
by CarstenKR
Hmmm - maybe someone likes to help me by translating... :huh:

The values, that should be shown on the webcam picture, is not an overlay of values from a html file. Vision GS receive the picture from the cam, add the weather values like you mark a picture with Corel Draw and save this new picture file bevore uploading by ftp.

The author of Vision GS provides a small tool which get actual values from http://www.weatheronline.co.uk/. The content of the file "weather.txt" is exact that, what you see on the uploaded webcam picture = "-13°C (no or few clouds)". Maybe this information is not much and not realy my values from the station.

So back to basic: Is there any possibility by boris to produce such a file by Meteohub even for stupid users like me? ;)

Re:Klartextdatei für WetterCam

Posted: Wed Jan 07, 2009 7:34 pm
by skyewright
CarstenKR wrote:The content of the file "weather.txt" is exact that, what you see on the uploaded webcam picture = "-13°C (no or few clouds)".
So:

a) In the Meteohub graphs folder you set up a template file called weather.html (don't worry about the html extension, see later).
In that template you include just the plain text you want, plus the appropriate [variables].

b) In the Graph Uploads section of the Meteohub interface, you set up an upload for weather* and set weather.txt as the filename.

With that arrangement, at the intervals you have set in Graph Uploads a weather.txt file will be created and uploaded. If I have understood correctly, you'll then let Vision GS do its magic with that file.

Does that make sense?

PS. Sorry I can only offer English.

Re:Klartextdatei für WetterCam

Posted: Wed Jan 07, 2009 8:15 pm
by CarstenKR
skyewright wrote:
PS. Sorry I can only offer English.
So long we do understand us, nevertheless, everything is OK... :cheer: I'm glad if somebody can help!

Sence or no sence - that's the easiest way for me! All the weather network can surely delivered by the same way that you prefer. But here, Meteohub provides a more comfortable solution. Why not for my intention?

I'm glad for my mini basic knowledge in template files. So, I only try to get the best result without any complexity. For me, it' a "clickable" version... But I'll try to use your way, too!

Re:Klartextdatei für WetterCam

Posted: Thu Jan 08, 2009 2:01 am
by admin
Eine Lösung zum Zusammenstellen des Templates per Klicken gibt es leider nicht. Da es abhängig von der Sensorbestückung ca 1000 Werte zur Auswahl gibt, wäre das auch kaum praktikabel.

Man muss nur eine beliebiege Textdatei erstellen. Damit diese als Template von Meteohub bearbeitet werden kann, muss diese im Verzeichnis /public/graphs/ abgelegt werden und auf ".html" enden (es muss kein HTML-kompatibler Inhalt drin sein). In das Template schreibt man jetzt die Zeichen rein, die man haben will. Die Variablen, die Meteohub dann durch Werte ersetzt, sind in eckigen Klammern anzugeben (siehe Beispiel von Skyewright). Welche Variablen es gibt, kann man im Handbuch nachlesen, oder man ruft mal "http://ip-deines-meteohub/meteograph.cgi?text=all" auf. Hier siehst Du die verfügbaren Variablen und den aktuellen Wert.

Wenn das Template fertig ist, kann man bei "Grafiken Hochladen" einstellen, wie häufig es erzeugt werden soll, welchen Zielnamen es haben soll (hier kann man es dann wieder ".txt" nennen). Wenn FTP im Meteohub aktiviert ist, wird die ersetzte Datei auf den Server hochgeladen. Lokal bleibt die letzte aktuelle Version unter "/public/myweb/uploads/" erhalten.

Das Handbuch enthält auch all diese Informationen, eventuell etwas verstreut.

Viel Erfolg

Re:Klartextdatei für WetterCam

Posted: Thu Jan 08, 2009 8:49 am
by CarstenKR
Aaaaaaaaaaha! OK - Jetzt kommt Licht ins Dunkel! Möglicher Weise habe ich die Kollegen nur nicht richtig verstanden. Aber jetzt dürfte ich das auf die Kette bekommen. :)

Danke Dir!