Member-only story

FMI Weather Data for Home Assistant

Anand Radhakrishnan
3 min readApr 20, 2020

--

Best Time Of the Day!

Home Assistant has a number of weather integrations based on multiple open data weather sources. The default weather integration’s data source is MET. I live in Finland and have been using the default integration for weather updates. However as summer approaches, I wanted to derive a “Best Time Of The Day” parameter from the weather forecast. For instance, I would like to know the time of the day, when the temperature is at its highest, with relative humidity between 40–70% and no precipitation. I could plan some outdoor activities around this time. If the Home Assistant is integrated with a Smart Speaker such as Google Assistant or Alexa, it could also tell this time based on a user query.

The local weather service provider in Finland is FMI. However this does not have an integration for Home Assistant. Besides, the forecasts from MET were not as accurate as FMI which is understandable, given that MET predominantly caters to Norway. So I set aside some time to understand if a custom component can be developed for Home Assistant that draws it’s source from FMI. And if this component can be extended to provide the “Best Time Of The Day”. It looks like the developers of Home Assistant have spend considerable time to make the development process as smooth as possible. Even so, for a beginner the task can be daunting!

Nevertheless, I was able to develop a custom component that uses a python library — fmi-weather-client to pull weather observations and forecast from FMI’s Open-Data. Custom component contains integratoins for both the weather and sensor platforms. Here is the link to the code repository and the instructions to setup the custom component in Home Assistant:

Figure-1 is a screenshot of how this looks in Lovelace UI. Left side entity is the sensor platform and the right side entity with weather pictures is the weather platform. The entity on bottom of right side, is the “Best Time Of The Day” sensor.

--

--

Anand Radhakrishnan
Anand Radhakrishnan

No responses yet

Write a response