Weather conditions with AppHomeKit via homebridge-wunderground and Homebridge

3 minutes of reading
Guide purposes
  • Equip the profirst personal home automation Appthe HomeKit of conditions and weather forecasts through the Home pluginbridge "homebridge-wunderground"
  • Difficulty level: bass
Concepts dealt with:
  • Software installation and configuration
Software components used:
Prerequisites
Physical devices used:
GUIDE more indicated for:

Apple-200x200

Notes and disclaimer
  • qualsiasi eventuale modifica agli impianti domestici dev'essere progettata ed realizzata SOLO da personale qualificato;
  • any changes implemented in probefore is a propersonal responsibility as well as a profirst risk and danger (the contents of the present page are purely educational);
  • any changes implemented in proprior to a device it voids the guarantee, quality approvals and certifications.

Abstract

ATTENZIONE: this guide è superata as the service WUnderground API (at the base of the functionnamento of the plugin) has been discontinued since March 2019. It is advisable to migrate to home plugin implementation guidebridge-weather which uses the free OpenWeatherMap service.

"homebridge-wunderground"Is a plugin Homebridge capable of providing two types of environmental sensors - virtual - one of temperature is one of relative humidity.

That they are virtual comes from the fact the data source exposed to them is not a physical sensor (like this) positioned in the proenvironment but rather a website, specifically Weather Underground, which collects temperatures and other information from stations around the world.

Weather Underground LogoWeather Underground is a site where data from hundreds of thousands of defined weather stations converge PWS (Personal Weather Station) scattered all over the world. These control units communicate with Weather Underground and record, for the area in which they are located, data of different nature such as appanointed temperature, relative humidity but also much more, such as rainfall, solar radiation and more. This data is then taken from the plugin which exposes them to Homebridge, then to our home automation Appthe HomeKits.

This guide illustrates how to configure such plugin at Homebridge.

Index

Installation

Installation, like all Home pluginsbridge - it's very simple.

Run the following command - on unix-based systems (linux, Raspberry etc.) from the terminal, from systems Windows su procommand mpt:

npm install -g homebridge-wunderground

and wait for the end of proprocedure. In the case of systems Windows, omit the word "sudo".

Nb In case Homebridge is already running as a service (as described in our Home installation guidebridge), prosee to interrupt it before installing using the command:

sudo systemctl stop homebridge

Update Searchnamento

To update the package, simply run the following command:

sudo npm update -g -dev homebridge-wunderground

In the case of systems Windows, omit the word "sudo".

Configuration

ACTIVATE the configuration

Like all add-ons for Homebridge, then installation is necessary prosee the configuration, which resides inside the file config.json of Homebridge same. For more specific information (on structure, location) of the configuration file, refer to to this brief guide.

The plugin configuration "homebridge-wunderground "provides for the addition to the configuration file of a new accessory named"Wunderground". An example of minimal configuration is the following:

"accessories": [
  {
    "accessory": "WUNDERGROUND",
    "name": "Weather Underground",
    "device": "WURecklinghausen",
    "key": "xxxxxxxxxxxx",
    "city": "Germany/Recklinghausen",
    "polling": "10"
  }
]
  • "accessory": Defines the name of the platform, which must be" WUNDERGROUND "
  • "name“: Defines the name of the accessory that will be displayed on HomeKit
  • "key": Corresponds to the API key requested from Weather Underground (we will talk about it later)
  • "city“: Defines the city with respect to which the data of temperature and relative humidity are to be recorded
  • "polling“: Defines the number of minutes between an updatenamento and the other (it is recommended not to go under the 5)
How to request the API required for configuration

The API key is a unique string of characters, which is provided free of charge by Weather Underground and which is obtained - upon registration on the site - at this address.

How to specify a specific PWS

Simply indicating the "city", the plugin "asks" Weather Underground for the data for that city and the site responds with of media data compared to all the readings of all the control units who has registered for that area.

A method a little more precise and punctual to obtain the data it is to identify as accurately as possible which unit is closest to the profirst home automation environment and indicate, in the "city" field, that specific control unit.
To do this you need to go to the Weather Underground website and, with the help of the mappe identify the unit that interests us. Once clicked on the control unit of interest, a detailed web page will open.

Let's consider the case of a PWS mail in that of Genoa. The image of the web page will be similar to the one below:

Weather Undergound PWS detail page

Well: the PWS string to be specified in the configuration is the one in the circle in red, or "IGENOA038"
Nothing is easier.

Use

After making the configuration at theapp"House" indication of Appthe iPhone / iPad /macOS appariranno two new icons, one relating to temperature and one related to percentage of relative humidity. In the example below we have associated the two sensors with a room called "Terrazzo", so as to identify them from the other sensors in the home automation system:

homebridge-wunderground on Appthe iPhone

These two new elements can therefore be used for the most common automations configurable on Appthe HomeKits; data readings will come automatically updated every few minutes - as per configuration.


Logo Appthe HomeKitsATTENZIONE: remember that there is on our FORUM community an ad hoc section dedicated to Appthe Homekits, for any doubt, question, information on the specific merit of these components.

inDomus telegram channel