Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

homebridge-weather-plus

naofireblade724MIT3.4.0

A comprehensive weather plugin for homekit with current observations, forecasts and history.

homebridge-plugin, weather-station, weather, weather forecast, forecast, observations, history, weather history, Air Pressure, Cloud Cover, Condition, Condition Category, Dew Point, Humidity, Ozone, Rain Chance, Rain Last Hour, Rain All Day, Solar Radiation, Sunrise, Sunset, Temperature, Temperature Min, Temperature Max, Temperature Apparent, UV-Index, Visibility, Wind Direction, Wind Speed, Wind Speed Maximum, Observation Time, Observation Station, openweather, openweathermap, weather underground, tempest weather station, weatherflow weather station

readme

homebridge-weather-plus

npm npm GitHub last commit Weather

This is a weather plugin for homebridge that features current observations, daily forecasts and history graphs for multiple locations and services. You can download it via npm.

Screenshots Screenshots 2 and 3 are taken from the Elgato Eve app.

If you like this plugin and find it useful, I would be forever grateful for your support:

Buy Me A Coffee

Feel free to leave any feedback here.

Features

  • Get 27 observation and forecast values for up to 7 days
  • Choose from 3 different weather services
  • Add multiple locations/services
  • See the weather history in the Eve App
  • See all values, translations and icons in the Eve App
  • See all values in the Home app with compatibility mode "Home"
  • Use all values in HomeKit rules with the Eve App
  • Configure everything easily with the homebridge config-ui-x

Choose your Weather Service

This plugin supports multiple weather services. Each has its own advantages. The following table shows a comparison to help you to choose one.

| | OpenWeatherMap (recommended) | Weather Underground 2 | Tempest weather station 7 | |----------------------------|:-----------------------------------------------------:|:----------------------------------------------------:|:----------------------------------------------------:| | Current observation values | 15 | 12 | 20 | | Forecast values | 186 | 0 | 10 | | Forecast days | today + 76 | 0 | today + 9 | | Location | city name, geo-coordinates | station id | local | | Personal weather stations | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | | Free | :heavy_check_mark: | :heavy_check_mark: (only if you own a station) | :heavy_check_mark: (you need the station) | | Register | here | here | here |

You can add more services easily by forking the project and submitting a pull request for a new api file.

2 You can use the weather underground service only if you can provide weather data from your own station in exchange.
6 uv-index, dew point, sunrise, sunset are only available after registering for the new OpenWeatherMap One Call API 3.0, which is free as well. The old API also has 4 instead of 7 forecast days.
7 Weatherflow's Tempest is a physical weather station that can be installed in your home. Current weather conditions are published on home network.

Installation

  1. Install homebridge using: npm install -g homebridge
  2. Install this plugin using: npm install -g homebridge-weather-plus Note: The installation might take 5 minutes.
  3. Gather an API key for a weather service from the register link in the table above
  4. Configure via the plugin homebridge-config-ui-x or update your configuration file manually. See the explanations and samples below.

Observations and Forecasts

The following observation and forecast values can be displayed and used in HomeKit rules, though not all weather sources provide all values below.
I recommend using the Eve app to see all the values. However, if you don't want to use a 3rd party app, use the compatibility mode home for displaying most values in the Apple home app.

  • Air Pressure
  • Cloud Cover
  • Condition
  • Condition Category 3, 4
  • Dew Point
  • Humidity
  • Ozone
  • Rain Currently
  • Rain Last Hour
  • Rain All Day
  • Rain Chance
  • Snow Currently
  • Solar Radiation
  • Sunrise Time
  • Sunset Time
  • Temperature
  • Temperature Min
  • Temperature Max
  • Temperature Apparent
  • Wet Bulb Temperature
  • UV-Index
  • Visibility
  • Light level
  • Wind Direction
  • Wind Speed
  • Wind Speed Maximum
  • Wind Speed Lull
  • Lightning Avg Distance
  • Lightning Strikes
  • Observation Time
  • Observation Station
  • Day of the forecast

