Page 1 of 3

Meteobridge Weather XML

PostPosted: Tue Mar 12, 2019 12:16 pm
by Korey
Hey Dave!!

I am trying to pull the XML data out of my Meteobridge weather hub.

example here:

https://www.meteobridge.com/wiki/index. ... n_Services

This is the code that is returned in my browser:

http://192.168.0.227/cgi-bin/livedataxml.cgi

Code: Select all

This XML file does not appear to have any style information associated with it. The document tree is shown below.
<logger>
<TH date="20190312175152" id="th0" temp="12.7" hum="80" dew="9.3" lowbat="0"/>
<THB date="20190312175152" id="thb0" temp="12.7" hum="80" dew="9.3" press="935.7" seapress="1008.8" fc="-1" lowbat="0"/>
<WIND date="20190312175238" id="wind0" dir="45" gust="0.6" wind="0.7" chill="12.7" lowbat="0"/>
<UV date="20190312175158" id="uv0" index="2.9" lowbat="0"/>
<SOL date="20190312175158" id="sol0" rad="292" lowbat="0"/>
<RAIN date="20190312175158" id="rain0" rate="0.0" total="5.2" delta="0.0" lowbat="0"/>
</logger>


Ghost connects, I get a Parse Error and a weird deviceTimestamp.

Suggestions on how I can parse this data?

Thanks! :D

Re: Meteobridge Weather XML

PostPosted: Tue Mar 12, 2019 12:40 pm
by DaveL17
Hi Korey! I'll have to play around with this a bit and see what I can figure out. My initial reaction is that it looks to me like the XML data that's returned is malformed. The plugin expects that an 'xml namespace' (xmlns) be a part of the payload. An example:

Code: Select all
This XML file does not appear to have any style information associated with it. The document tree is shown below.

<Devices-Detail-Response xmlns="http://www.embeddeddatasystems.com/schema/owserver" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<PollCount>2336821</PollCount>
<DevicesConnected>3</DevicesConnected>
<LoopTime>0.626</LoopTime>
<DevicesConnectedChannel1>3</DevicesConnectedChannel1>
<DevicesConnectedChannel2>0</DevicesConnectedChannel2>
<DevicesConnectedChannel3>0</DevicesConnectedChannel3>
<DataErrorsChannel1>0</DataErrorsChannel1>
<DataErrorsChannel2>0</DataErrorsChannel2>
<DataErrorsChannel3>0</DataErrorsChannel3>
<VoltageChannel1>4.73</VoltageChannel1>
<VoltageChannel2>4.72</VoltageChannel2>
<VoltageChannel3>4.73</VoltageChannel3>
<VoltagePower>4.96</VoltagePower>
<DeviceName>OWServer_v2G-WiFi</DeviceName>
<HostName>EDSOWSERVER2WIFI@</HostName>
<MACAddress>XX:XX:XX:XX:XX:XX</MACAddress>
<DateTime>2019-03-12 12:34:12</DateTime>
</Devices-Detail-Response>

The second possibility, although a distant second, is that all the data are provided as tag attributes. The plugin should be able to handle that, so I don't think that's the issue.

