![require(esm) Backported to Node.js 20, Paving the Way for ESM-Only Packages](https://cdn.sanity.io/images/cgdhsj6q/production/be8ab80c8efa5907bc341c6fefe9aa20d239d890-1600x1097.png?w=400&fit=max&auto=format)
Security News
require(esm) Backported to Node.js 20, Paving the Way for ESM-Only Packages
require(esm) backported to Node.js 20, easing the transition to ESM-only packages and reducing complexity for developers as Node 18 nears end-of-life.
homebridge-weather
Advanced tools
Homebridge plugin for displaying the weather from openweathermap.org
Homebridge plugin for displaying the weather, humidity and min- or max-temperature from openweathermap.org
(sudo) npm install -g --unsafe-perm homebridge
(sudo) npm install -g homebridge-weather
config.json
using the sample below (append in the block 'accessories' not 'platforms').Example for configuration by City
"accessories": [
{
"accessory": "Weather",
"apikey": "YOUR_KEY_HERE",
"location": "Stuttgart,de",
"name": "OpenWeatherMap Temperature"
}
]
replace location
with
"locationById": "2172797",
replace location
with
"locationByCoordinates": "lat=48.70798341&lon=9.17019367",
To show daily min/max values, you have to add two additional accessories:
"accessories": [
{
"accessory":"Weather",
"apikey":"YOUR_KEY_HERE",
"locationByCoordinates":"lat=48.70798341&lon=9.17019367",
"name":"Today Min",
"type":"min"
},
{
"accessory":"Weather",
"apikey":"YOUR_KEY_HERE",
"locationByCoordinates":"lat=48.70798341&lon=9.17019367",
"name":"Today Max",
"type":"max"
}
]
To show cloudiness in percent configure as follows:
"accessories": [
{
"accessory":"Weather",
"apikey":"YOUR_KEY_HERE",
"locationByCoordinates":"lat=48.70798341&lon=9.17019367",
"name":"Cloudiness",
"type":"clouds"
}
]
This type publishes a value between 0 and 100 that indicates how far through the day we are where 0% is the sunrise (and everything before) and 100% is sunset (and everything after). 50% is noon accordingly.
For using this value as trigger, you have to define a "pollingInterval" as well, otherwise the value only gets updated while having HomeApp in foreground.
"accessories": [
{
"accessory":"Weather",
"apikey":"YOUR_KEY_HERE",
"locationByCoordinates":"lat=48.70798341&lon=9.17019367",
"name":"Sun",
"type":"sun",
"pollingInterval": 10
}
]
You can add multiple accessories if you want to display additional information like min/max or the temperature of different locations. Just make sure that the field name
is unique
By default, no polling-interval is specified. That means, the temperature is only updated when the Home-App is opened. There might be scenarios though, where you would want to periodically update the temperature e.g. as source for trigger-rules.
OpenWeatherMap has a generous amount of free calls per API-key: you can poll the temperature up to 60 times a minute. Beware that just because you can doesn't mean you should
I'd also suggest that you add a polling-interval only for the type
current, since min and max are forecasts and probably won't change throughout the day.
With the enableHistory
flag, the FakeGato-service is used to log temperature and humidity. This doesn't work with the default Home-App, you have to use the Elgato Eve App.
Since FakeGato requires to log an entry at least every 10 minutes, this feature only becomes active if you set enableHistory
to true AND define an pollingInterval
!
I suggest the following settings:
"accessories": [
{
"accessory": "Weather",
"apikey": "YOUR_KEY_HERE",
"location": "Stuttgart,de",
"name": "OpenWeatherMap Temperature",
"pollingInterval": 10,
"enableHistory": true
}
]
Take a look at the example config.json
Fields:
accessory
must be "Weather" (required).apikey
API-Key for accessing OpenWeatherMap API (required).location
city-name query string (resembles to q-parameter) (required).locationById
cityid query string (resembles to cityid-parameter) (required).locationByCoordinates
geo query string (resembles to geo-parameter) (required).locationByZip
zip query string (resembles to zip-parameter) (required).name
is the name of the published accessory (required).showHumidity
weather or not show the humidity (optional, only works for current weather not forecast, defaults to true).nameHumidity
humidity can have a different name (optional, only works if showHumidity
is true, defaults to the same as name
).type
the type of the displayed value, either "min", "max", "current", "clouds" or "sun" (optional, defaults to "current")pollingInterval
the time (in minutes) for periodically updating the temperature (optional, defaults to 0 which means polling only happens when opening the Home-App)enableHistory
flag for enabling the FakeGato-service (see above) for temperature and humidity logging (optional, defaults to false, only works when polling is enabled)FAQs
Homebridge plugin for displaying the weather from openweathermap.org
The npm package homebridge-weather receives a total of 17 weekly downloads. As such, homebridge-weather popularity was classified as not popular.
We found that homebridge-weather demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
require(esm) backported to Node.js 20, easing the transition to ESM-only packages and reducing complexity for developers as Node 18 nears end-of-life.
Security News
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.