98_openweathermap

Begonnen von betateilchen, 26 Juli 2013, 13:09:09

Vorheriges Thema - Nächstes Thema

betateilchen

@Frank S. probier doch mal die Übertragung mit Hilfe des Moduls, da gibts auch ein paar lesbare Rückmeldungen zur Analyse

@bgewehr:

get owo stationByName Essen,DE liefert bei mir aktuell:


Readings:
     2013-09-08 21:25:10   _dataSource     www.openweathermap.org
     2013-09-08 21:25:10   _decodedWith    XML
     2013-09-08 21:25:10   _httpResponse_g 200 OK
     2013-09-08 21:25:10   g_clouds        92
     2013-09-08 21:25:10   g_humidity      100
     2013-09-08 21:25:10   g_lastWx        2013-09-08T19:25:10
     2013-09-08 21:25:10   g_pressure      1019.72
     2013-09-08 21:25:10   g_stationCountry DE
     2013-09-08 21:25:10   g_stationId     2928810
     2013-09-08 21:25:10   g_stationLat    51.4500
     2013-09-08 21:25:10   g_stationLon    7.0167
     2013-09-08 21:25:10   g_stationName   Essen
     2013-09-08 21:25:10   g_sunrise       2013-09-08T04:56:55
     2013-09-08 21:25:10   g_sunset        2013-09-08T18:01:49
     2013-09-08 21:25:10   g_tempMax       14.1
     2013-09-08 21:25:10   g_tempMin       14.1
     2013-09-08 21:25:10   g_temperature   14.1
     2013-09-08 21:25:10   g_windDir       350
     2013-09-08 21:25:10   g_windSpeed     2.55


Das sind durchaus plausible und aktuelle Daten.
-----------------------
Formuliere die Aufgabe möglichst einfach und
setze die Lösung richtig um - dann wird es auch funktionieren.
-----------------------
Lesen gefährdet die Unwissenheit!

bgewehr

OK, gut. Auf openweathermap.org kommen dazu nur alte Daten...
FritzBox 7590, Synology DS216+II mit Docker
Docker: FHEM mit hmlan, Homebridge, node-red, mosquitto, ems-collector für Buderus EMS mit AVR Net-IO
Gartenwasser über MQTT auf R/Pi A+
Volkszaehler.org auf R/Pi 2B mit Pi_Erweiterung
Raspberrymatic auf R/Pi 4B mit RPI-RF-MOD u. CUL868

Frank S.

Moin.

Danke für den Hinweis. Ich habe es gerade ausprobiert. Auf meiner FritzBox 7390 habe ich allerdings das JSON-Problem.

Werde es die Tage noch einmal ausprobieren.

Schöne Grüße
Frank

betateilchen

ZitatAuf meiner FritzBox 7390 habe ich allerdings das JSON-Problem.

Das ist kein Problem, die Lösung steht auch im Modul beschrieben. Leg Dir im Modulverzeichnis FHEM ein "Dummymodul" namens JSON.pm an, das lediglich aus einer einzigen Zeile besteht:

return 1;

Für den reinen "Sendebetrieb" war es das dann schon, das Laden des Moduls und das Senden von Wetterdaten sollte problemlos funktionieren.

Wenn Du das Modul auch für den Abruf von Wetterdaten benutzen willst, schaltest Du um auf XML mit

attr <deviceName> owoUseXml 1

Dann klappts auch mit dem Datenempfang, für die Decodierung wird dann XML verwendet.



---
-----------------------
Formuliere die Aufgabe möglichst einfach und
setze die Lösung richtig um - dann wird es auch funktionieren.
-----------------------
Lesen gefährdet die Unwissenheit!

rudolfkoenig

@betateilchen, falls Du Interesse daran hast: statt "use JSON" kann man auch "eval require JSON" verwenden, um ein fehlendes JSON.pm zu ueberleben. Siehe z.Bsp TcpServerUtils.pm

betateilchen

Danke für den Tipp, ich werde das nach dem Urlaub mal testen. Das hätte den Vorteil, dass ich dann sogar automatisch auf XML umschalten kann.
-----------------------
Formuliere die Aufgabe möglichst einfach und
setze die Lösung richtig um - dann wird es auch funktionieren.
-----------------------
Lesen gefährdet die Unwissenheit!

Frank S.

Moin.

Danke für die Hilfe. Ich habe das Modul zum Laufen bekommen.

Die Daten werden allerdings immer noch nicht unter "mystats" angezeigt.

Nun bekomme ich nach dem Senden folgende Debug-Ausgabe:

2013.09.09 17:15:59 3: owo owo: started: SendData
2013.09.09 17:15:59 3: owo owo: reading: owoSrc00 temp Temperatursender 16.8
2013.09.09 17:15:59 3: owo owo: reading: owoSrc01 humidity Temperatursender 76
2013.09.09 17:15:59 3: owo owo: debug:   name=FSte&lat=xx.xx&long=y.yy&alt=&temp=16.8&humidity=76&APPID=

Schöne Grüße
Frank

betateilchen

Mich interessieren weniger die Ausgaben im Log, sondern viel mehr die Readings, die mit my_ anfangen.

Übrigens: Du sendest gar keine Daten ab, sondern Dein Modul läuft im Debug-Modus. Manchmal hilft es, die Doku zu lesen.

Setze mal das Attribut owoDebug auf 0

Wenn das Senden aktiviert ist, steht im Log anstatt

2013.09.09 17:15:59 3: owo owo: debug: name=FSte&lat=xx.xx&long=y.yy&alt=&temp=16.8&humidity=76&APPID=

nämlich

