Weather module using UK Met Office data

Begonnen von malc_b, 16 Februar 2017, 20:19:43

Vorheriges Thema - Nächstes Thema

malc_b

My suggestion would be for a module like yahoo weather but using the Met Office data  Met office data is available for free but you do have to sign up for an API key.  It is called datapoint.  I've searched and there are some perl modules datapoint but I've not found any fhem ones.  I would imagine it would be similar to the Yahoo weather module in implementation, perhaps simpler.  Below is an example XML site forecast


<SiteRep><Wx><Param name="F" units="C">Feels Like Temperature</Param><Param name="G" units="mph">Wind Gust</Param><Param name="H" units="%">Screen Relative Humidity</Param><Param name="T" units="C">Temperature</Param><Param name="V" units="">Visibility</Param><Param name="D" units="compass">Wind Direction</Param><Param name="S" units="mph">Wind Speed</Param><Param name="U" units="">Max UV Index</Param><Param name="W" units="">Weather Type</Param><Param name="Pp" units="%">Precipitation Probability</Param></Wx><DV dataDate="2017-02-16T17:00:00Z" type="Forecast"><Location i="350904" lat="51.4576" lon="-2.1147" name="CHIPPENHAM" country="ENGLAND" continent="EUROPE" elevation="47.0"><Period type="Day" value="2017-02-16Z"><Rep D="WSW" F="8" G="13" H="83" Pp="5" S="7" T="10" V="GO" W="7" U="2">720</Rep><Rep D="W" F="8" G="18" H="73" Pp="4" S="11" T="10" V="VG" W="7" U="1">900</Rep><Rep D="W" F="7" G="18" H="80" Pp="5" S="9" T="9" V="GO" W="7" U="0">1080</Rep><Rep D="WSW" F="6" G="18" H="88" Pp="5" S="7" T="8" V="GO" W="7" U="0">1260</Rep></Period><Period type="Day" value="2017-02-17Z"><Rep D="SW" F="6" G="16" H="92" Pp="5" S="7" T="8" V="GO" W="7" U="0">0</Rep><Rep D="WSW" F="5" G="16" H="92" Pp="6" S="7" T="7" V="GO" W="7" U="0">180</Rep><Rep D="SW" F="6" G="11" H="95" Pp="5" S="4" T="7" V="GO" W="7" U="0">360</Rep><Rep D="SSW" F="6" G="9" H="93" Pp="5" S="4" T="7" V="GO" W="7" U="1">540</Rep><Rep D="SW" F="9" G="9" H="81" Pp="5" S="4" T="10" V="GO" W="7" U="1">720</Rep><Rep D="SSW" F="10" G="11" H="73" Pp="2" S="7" T="11" V="VG" W="3" U="1">900</Rep><Rep D="S" F="8" G="11" H="85" Pp="3" S="4" T="9" V="GO" W="2" U="0">1080</Rep><Rep D="S" F="6" G="13" H="94" Pp="6" S="7" T="8" V="GO" W="7" U="0">1260</Rep></Period><Period type="Day" value="2017-02-18Z"><Rep D="S" F="5" G="13" H="95" Pp="9" S="7" T="7" V="GO" W="7" U="0">0</Rep><Rep D="S" F="5" G="13" H="94" Pp="7" S="7" T="7" V="GO" W="7" U="0">180</Rep><Rep D="S" F="4" G="13" H="95" Pp="10" S="7" T="7" V="GO" W="7" U="0">360</Rep><Rep D="S" F="5" G="16" H="94" Pp="10" S="9" T="7" V="GO" W="8" U="1">540</Rep><Rep D="SSW" F="7" G="18" H="86" Pp="9" S="9" T="10" V="VG" W="8" U="1">720</Rep><Rep D="SSW" F="9" G="16" H="81" Pp="6" S="9" T="11" V="VG" W="7" U="1">900</Rep><Rep D="SSW" F="7" G="16" H="90" Pp="7" S="9" T="9" V="VG" W="7" U="0">1080</Rep><Rep D="SSW" F="5" G="16" H="94" Pp="8" S="9" T="7" V="GO" W="7" U="0">1260</Rep></Period><Period type="Day" value="2017-02-19Z"><Rep D="SW" F="5" G="16" H="95" Pp="11" S="9" T="7" V="GO" W="7" U="0">0</Rep><Rep D="WSW" F="5" G="16" H="94" Pp="17" S="9" T="7" V="GO" W="8" U="0">180</Rep><Rep D="W" F="5" G="13" H="95" Pp="14" S="7" T="7" V="GO" W="8" U="0">360</Rep><Rep D="W" F="6" G="16" H="91" Pp="6" S="9" T="8" V="GO" W="7" U="1">540</Rep><Rep D="WNW" F="8" G="18" H="78" Pp="4" S="9" T="10" V="VG" W="7" U="1">720</Rep><Rep D="WNW" F="8" G="18" H="76" Pp="5" S="9" T="11" V="VG" W="7" U="1">900</Rep><Rep D="W" F="7" G="16" H="87" Pp="8" S="9" T="9" V="GO" W="7" U="0">1080</Rep><Rep D="WSW" F="6" G="16" H="93" Pp="9" S="9" T="8" V="GO" W="7" U="0">1260</Rep></Period><Period type="Day" value="2017-02-20Z"><Rep D="WSW" F="6" G="18" H="94" Pp="10" S="9" T="8" V="GO" W="8" U="0">0</Rep><Rep D="WSW" F="6" G="18" H="95" Pp="11" S="9" T="9" V="GO" W="8" U="0">180</Rep><Rep D="WSW" F="7" G="18" H="97" Pp="13" S="9" T="9" V="MO" W="8" U="0">360</Rep><Rep D="WSW" F="8" G="18" H="95" Pp="10" S="9" T="10" V="GO" W="8" U="1">540</Rep><Rep D="W" F="10" G="22" H="90" Pp="6" S="11" T="12" V="GO" W="7" U="1">720</Rep><Rep D="W" F="10" G="25" H="89" Pp="9" S="13" T="12" V="GO" W="8" U="1">900</Rep><Rep D="W" F="8" G="25" H="92" Pp="12" S="13" T="11" V="GO" W="8" U="0">1080</Rep><Rep D="W" F="7" G="25" H="93" Pp="12" S="13" T="10" V="GO" W="8" U="0">1260</Rep></Period></Location></DV></SiteRep>


As this does not format well I've attached a picture of the data too.

This is the xml data for a weather site, one of 5000 in uk.  JSON is also possible.  And there are other forecast available.  All in the info is on the met office datapoint site, but for live data you need  a (free) api key.