WeatherFlow Weather

WeatherFlow Weather for Home Assistant

GitHub release (latest by date) hacs_badge

The WeatherFlow integration adds support for retreiving weather data from a Personal Weatherstation manufactured by WeatherFlow using a REST API.

There is currently support for the following device types within Home Assistant:

  • Weather
    • Two Weather entities will be created per station. One showing an hour based forecast and one showing a day based forecast.
  • Sensor
    • A whole range of individual sensors will be available. for a complete list of the sensors, see the Github.
  • Binary Sensor
    • A few binary sensors will be available, that can be used to trigger automations, if f.ex. it starts raining.

For full details of the Integration go to Github - WeatherFlow Weather

Looking for local access to your WeatherFlow data

If you are looking for a pure local integration of the WeatherFlow data, i can recommend you look at WeatherFlow2MQTT, which uses the UDP interface of the WeatherFlow device to retrieve data. This is available as a Home Assistant Add-On or a standalone Docker Container.

→ Replaces the SmartWeather Integration

This project is a re-write of the WeatherFlow SmartWeather Integration, which has been removed from HACS and is Archived on Github.
There is no direct upgrade path, but you can have both Integrations installed simultaneous, and as such slowly migrate your UI setup and Automations.

6 Likes

I’ve been using this for a few weeks. It works flawlessly.

Thanks for your work on this Bjarne.

6 Likes

Woow, your dashboard looks cool Tom👍🏻
And thanks.

1 Like

@tom_l ay I ask what cards or UI modifications are you using?

Sorry but I meant the cards, more specifically the forecast ones and tiny ones with temperature, rain, humidity, etc.

3 Likes

Thanks for creating this integration. For the most part it is working well for me. However I’m having an issue when trying to use this with the “Template Weather Provider”. My location for the Tempest unit doesn’t allow for very accurate wind information so I wanted to use the Template Weather to use my Tempest for most things but use NWS from my local airport for wind speed and direction. The issue is with the forecast (the other sensors work just fine with the Weather Template). If I set the forecast template within the Weather Template to use Accuweather, for example, it is all good and this templated weather can be displayed in a weather card. If I change it to use the Weatherflow weather forecast , the creation of the templated weather fails.

Logger: homeassistant.components.weather
Source: components/weather/__init__.py:251
Integration: Weather (documentation, issues)
First occurred: 7:41:04 PM (4 occurrences)
Last logged: 10:00:56 PM

Error adding entities for domain weather with platform template
Error while setting up template platform for weather
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 382, in async_add_entities
    await asyncio.gather(*tasks)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 613, in _async_add_entity
    await entity.add_to_platform_finish()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 747, in add_to_platform_finish
    await self.async_added_to_hass()
  File "/usr/src/homeassistant/homeassistant/components/template/weather.py", line 284, in async_added_to_hass
    await super().async_added_to_hass()
  File "/usr/src/homeassistant/homeassistant/components/template/template_entity.py", line 357, in async_added_to_hass
    await self._async_template_startup()
  File "/usr/src/homeassistant/homeassistant/components/template/template_entity.py", line 334, in _async_template_startup
    result_info.async_refresh()
  File "/usr/src/homeassistant/homeassistant/helpers/event.py", line 895, in async_refresh
    self._refresh(None)
  File "/usr/src/homeassistant/homeassistant/helpers/event.py", line 1072, in _refresh
    self.hass.async_run_hass_job(self._job, event, updates)
  File "/usr/src/homeassistant/homeassistant/core.py", line 433, in async_run_hass_job
    hassjob.target(*args)
  File "/usr/src/homeassistant/homeassistant/components/template/template_entity.py", line 306, in _handle_results
    self.async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 505, in async_write_ha_state
    self._async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 540, in _async_write_ha_state
    attr.update(self.state_attributes or {})
  File "/usr/src/homeassistant/homeassistant/components/weather/__init__.py", line 251, in state_attributes
    forecast_entry = dict(forecast_entry)
ValueError: dictionary update sequence element #0 has length 1; 2 is required

I’m suspecting the problem is the addition of the sunrise and sunset fields included in each forecast attribute of the Weatherflow data; that is the only significant thing that is different when I look at the Weatherflow state vs. Accuweather via the Developer Tools state viewer (Accuweather doesn’t have it). [Seems like sunrise and sunset are redundant anyway since they are available in sun.sun]. Also looking at the forecast dict definition in components/weather/__init__.py trying to figure out what is wrong, it seems like the sunrise and sunset aren’t there either. I’m not a Home Assistant developer, so I may be totally off base on my assumption but thought I would pass along my investigation.

The forecast line I used in configuring the Weather Template is

forecast_template: "{{ state_attr('weather.weatherflow_day_based_forecast', 'forecast') }}"

Just testet this, and I can re-create the error. But it has nothing to do with the extra Sun attributes. Even when removing those, the error is still there. As you, I cannot see any obvious reasons why this fails, so I will have to take a look at the Weather Template in the core integration to see what is expected.

I found the reason, and have made the necessary changes. V1.0.2 is out, and should show up in HACS shortly. Let me know if this fixes it for you.

By George, I believe you got it. Thanks for the quick work and update!

1 Like

I do not have a Weathflow weather station yet but someone close to where I live does. I have a Wordpress website that has a plugin that displays the output from that weather station the only requirements were the ID, Country, Station Name would it be possible to have a different version of your integration that would work in this admittedly more basic way so we could get some local weather without the station.

Pulling the data from WeatherFlow, via the Internet (REST Api), requires an API Token. Currently the only way you can get a working API Token is by owning a WeatherFlow Station, that is registered to an email address you own.

However, until this was implemented, there was a Generic Developer Token that can access data from all Stations where the owner has marked it as Public. This code still works, but I cannot guarantee for how long. Take a look here for more explanation, and the token: Configuration of the Integration · Issue #18 · briis/hass-weatherflow · GitHub

Thanks, the Generic Developer Token worked.

I put in a feature request for RSSI to be added to the API but it’s not getting any traction.

1 Like

Sorry. I have been busy with some other stuff (UniFi Protect Integration in Core HA). I will look at this as soon as possible.

No, no. There’s nothing for you to do yet (and possibly ever regarding this).

The RSSI is not available via the API. So I requested it on the Weatherflow forum. Unfortunately the request only has one vote and is unlikely to be implemented.

1 Like

Well, we’re up to 4 now… :slight_smile:

1 Like

This looks awesome. I understand it uses local data and cloud data. When Tempest is connected through the token, will local data still being pulled if one does not have an internet connection?

This specific integration uses the WeatherFlow REST API to pull all data, so you will need a working Internet connection. If you want to do a Combo, you should look at WeatherFlow2MQTT which uses UDP to get realtime data (No internet connection needed) and if you set it up, it will also pull Forecast data using the REST API and your Token.

1 Like

Thats exactly what I need! I run HA as HomeAssistant OS. WeathFlow2MQTT says it needs Supervised installation type, but I believe, it should also run when using HomeAssistant OS, when I compare the features of HomeAssistant OS vs Supervised mode: Installation - Home Assistant

Can you confirm?