The deviceTimestamp value looks fine (it's a POSIX Epoch timestamp) which is seconds since 1970-01-01 00:00:00.

Let me play around with the data a little bit and see what I can figure out.

Re: Meteobridge Weather XML

PostPosted: Tue Mar 12, 2019 6:42 pm
by DaveL17
Hi Kory - it seems that I was partially right. The XML is malformed, but an XML namespace isn't required. I modified your XML data like this:

Code: Select all
<?xml version="1.0" encoding="utf-8" ?>
<logger>
<TH date="20190312175152" id="th0" temp="12.7" hum="80" dew="9.3" lowbat="0"/>
<THB date="20190312175152" id="thb0" temp="12.7" hum="80" dew="9.3" press="935.7" seapress="1008.8" fc="-1" lowbat="0"/>
<WIND date="20190312175238" id="wind0" dir="45" gust="0.6" wind="0.7" chill="12.7" lowbat="0"/>
<UV date="20190312175158" id="uv0" index="2.9" lowbat="0"/>
<SOL date="20190312175158" id="sol0" rad="292" lowbat="0"/>
<RAIN date="20190312175158" id="rain0" rate="0.0" total="5.2" delta="0.0" lowbat="0"/>
</logger>


Then the data parsed perfectly.

Code: Select all
...
states : States : (dict)
     RAIN : None (string)
     RAIN_date : 20190312175158 (string)
     RAIN_delta : 0.0 (string)
     RAIN_id : rain0 (string)
     RAIN_lowbat : 0 (string)
     RAIN_rate : 0.0 (string)
     RAIN_total : 5.2 (string)
     SOL : None (string)
     SOL_date : 20190312175158 (string)
     SOL_id : sol0 (string)
     SOL_lowbat : 0 (string)
     SOL_rad : 292 (string)
     TH : None (string)
     THB : None (string)
     THB_date : 20190312175152 (string)
     THB_dew : 9.3 (string)
     THB_fc : -1 (string)
     THB_hum : 80 (string)
     THB_id : thb0 (string)
     THB_lowbat : 0 (string)
     THB_press : 935.7 (string)
     THB_seapress : 1008.8 (string)
     THB_temp : 12.7 (string)
     TH_date : 20190312175152 (string)
     TH_dew : 9.3 (string)
     TH_hum : 80 (string)
     TH_id : th0 (string)
     TH_lowbat : 0 (string)
     TH_temp : 12.7 (string)
     UV : None (string)
     UV_date : 20190312175158 (string)
     UV_id : uv0 (string)
     UV_index : 2.9 (string)
     UV_lowbat : 0 (string)
     WIND : None (string)
     WIND_chill : 12.7 (string)
     WIND_date : 20190312175238 (string)
     WIND_dir : 45 (string)
     WIND_gust : 0.6 (string)
     WIND_id : wind0 (string)
     WIND_lowbat : 0 (string)
     WIND_wind : 0.7 (string)
     deviceIsOnline : true (bool)
     deviceIsOnline.ui : Updated (string)
     deviceLastUpdated : 03/12/2019 at 19:29 (string)
     deviceTimestamp : 1552436953.246493 (real)
...

Screen Shot 2019-03-12 at 7.34.09 PM.png
Screen Shot 2019-03-12 at 7.34.09 PM.png (19.31 KiB) Viewed 6947 times


If you can find a way to save your data to a file with the first line added to it (like with a Python script), you'll then be able to add it to GhostXML pretty easily.

Re: Meteobridge Weather XML

PostPosted: Tue Mar 12, 2019 7:10 pm
by Korey
Cool Dave, I'll play with it and see what I can do.

Perhaps I'll send the Meteobridge guys this info and see if they can fix it on their end.

Thanks again!

Re: Meteobridge Weather XML

PostPosted: Tue Mar 12, 2019 7:24 pm
by DaveL17
Hang on a sec Korey. I'm going to shoot you an email.

Re: Meteobridge Weather XML

PostPosted: Tue Mar 12, 2019 7:45 pm
by DaveL17
It seems that Safari hides the first line, so this:

Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<note>
<to>Tove</to>
<from>Jani</from>
<heading>Reminder</heading>
<body>Don't forget me this weekend!</body>
</note>


Becomes this:
Code: Select all
This XML file does not appear to have any style information associated with it. The document tree is shown below.
<note>
<to>Tove</to>
<from>Jani</from>
<heading>Reminder</heading>
<body>Don't forget me this weekend!</body>
</note>


But in sharing information off-line, Korey's source does not include that needed line. We'll post a solution when we work it out.

Re: Meteobridge Weather XML

PostPosted: Tue Mar 12, 2019 8:50 pm
by DaveL17
UPDATE: Working with Korey offline, we were able to determine that the Meteobridge is accessible with the GhostXML plugin with Basic Authentication enabled.

Screen Shot 2019-03-12 at 9.48.50 PM.png
Screen Shot 2019-03-12 at 9.48.50 PM.png (131.09 KiB) Viewed 6924 times

Re: Meteobridge Weather XML

PostPosted: Wed Sep 11, 2019 12:02 pm
by norcoscia
The battery is dead in my netatmo wind sensor (again) and I'm getting too old to go on top of my roof and replace them. I'm thinking about trying something new like WeatherFlow (solar powered) out but I don't the understand the Meteobridge interface part of it.

Is Meteobridge HW or just SW - if HW where do I look at it and how much does it cost - if SW where does it run - there seems to be various types but the write up I googled looks like a 3 day project to understand and my life is complicated enough?

Please help an old guy out and let me know (if anyone has time).

PS. the WeatherFlow web page said it works with Alexa so maybe that is an easier way to interface indigo to it - it also has an API

https://weatherflow.github.io/SmartWeather/api/

But that is out of my league :-)

