自定义天气和传感器平台从芬兰气象研究所(FMI)开放数据API(FMI)中提取天气数据(https://en.ilmatieteenlaitos.fi/open-data).

Platforms

目前,这支持天气和传感器平台。
传感器平台还提供类型Best Time of the Day,基于用户偏好,可以用于触发户外活动的通知。

Installation Instructions

代码存储库

一定要试一试,让我知道您的反馈。

3个喜欢

刚刚安装,看起来不错!好东西。我计划将其与汽车融合在一起,以避免在雨水较高时不必要的割草。作为芬兰,此信息绝对比黑暗的天空或其他平台更可靠。非常感谢!

Couple of questions though; when you use this yourself do you get same forecast data from the fmi platform that you get fromiLmatieteenlaitos.fi?由于某种原因,我每小时的预测都不同……尽管该位置可能是这里的关键,因为网页不是我的纬度/经度,而是我想假设的一般区域。

其次,与天气平台有关;知道如何提取预测属性吗?我有兴趣选择预测状况,但是由于属性中有多个属性,因此我真的不知道如何制定模板。随着Google上的快速搜索很短。

谢谢!!

I also noticed thatiLmatieteenlaitos.fi观察/预测与通过其可用的观测/预测不同开放数据API。我不确定是由于位置还是由于该API更新的预测数据的频率。在他们的网页上说,预测模型每天更新一次,但这是我唯一能找到的细节。Web服务可能比Open-DATA API更频繁地更新。

The weather sensor produces an array of forecast objects. One possible template example to extract today’s condition and temperature for an action, could be:

{%在state_attr中的预测(“ weather.fmi”,“ forecast”)%} {%如果forecast.dateTime.day == now()。day%}条件为{{forecast.condition}},温度为{{{{{forecast.temperature}}} {%如果forecast.temperature> 15%}做某事!{%endif%} {%endif%} {%endfor%}

如果我在开发人员工具中尝试此操作 - >模板编辑器,我会得到:

Condition is sunny and temperature is 17.5 Do something!!

希望这可以帮助!

谢谢,非常感谢!

Hi Anand,

您是否认为根据位置集以及何时发生的距离FMI传感器将属性添加到距离的FMI传感器中?我知道FMI具有数据,但不确定是否在同一数据库中您从中获取此预测信息?

Hi,

我不确定这些信息是否在预测数据库中可用。但是,还有其他一些商店。我会检查并回来。

问候,
Anand.

Hi,

Finally I got some time to get this working. Please check the latestcommit。I tested this with current HASS version and develop branch and it works fine. Do let me know if you face any issues.

问候,
Anand.

Hi,

I can’t seem to get this to work. I’ve downloaded the files under /custom_components/fmi and added the example sensor config to configuration.yaml (also tried the weather platform, same results).

19463331伟德国际家庭助理说:“平台错误传感器。FMI-未找到集成'FMI'。”

有任何想法吗?尝试了多个重新启动。

我正在经营家庭助理监督,19463331伟德国际版本0.114.4。

Hi,

我有0.115,看不到任何问题。您是否有详细的日志,显示出某种跟踪路径?恒定值 - unit_percentage之一被核心HASS模块中的百分比替换。这是一个破裂的变化,使FMI在0.115中发挥了非功能性。这是在最新的FMI版本中修复的,以使其适用于0.115。我相信这是在您的环境中引起问题的原因。

升级到0.115可能是一个好主意,否则我可以尝试避免核心HASS依赖性以使其向后兼容。这可能需要一些时间。让我们来看看。

Hi,

我升级到了最新版本,那里没有帮助:S

Here’s a paste from the HA logs section:

Logger: homeassistant.setup Source: custom_components/fmi/__init__.py:171 First occurred: September 24, 2020, 9:22:24 PM (1 occurrences) Last logged: September 24, 2020, 9:22:24 PM Error during setup of component fmi Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/setup.py", line 213, in _async_setup_component result = await task File "/config/custom_components/fmi/__init__.py", line 171, in async_setup for index, entity in enumerate(config[DOMAIN], start=0): KeyError: 'fmi'

When I downloaded the master.zip and unzipped it to the /fmi directory, the zip had a directory inside it. I removed that and the files are directly under /fmi. Is this okay?

I have a feeling that this is a really stupid user error, but my knowledge of these custom integrations are close to none and therefore can’t avoid those errors:smile:

Hi,
我有0.115.2版本

我删除了Custom_components下的现有目录,并执行了与您相同的步骤:

  1. Download fmi-hass-custom-master.zip
  2. Unzip all files into fmi diretory under custom_components. This is how it looks finally:
anandpr@anandpr-HP-ZBook-15-G3:/usr/share/hassio/homeassistant/custom_components/fmi$ ls -lhrt total 60K -rwxr--r-- 1 root root 4,2K syys 22 23:30 weather.py -rwxr--r-- 1 root root 14K syys 22 23:30 sensor.py -rwxr--r-- 1 root root 5,7K syys 22 23:30 README.md -rwxr--r-- 1 root root 241 syys 22 23:30 manifest.json -rwxr--r-- 1 root root 1,1K syys 22 23:30 LICENSE -rwxr--r-- 1 root root 12K syys 22 23:30 __init__.py -rwxr--r-- 1 root root 2,5K syys 22 23:30 const.py drwxr-xr-x 2 root root 4,0K syys 27 18:46 __pycache__ anandpr@anandpr-HP-ZBook-15-G3:/usr/share/hassio/homeassistant/custom_components/fmi$
  1. Perform a hass restart or even better a host restart.

In my case, home assistant is running as a docker container on a ubuntu host. I m not seeing error logs as shown above.

嗨,感谢您的FMI集成。我已经安装了AS NOW,最终结果看起来应该如此。但是,传感器平台没有更新?我认为它在2020.12工作,但不确定,因为最后一个值持续了一段时间。
现在我正在运行20.10.2,天气正常,但传感器却不吗?
图像图像

@vesatakomo:感谢您尝试!刷新电话中有一个错误。而且我不确定发行版之间发生了什么变化,但是现在需要对更新功能进行手动调用。无论哪种方式,我现在都对此进行了测试,并且似乎工作正常。请尝试latest versionand let me know how it goes.

Hi Anand,
抱歉,我花了一些时间,但是现在我已经更新并遵循了价值。一切似乎都很好。
I’ll put these sensors in good use.:slight_smile:

1喜欢

Hello!

感谢您创建此集成!

To get the integration added, I had to install geopy module. Not sure if this was the right way to go, but what I did was (on freebsd host):

cd /usr/local/share/homeassistant/
/usr/local/bin/bash
Python3.8 -M Venv。
source ./bin/activate
pip3.8 install geopy

With that done, seems to work great!

1喜欢

@kossikenguru
感谢您尝试此操作,并对您的迟到的迟到!

geopy is needed for reverse geocoding the location of closest lightning strike. So what you did seems to be right.

问候,
Anand.

@anand-p-rthanks for this! This is far more accurate here in Finland than other weather integrations for sure.

1喜欢

@anand-p-rI installed this today and it’s working fine. One question though: by default, it’s showing the hourly forecast. I would like to see daily forecast (like the default integration does). How can I change that? I’m using this with the Weather Forecast card.

Another question: may I now completely remove the Met.no integration?

1喜欢

Hi@Jay_Jay: You can find the FMI integration under the Configuration → Integrations page. On the FMI card, there is a link that says OPTIONS. Click that and you will find a menu to update forecast interval and other goodies as well.
但是,如果选择预测间隔为24小时,默认情况下FMI python client librarythat this integration uses, only fetches the forecast for the next 2 days. Hope this helps.

1喜欢

How come I didn’t notice that. Thanks!