Universal weather platform

I wanted to be able to use the built in weather card but with my own sensors for current weather, to be more precise: i wanted to use my netatmo weather station.

So I created a universal weather platform. It inherits all the values from another weather platform (Yahoo weather, Dark Sky or other) but you can override any value (except forecast and condition).

It’s all pretty simple. Just put linked file in the custom_components/weather folder. And configure:

weather:
  - platform: yweather
  - platform: universal
    weather: weather.yweather
    sensors:
      temperature: sensor.netatmo_utomhus_temperature

availible sensors to override is:

  • humidity
  • ozone
  • pressure
  • temperature
  • visibility
  • wind_bearing
  • wind_speed

I hope someone else can benefit from this :slight_smile:

https://gist.github.com/thrawnarn/7ebc1588f4a1c9b93d66efeffb45b373

2 Likes

Very nice, I like the idea of feeding a platform with one’s own data sources. Thanks a lot for sharing! :slight_smile:

This is handy thanks for sharing.

Hi,
I have followed the steps (folder creation, file upload, config edition, etc.), but when I try to restart, it stops and I get this:
Platform error weather.universal - No module named 'homeassistant.components.universal.weather'

I then rebooted the machine, but got this error in the ha log:

2020-02-26 16:34:38 ERROR (MainThread) [homeassistant.config] Platform error: weather
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config.py", line 739, in async_process_component_config
    platform = p_integration.get_platform(domain)
  File "/usr/src/homeassistant/homeassistant/loader.py", line 275, in get_platform
    f"{self.pkg_path}.{platform_name}"
  File "/usr/local/lib/python3.7/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 965, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'homeassistant.components.universal.weather'

I would really like to use your component, I have exactly the same use case (Netatmo Weather Station).
Any idea?
Thanks!