With this you can get the weather data from the FMI. Replace hattula with your desired location.
I have a separate file for restful stuff:
configuration.yaml:
rest: !include rest.yaml
Note that I set a user-agent. I have the impression, the FMI WFS server rate limits the normal python aiohttp user-agent. The Hattula debug sensor just gives me the whole array of values the API gives back. I used that for development and finding values. The station in Hattula e.g. doesn’t seem to have pressure or wind sensors which other stations have.
rest.yaml:
resource: http://opendata.fmi.fi/wfs?service=WFS&version=2.0.0&request=getFeature&storedquery_id=fmi::observations::weather::timevaluepair&place=hattula×tep=10&starttime=-10
headers:
User-Agent: >-
Home Assistant {{ states('sensor.current_version') }} (+https://www.gofferje.net)
scan_interval: 600
sensor:
- name: "Hattula debug"
value_template: "OK"
json_attributes_path: "$.wfs:FeatureCollection.wfs:member[0]"
json_attributes:
- "omso:PointTimeSeriesObservation"
- name: "Hattula Temperature"
value_template: "{{ value_json['wfs:FeatureCollection']['wfs:member'][0]['omso:PointTimeSeriesObservation']['om:result']['wml2:MeasurementTimeseries']['wml2:point']['wml2:MeasurementTVP']['wml2:value'] }}"
unit_of_measurement: "°C"
unique_id: "hattula_temperature"
- name: "Hattula Humidity"
value_template: "{{ value_json['wfs:FeatureCollection']['wfs:member'][4]['omso:PointTimeSeriesObservation']['om:result']['wml2:MeasurementTimeseries']['wml2:point']['wml2:MeasurementTVP']['wml2:value'] }}"
unit_of_measurement: "%"
unique_id: "hattula_humidity"
- name: "Hattula Dewpoint"
value_template: "{{ value_json['wfs:FeatureCollection']['wfs:member'][5]['omso:PointTimeSeriesObservation']['om:result']['wml2:MeasurementTimeseries']['wml2:point']['wml2:MeasurementTVP']['wml2:value'] }}"
unit_of_measurement: "°C"
unique_id: "hattula_dewpoint"