Re: Meteobridge Weather XML

PostPosted: Wed Sep 11, 2019 3:53 pm
by DaveL17
I don't know anything on the hardware side, so I can't help there. Good luck. I hope someone can get you the information you need (or go up on your roof to replace the dead batteries).

Re: Meteobridge Weather XML

PostPosted: Wed Sep 11, 2019 4:16 pm
by norcoscia
Looks like a really nice system but I want to find out if I can get the data into indigo w/o needing to go up to a cloud. Looks like it has a web interface and also interfaces to lots of home automation services but indigo is not on any list I have found.

Hard to believe no one is using this system if it is easy to interface to it.

Re: Meteobridge Weather XML

PostPosted: Wed Sep 11, 2019 9:50 pm
by Korey
norcoscia wrote:
Looks like a really nice system but I want to find out if I can get the data into indigo w/o needing to go up to a cloud. Looks like it has a web interface and also interfaces to lots of home automation services but indigo is not on any list I have found.

Hard to believe no one is using this system if it is easy to interface to it.



I use it with my Weatherflow setup, it works very well.

All you need is a cheap TP link router or any one they recommend, then you flash it with the Meteobridge firmware.

No cloud, all local data is available, as a plus it lets you upload to MANY weather services if you choose.

They have a 14day trial before you need a license. I believe it was $70.00

Really great system!

Re: Meteobridge Weather XML

PostPosted: Thu Sep 12, 2019 6:15 am
by norcoscia
Thanks for the information Korey - you are the best - I have never flashed a router before -- sounds scary - I will look through the pile of old routers in my computer room closet - maybe I'll get lucky :-)

Forgot to ask - so no way to interface Indigo with it w/o the router, GhostXML Plug-in and Meteobridge SW?

Re: Meteobridge Weather XML

PostPosted: Thu Sep 12, 2019 12:00 pm
by Korey
norcoscia wrote:
Thanks for the information Korey - you are the best - I have never flashed a router before -- sounds scary - I will look through the pile of old routers in my computer room closet - maybe I'll get lucky :-)

Forgot to ask - so no way to interface Indigo with it w/o the router, GhostXML Plug-in and Meteobridge SW?


Easy to flash, just find the admin screen / update firmware and load the Meteobridge file!


I use Dave's fantastic GhostXML to poll the device every 15 seconds and grab the XML and feed Indigo. :D

Re: Meteobridge Weather XML

PostPosted: Fri Sep 13, 2019 10:06 am
by norcoscia
Looks like too much time has passed - I can't find a router (cheap) that supports the flash via web interface - the TFTP method is out of my league. Am I missing something?

Do you know of any one that has a plug-in that uses the API?

Re: Meteobridge Weather XML

PostPosted: Fri Sep 13, 2019 10:20 am
by Korey
norcoscia wrote:
Looks like too much time has passed - I can't find a router (cheap) that supports the flash via web interface - the TFTP method is out of my league. Am I missing something?

Do you know of any one that has a plug-in that uses the API?



How about this one for $25.00? you just flash from the web interface.

Or, there are plenty to choose from on this page

No plugin that I know of.