FHEM and Meteohub

Begonnen von YJB, 01 Dezember 2014, 15:32:44

Vorheriges Thema - Nächstes Thema

YJB

Just wondering if anyone has created a template to integrate meteohub into FHEM; I would love to see my temperature sensors in FHEM, so that I can use these as input for MAX Cube Settings.

I can telnet to Meteohub, and get all the current values:

sandbox:~ # telnet MH 5557
Trying MH ...
Connected to 192.168.0.xxx.
Escape character is '^]'.
<logger>
  <TH date="20141201143045" id="th32" temp="18.4" hum="51" dew="8.1" />
  <RAIN date="20141201143027" id="rain0" rate="0.0" total="3461.0" delta="0.0" />
  <WIND date="20141201143057" id="wind0" dir="118" gust="0.0" wind="0.0" chill="1.9" />
  <THB date="20141201143005" id="thb0" temp="20.0" hum="45" dew="7.7" press="1012.0" seapress="1012.0" fc="1" />
  <DATA date="20141201143035" id="data10" val="2722353.00" />
  <DATA date="20141201143036" id="data11" val="1312143.00" />
  <DATA date="20141201143036" id="data12" val="14868546.00" />
  <THB date="20141201143048" id="thb1" temp="12.6" hum="54" dew="3.5" press="1011.0" seapress="1011.0" fc="2" />
  <TH date="20141201143014" id="th31" temp="11.8" hum="46" dew="0.6" />
  <TH date="20141201143054" id="th3" temp="12.2" hum="48" dew="1.5" />
  <TH date="20141201143044" id="th2" temp="14.3" hum="60" dew="6.6" />
  <TH date="20141201143038" id="th4" temp="1.9" hum="92" dew="0.7" />
  <TH date="20141201143038" id="th21" temp="2.2" hum="100" dew="0.0" />
  <TH date="20141201143038" id="th22" temp="0.6" hum="100" dew="0.0" />
  <TH date="20141201143038" id="th23" temp="1.7" hum="100" dew="0.0" />
  <TH date="20141201143038" id="th24" temp="2.2" hum="100" dew="0.0" />
  <TH date="20141201143038" id="th11" temp="2.2" hum="2" dew="0.0" />
  <SOL date="20141201143044" id="sol4" rad="12" />
  <WIND date="20141201143046" id="wind4" dir="118" gust="2.7" wind="2.2" chill="-0.5" />
  <RAIN date="20141201143038" id="rain4" rate="0.0" total="515.2" delta="0.0" />
  <THB date="20141201143040" id="thb4" temp="13.3" hum="46" dew="1.9" press="1013.5" seapress="1013.5" fc="2" />
  <DATA date="20141201143028" id="data1" val="0.09" />
  <DATA date="20141201143028" id="data3" val="0.57" />
  <DATA date="20141201143028" id="data2" val="0.81" />
</logger>
Connection closed by foreign host.

So ity appears to me that it is do-able, but no clue where to start.


Thanks,
Ysbrand

rudolfkoenig

Im not sure if HTTPMOD is able to get the data, as it normally expects an HTTP Server. But the used HttpUtils is quite tolerant, it will return data even without an HTTP header.

You can of course write your own module (starting with HTTPMOD), something like that is much nicer for an enduser, than configuring HTTPMOD.

YJB

Hi,

Thanks for your answer.

I can probably get the same data using a http request:

wget -O -  http://mh /meteolog.cgi?mode=data
--2014-12-02 10:58:57--  http://mh/meteolog.cgi?mode=data
Connecting to 192.168.0.xxx:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/plain]
Saving to: `STDOUT'

    [<=>                                    ] 0           --.-K/s              20141202095758 th32 17.4 51 7.2
20141202095825 rain0 0.0 3461.0 0.0
20141202095848 wind0 106 2.2 2.4 -1.9
20141202095840 thb0 19.4 45 7.2 1014.0 1014.0 1
20141202095801 data10 2733003.00
20141202095802 data11 1312143.00
20141202095803 data12 14875059.00
20141202095842 thb1 12.7 51 2.8 1013.0 1013.0 2
20141202095854 th31 11.3 46 0.1
20141202095822 th3 11.6 48 1.0
20141202095834 th2 14.4 66 8.1
20141202095838 th4 0.7 93 -0.3
20141202095829 th21 1.1 100 0.0
20141202095757 th22 0.0 100 0.0
20141202095757 th23 1.1 100 0.0
20141202095829 th24 1.1 100 0.0
20141202095829 th11 1.1 2 0.0
20141202095825 sol4 39
20141202095851 wind4 95 0.9 2.2 -0.6
20141202095757 rain4 0.0 515.2 0.0
20141202095753 thb4 12.9 45 1.2 1015.8 1015.8 2
20141202095828 data1 0.00
20141202095828 data3 0.57
20141202095828 data2 0.81
    [ <=>                                   ] 806         --.-K/s   in 0s

2014-12-02 10:58:57 (4.47 MB/s) - written to stdout [806]


Does that help?
Ysbrand

rudolfkoenig

Does that help?

You need the help, not me :)
Take a look at HTTPMOD e.g. here http://www.fhemwiki.de/wiki/Ger%C3%A4te_mit_Web-Interface

YJB

Yeah, I agree  8). Just keep in mind that I'm just starting with this, and still trying the figure out the mechanics.

"Does that help", should really be "Could this work as it's more or less standard http".

Anyways, I'll see what I can figure out. I was just surprised that nobody did anything with Meteohub, being a German product as well.

Cheers,
Ysbrand