2013.09.09 17:15:59 3: owo owo: sending: name=FSte&lat=xx.xx&long=y.yy&alt=&temp=16.8&humidity=76&APPID=



Meine Daten werden aktuell in den owo-Maps auch nicht dargestellt, aber in mystats sind die Daten aktuell.
-----------------------
Formuliere die Aufgabe möglichst einfach und
setze die Lösung richtig um - dann wird es auch funktionieren.
-----------------------
Lesen gefährdet die Unwissenheit!

Frank S.

Moin.

Danke für den dezenten Hinweis. Man sollte doch besser gleich die Doku genau lesen.

Ich habe mal das Attribut owoDebug auf 0 gesetzt und nun funktioniert alles wie gewünscht. Danke für Eure Hilfe.

Schöne Grüße
Frank



HarryT

Hi

Before starting I updated my Fhem installation.

I have a fritzbox 7390 and at the moment I can send data to openweathermap.org but get errors when I read them. Do you still need testers?

I added an empty JSON.pm to my installation with the 1 line added as described in the forum.

In fhem.cfg I have:
define owo openweathermap
attr owo owoUseXml 1

Calling
sub tt($)
{
fhem("get owo stationByName Heidelberg,DE");
}

results in:

Can't locate unicore/Heavy.pl in @INC (@INC contains: /var/InternerSpeicher/fhem/lib/perl5/site_perl/5.12.2/mips-linux /var/InternerSpeicher/fhem/lib/perl5/site_perl/5.12.2/mips-linux /var/InternerSpeicher/fhem/lib/perl5/site_perl/5.12.2 /var/InternerSpeicher/fhem/lib/perl5/5.12.2/mips-linux /var/InternerSpeicher/fhem/lib/perl5/5.12.2/mips-linux /var/InternerSpeicher/fhem/lib/perl5/5.12.2 /opt/lib/perl5/site_perl/5.12.2/mips-linux /opt/lib/perl5/site_perl/5.12.2 /opt/lib/perl5/5.12.2/mips-linux /opt/lib/perl5/5.12.2 . ./FHEM) at /var/InternerSpeicher/fhem/lib/perl5/5.12.2/utf8_heavy.pl line 96.

FHEM 6.3 auf Raspberry Pi3  (1,2 Ghz)
RFXTRX433XL, ZWave, KFL200 and ConBeeIII
Raspberry Pi1 (0,7 Ghz) and Raspberry Pi4 for testing
German reading skills are good.

HarryT

Hello all

I found the solution for my problem. To one who gets the same problems. have a look at http://www.fhemwiki.de/wiki/Unicode_FritzBox

{HT}
FHEM 6.3 auf Raspberry Pi3  (1,2 Ghz)
RFXTRX433XL, ZWave, KFL200 and ConBeeIII
Raspberry Pi1 (0,7 Ghz) and Raspberry Pi4 for testing
German reading skills are good.

HarryT

Zitat von: betateilchen schrieb am So, 28 Juli 2013 11:01Ausblick auf weitere (vielleicht irgendwann) geplante Funktionen:

- Abruf von Vorhersagedaten


That would be nice.

It seems the amount of rain/snow is not shown in fhem yet. Would be good if that is also possible.

{HT}
FHEM 6.3 auf Raspberry Pi3  (1,2 Ghz)
RFXTRX433XL, ZWave, KFL200 and ConBeeIII
Raspberry Pi1 (0,7 Ghz) and Raspberry Pi4 for testing
German reading skills are good.

betateilchen

Zitat von: betateilchen schrieb am Mo, 09 September 2013 20:11Meine Daten werden aktuell in den owo-Maps auch nicht dargestellt, aber in mystats sind die Daten aktuell.

Im Moment werden meine Wetterdaten auch in den Maps wieder korrekt angezeigt.
-----------------------
Formuliere die Aufgabe möglichst einfach und
setze die Lösung richtig um - dann wird es auch funktionieren.
-----------------------
Lesen gefährdet die Unwissenheit!

betateilchen

Zitat von: HarryT schrieb am Mi, 11 September 2013 15:40It seems the amount of rain/snow is not shown in fhem yet. Would be good if that is also possible.

The module can alreadz handle this without any problem. Data for rain and snow will be shown if they are delivered in station's answer. But there are two problems:

1. Not all stations provide these informations in answer dataset
2. Dataset in XML does not contain same data than the JSON dataset, normally XML contains less data

-----------------------
Formuliere die Aufgabe möglichst einfach und
setze die Lösung richtig um - dann wird es auch funktionieren.
-----------------------
Lesen gefährdet die Unwissenheit!

HarryT

Zitat von: betateilchen schrieb am Do, 12 September 2013 09:56
Zitat von: HarryT schrieb am Mi, 11 September 2013 15:40It seems the amount of rain/snow is not shown in fhem yet. Would be good if that is also possible.

The module can alreadz handle this without any problem. Data for rain and snow will be shown if they are delivered in station's answer. But there are two problems:

1. Not all stations provide these informations in answer dataset
2. Dataset in XML does not contain same data than the JSON dataset, normally XML contains less data


I use the version which came with FHEM update on my Fritzbox 7390. Is this the latest?

The module displays the complete xml it gets in the logfile. Good for debuging, but I would suggest to surpress this in the end, the same for the data sended to openweathermap. The same for the sended data.
In the xml I see the rain amount. But in the readings I don't see them.

If it helps, I volunteer for testing your module on FB7390 and deliver feedback.

{HT}
 
FHEM 6.3 auf Raspberry Pi3  (1,2 Ghz)
RFXTRX433XL, ZWave, KFL200 and ConBeeIII
Raspberry Pi1 (0,7 Ghz) and Raspberry Pi4 for testing
German reading skills are good.