3 Simple: clear (0), overcast (1), rain (2), snow (3)
4 Detailed: clear (0), few clouds (1), broken clouds (2), overcast (3), fog (4), drizzle (5), rain (6), hail (7), snow (8), severe weather (9)

Configuration

Below are example configurations for all weather apis.

OpenWeatherMap

key
The API key that you get by registering for the OpenWeather service API 3.0.

  • The service requires a payment method despite being free for 1000 calls per day. The plugin should not exceed this limit in the default interval configuration, but I cannot guarantee that!
  • To be on the safe side you can limit your api key to 1000 calls on the OpenWeather website under "Billing plans".
  • It can take up to 30 minutes until a newly generated ApiKey is accepted.

locationCity5
City name and optional country code, can be found here.

locationGeo5
List with the latitude and longitude for your location (don't forget the square brackets). You can get your coordinates: here.

5 You need only one of these location options.

"platforms": [
    {
        "platform": "WeatherPlus",
        "service": "openweathermap",
        "key": "YOUR_API_KEY",
        "locationCity": "Berlin, DE",
        "locationGeo": [52.5200066, 13.404954]
    }
]

Weather Underground

Since March 2019 you need to register your own weather station with Weather Underground to get weather data in exchange. After you registered your weather device (here), you can use the API.

key
The API key that you get by registering for the Weather Underground service.

stationId
Your personal StationID.

"platforms": [
    {
        "platform": "WeatherPlus",
        "service": "weatherunderground",
        "key": "YOUR_API_KEY",
        "stationId": "YOUR_STATION_ID"
    }
]

WeeWX

WeeWX is an open source software for your weather station monitoring that can be found (here), to utilize this plugin you need to have the following extension that create a JSON input that can be found here. Once that is installed a JSON response needs to be created using the following template that creates a JSON file on your server which can be created by adding a new file called YOUR_FILE_NAME_HERE.json.tmpl and adding it to the skin.conf file.

key
Weewx doesnt use a key but uses the key as the location for your JSON file. Just place the URL in the key and the app will use that to pull the json location.

locationCity
Used to indicate Weewx version. The homekit plugin requires an location field that is used to run. It technically can be any text you want but I just have added the Current Weewx versin..

"platforms": [
    {
        "platform": "WeatherPlus",
        "service": "weatherunderground",
        "key": "http://weewx.lan/homekit.json",
        "locationCity": "V.4.3.1"
    }
]

Tempest Weatherflow

The Tempest Weatherflow is a local weather reporting device that publishes the current weather on the local network via UDP packets. Data is broadcast once per minute, so the Interval setting is ignored. The physical station can only provide the current weather. This uses data published on your local network for the current weather, and therefore runs fine without an internet connection. Future forecasts are available from Tempest for your weather station using a Personal Use Token and your station id.

key
(Optional - only needed for Forecasts) The API key that you get by logging into your Account and creating a personal use token.

stationId
(Optional - only needed for Forecasts) Your personal StationID. Viewing your station settings, it is the number on the end of the URL.

"platforms": [
    {
        "platform": "WeatherPlus",
        "service": "tempest",
        "key": "PERSONAL_USE_TOKEN",
        "stationId": "STATION_ID"
    }
]

Advanced Configuration

Below are explanations for a lot of advanced parameters to adjust the plugin to your needs. All parameters are optional.

compatibility
Compatibility for the Apple Home app, the Eve app or both. This is required due to limitations in the Apple Home app recognized weather conditions. The default is "eve".
"eve" (recommended) Use this for the Eve app or another 3rd party HomeKit App. All conditions will be displayed. The Apple Home app will show only temperature and humidity.
"eve2" Same as above but the values for temperature, humidity and pressure will be grouped into a single row. The Apple Home app will show nothing.
"home" Use this if you don't want to install a 3rd party HomeKit App but want to see as many values as possible in the Apple Home app6. 3rd party apps will show some useless sensors that are required for Home app support.
"both" Combines eve and home. You will need to hide some useless sensors in the Eve app that are required for Home app support. But after that you will get a solution that looks nice in the Home app and in 3rd party apps at the same time.

6 The following values will be represented as occupancy sensors that trigger on specific limits: CloudCover > 20%, UVIndex > 2, WindSpeed > 4 m/s, Rain, Snow

conditionCategory
Detail level of the condition category. Not available for WeatherUnderground. Default is "simple".
"simple" 4 different categories
"detailed" 10 different categories

extraHumidity (compatibility "eve" or "both")
Separate humidity from the weather accessory to an own accessory if set to true. Default is false.

forecast
List of forecast days with 0 for today, 1 for tomorrow, 2 for in 2 days etc. Default are none []. Maximum depends on the chosen weather service.

hidden
List of observation and forecast values that should not be displayed. Possible options are ["AirPressure", "CloudCover", "Condition", "ConditionCategory", "DewPoint", "ForecastDay", "Humidity", "ObservationStation", "ObservationTime", "Ozone", "Rain1h", "RainBool", "RainChance", "RainDay", "SnowBool", "SolarRadiation", "TemperatureMin", "UVIndex", "Visibility", "WindDirection", "WindSpeed", "WindSpeedMax"]. Don't forget the square brackets.

interval
Update interval in minutes. The default is 4 minutes because the rate for free API keys is limited.

language
Translation for the current day. The default is en.

nameNow
Name for the current condition accessory. The default is "Now". You could set this to your city name or weather service type.

nameForecast
Name for the forecast accessories. Adds a prefix to the forecast days. You could set this to your city name or weather service type as well.

now Option to hide the Now accessory if you only need forecasts. Default is true which shows the Now accessory. Set to false to hide it.

units
Conversions used for reporting values. The default is "metric". The options are:
"si" or "metric"
"sitorr" to report air pressure in mmhg
"us" or "imperial"
"ca" to report wind speeds in km/h "uk" to report visibility in miles and wind speeds in miles/h

thresholdAirPressure (compatibility "home" or "both")
At what threshold should the air pressure sensor trigger? Provide a number without unit. The range depends on your unit setting (sitorr -> mmhg, otherwise -> hPa).

thresholdCloudCover (compatibility "home" or "both")
At what threshold should the cloud cover sensor trigger? Provide a number between 0 (clear) and 100 (overcast).

thresholdUvIndex (compatibility "home" or "both")
At what threshold should the UV-Index sensor trigger? Provide a number >= 0. See https://en.wikipedia.org/wiki/Ultraviolet_index

thresholdWindSpeed (compatibility "home" or "both")
At what threshold should the wind speed sensor trigger? Provide a number without unit. The range depends on your unit setting (si/metric/sitorr -> m/s, ca -> km/h, uk/us/imperial -> miles/h).

fakegatoParameters
Customization of the history storage system. By default, the history is persisted on the filesystem. You can set your own option using this parameter. In order to change the location of the persisted file or to use GoogleDrive. Do not modify the parameter for the fakegato internal timer.

Example

"platforms": [
    {
        "platform": "WeatherPlus",
        "service": "openweathermap",
        "key": "YOUR_API_KEY",
        "locationCity": "Berlin, DE",
        "locationGeo": [52.5200066, 13.404954],
        "compatibility": "both",
        "conditionCategory": "detailed",
        "forecast": [0,1,2,3,4,5,6],
        "hidden": ["CloudCover", "DewPoint"],
        "interval": 5,
        "language": "en",
        "nameNow": "Berlin",
        "nameForecast": "Berlin Forecast",
        "now": true,
        "units": "metric"
    }
]

Multiple Stations Configuration

You can set up multiple stations for different locations and weather services by putting your configuration in a stations array. The following parameters are global and must be placed outside of the array: platform, interval, units.

Each stations must have a unique displayName. If you don't set one, the plugin will take care of that.

Example

"platforms": [
    {
        "platform": "WeatherPlus",
        "interval": 5,
        "units": "si",
        "stations": [
            {
                "displayName": "Berlin",
                "displayNameForecast": "Berlin forefacst",
                "service": "openweathermap",
                "key": "YOUR_API_KEY",
                "forecast": [0,1,2,3,4,5,6],
                "locationGeo": [52.5200066,13.404954]
            },
            {
                "displayName": "Los Angeles",
                "displayNameForecast": "Los Angeles forecast",
                "service": "openweathermap",
                "key": "YOUR_API_KEY",
                "forecast": [1],
                "locationGeo": [34.0536909,-118.2427666]
            }
        ]
    }
]

Example Use Cases

  • Switch on a blue light in the morning when the chance for rain is above 20% today (or white when the forecast condition is snow / yellow when it's sunny).
  • Start your automatic garden irrigation in the evening, depending on the amount of rain today and the forecast for tomorrow.

Hint: To trigger rules based on time and weather condition you will need a plugin like homebridge-delay-switch. Create a dummy switch that resets after some seconds. Set this switch to on with a timed rule. Then create a condition rule that triggers when the switch goes on depending on weather conditions of your choice.

Contributors

Many thanks to the awesome contributors who support the project with pull requests (chronological order):

  • simont77 for his fakegato-history library, the eve weather emulation, the multiple stations feature and several other great improvements
  • GatoPharaoh for his interval option pull request
  • David Werth for integrating the OpenWeatherMap and Yahoo apis
  • Marshall T. Rose for adding support for imperial units and the displayName parameter
  • Bill Waggoner for his fix for the crashing weatherunderground api
  • Russell Sonnenschein for adding the new 2019 weatherunderground api
  • Jay O'Conor for improving the value rounding and fixing the wind sensor for non metric units
  • Angela Herring for adding compatibility mode for total precip and improving the WeatherUnderground integration
  • CHAMLEX for integration the WeeWX api
  • Zerosignal84 for fixing the uv index range
  • Vincent Niehues for adding rain chance characteristic to the OpenWeatherMap api
  • Hendrik-Cv for updating the OpenWeatherMap api to v3.0
  • David Carson for integration with Tempest WeatherFlow and fixing several bugs in different apis (essentially maintaining the plugin since 2023)

Also thanks to numerous people helping with the docs.

This plugin is a fork of homebridge-weather-station which is no longer being developed. That one was a fork of homebridge-wunderground.

Attribution

changelog

0.1.0

  • Added characteristics for precip 1 hour, precip today, wind direction, wind speed, air pressure, visibility, uv-index and station
  • Added condition category for sunny weather
  • Renamed condition values to condition categories
  • Changed condition category values
  • Changed service to temperature-sensor so that the device is recognized by apple home app

0.1.2

  • Added optional parameter "interval"
  • Added debug library

1.0.0

  • Added forecast for today
  • Added forecast for next three days
  • Added configuration for forecast
  • Added observation time
  • Added chance for rain
  • Added wind speed max
  • Changed plugin type to platform

1.0.1

  • Changed names of accessories

1.0.2

  • Fixed config example in readme

1.0.3

  • Added screenshot to description

1.0.4

  • Added condition solar radiation
  • Added log output of API response to identify function

1.1.0

  • Added forecast temperature minimum

1.1.1

  • Fixed negative temperatures shown as 0°C

1.1.2

  • Fixed handling of sometimes flawed weather underground responses

1.2.0

  • Added history in eve app for temperature, relative humidity and air pressure

1.2.1

  • Added persistence for history to handle homebridge restarts
  • Fixed history has gaps with interval greater than 10 minutes

1.2.2

  • Fixed mix-up between air pressure and relative humidity

1.2.3

  • Fixed a crash on startup

2.0.0

  • Renamed from homebridge-weather-station-extended to homebridge-weather-plus
  • Added support for multiple apis
  • Added support for dark-sky api
  • Added condition ozone (dark-sky only)
  • Added condition cloud cover (dark-sky only)
  • Added condition dew point (dark-sky only)
  • Added forecast for 7 days instead of 4 (dark-sky only)
  • Added forecast for air pressure (dark-sky only)
  • Added forecast for cloud cover (dark-sky only)
  • Added forecast for dew point (dark-sky only)
  • Added forecast for ozone (dark-sky only)
  • Added forecast for uv-index (dark-sky only)
  • Added forecast for visibility (dark-sky only)
  • Added language for day and weather description (dark-sky only)
  • Changed configuration to support multiple apis
  • Changed configuration to set exact forecast days

2.0.1

  • Changed readme

2.0.2

  • Changed readme

2.1.0

  • Added support for the OpenWeatherMap api

2.2.0

  • Added support for different units

2.3.0

  • Added displayName parameter

2.4.0

  • Added support for the Yahoo api

2.5.0

  • Added option to show Current Conditions as Eve Weather emulation
  • Added option to pass parameters to fakegato
  • Added option to rename forecastAccessory
  • Added plugin version to Accessory Info
  • Updated debug dependency

2.6.0

  • Added option to set serial number
  • Changed history timer to make use of advantages in newer fakegato version
  • Fixed precipitation calculation in dark sky api

2.7.0

  • Added support for multiple weather stations

2.7.1

  • Fixed crash of homebridge when using expired weather underground api

2.7.2

  • Updated openweathermap dependency to v4.0.0

2.8.0

  • Removed old weather underground api (pre March 2019)
  • Added new weather underground api (post January 2019)

2.8.1

  • Fixed crash in openweathermap api that occured since v2.8.0

2.8.2

  • Fixed crash in weatherunderground on malformed/missing server response

3.0.0

  • Added compatiblity mode for Apple Home app
  • Added boolean sensors for currently raining / snowing
  • Added boolean sensors for rain / snow in the forecast
  • Added option to hide observation and forecast values
  • Added option to have more detailed condition categories
  • Added option to show humidity as an extra accessory
  • Added option to disable the Now accessory
  • Changed readme to improve comprehensibility
  • Changed naming of some parameters (all backwards compatible, no need to update your config)
  • Fixed unsupported forecast day would throw an error in the darksky api
  • Fixed incorrect condition category for mostly cloudy days in the darksky api (was 0, is now 1)
  • Removed serial parameter (automatically assigned now)

  • Warning: Weather history graphs will be cleared and start from scratch with this update

3.0.1

  • Updated readme

3.0.2

  • Updated readme

3.0.3

  • Added rounding for non metric values in Apple Home app

3.0.4

  • Improved rounding
  • Fixed wind sensor trigger for non metric units

3.1.0

  • Added support for config-ui-x
  • Added custom thresholds for apple home sensors

3.1.1

  • Added unit sitorr for air pressure in mmhg

3.1.2

  • Added one more day to Dark Sky forecast
  • Improved error logging for Weather Underground
  • Updated the readme to point out Dark Sky discontinuation
  • Updated dependencies
  • Fixed undefined this.log when converting unkown weather categories
  • Fixed RainBool threshold too strict in DarkSky service

3.1.3

  • Changed minimum required node js version to v10

3.1.4

  • Fixed crash in OpenWeatherMap API

3.2.0

  • Added cloud cover to OpenWeatherMap
  • Added dew point to OpenWeatherMap
  • Added rain last hour to OpenWeatherMap
  • Added rain all day to OpenWeatherMap
  • Added apparent temperature to OpenWeatherMap
  • Added uv index to OpenWeatherMap
  • Added sunrise and sunset to OpenWeatherMap
  • Added 3 more forecast days to OpenWeatherMap (today + 7)
  • Added apparent temperature to DarkSky
  • Added sunrise and sunset to DarkSky
  • Improved integration into config-ui-x
  • Changed precision of dew point, min temperature and max temperature from 0.1 degree to 1 degree
  • Changed precision of rain last hour from 1 mm to 0.1 mm
  • Fixed city name with optional country code will not be found in OpenWeatherMap
  • Fixed some missing weather categories for OpenWeatherMap

3.2.1

  • Improved error handling when the service parameter is missing in config
  • Fixed spelling of threshold parameter (old variant is still working)
  • Fixed crash in WeatherUnderground API when an error occurs

3.2.2

  • Added compatibility sensor for total precipitation
  • Changed precision of WeatherUnderground API to decimal
  • Fixed crash when OpenWeatherMap API returns no data

3.2.3

  • Fixed apparent temperature and dew point not responding if lower than 0°C

3.2.4

  • Fixed temperature not responding if lower than 0°C since v3.2.3
  • Fixed apparent temperature and dew point not responding in compatibility mode home if lower than 0°C
  • Fixed apparent temperature and dew point are not converted to F in compatibility mode eve
  • Fixed startup error when using compatibility mode eve2 (eve with grouping) and forecasts

3.2.5

  • Fixed datatype errors since homebridge 1.3.0
  • Fixed observation time issue in weatherunderground since homebridge 1.3.0
  • Fixed error in history service since homebridge 1.3.0
  • Fixed wrong tempeature in Fahrenheit for dew point and apparent temperature
  • Added donation links for homebridge-ui-x
  • Added error log if no location is provided

3.2.6

  • Fixed missing rain value in forecasts from dark sky API when a day is skipped in config

3.2.7

  • Added WeeWX API
  • Added rain chance to OpenWeatherMap API
  • Updated OpenWeatherMap API to v3.0
  • Fixed uv index range

3.2.8

  • Added backwards compatibility for old OpenWeatherMap API 2.5
  • Fixed getting geo coordinates with API 3.0
  • Removed possibility to get location from id. Please use city name or geo coordinates!

3.2.9

  • Fixed rain last hour and observation time in OpenWeatherMap API 3.0
  • Fixed forecast in OpenWeatherMap API 3.0

3.2.10

  • Fixed logging

3.2.11

  • Fixed crash when weather report is empty

3.3.0

  • Add support for WeatherFlow's Tempest weather station, that reports real time weather data over local network.

3.3.1

  • Fixed JSON parse issue for rain events in Tempest API
  • Fixed serial number to allow it to be unique so History events don't get merged with other weather stations

3.3.2

  • Removed DarkSky API as it's no longer available
  • Fixed crash when an error occurs in OpenWeatherMap report
  • Fixed undefined rain boolean sensor value
  • Fixed several Tempest weather station issues
  • Improved usage of converter

3.3.3

  • Fix Tempest weather station breakage introduced in 3.3.2
  • Fix Rain accumulation

3.3.4

  • Add support to detect failing sensors on Tempest weather station and report failure HomeKit
  • Fix tile naming for Home app so it contains name and value
  • Add support for Sunrise and Sunset for current conditions and forecast with OpenWeather v2.5 (Legacy/Free) API
  • Add support for Sunrise and Sunset for current conditions with OpenWeather v3.0 OneCall API
  • Fix configuration UI to save the threshold values
  • Add support for Forecasts with Tempest weather station.
  • Add extra error logging when OpenWeatherMap URL load fails
  • Add support for light level history
  • Add error handling to WeatherUnderground to indicate if PWS is offline
  • Increase max UV Index value as UV Index values in Australia's outback goes higher than 12
  • Add Rain sensor support to WeatherUnderground
  • Fix units in WeatherUnderground so that values are not converted multiple times

3.3.5

  • Fix issue where compatibility (occupancy) sensors are not showing in Apple's Home app

3.4.0

  • Added support for HomeBridge 2.0
  • The fix in 3.3.4 for tile naming in Home app was not supported with HomeBridge. Add setting of Name property back for HomeBridge compatibility.
  • Fix issue with threshold triggers and WeatherUnderground. In 3.3.4, WeatherUnderground API call was modified and incorrectly return values in km, and km/h.
  • Fix punycode deprication warning and util._extend warning.
  • Move off depricated request package and moved to axios package for all URL loading.
  • Ensure WeatherUnderground passes valid numbers
  • Remove reporting of failing sensors on Tempest weather station as the error status from the unit is erronous