GithubHelp home page GithubHelp logo

cyberhusky69 / homebridge-weather-plus Goto Github PK

View Code? Open in Web Editor NEW

This project forked from naofireblade/homebridge-weather-plus

0.0 0.0 0.0 1.44 MB

A comprehensive weather plugin for homebridge.

License: MIT License

JavaScript 100.00%

homebridge-weather-plus's Introduction

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.

Feel free to leave any feedback here.

Features

  • Get current observations and forecasts for up to 10 days
  • Choose from 4 different weather services
  • Add multiple locations/services
  • See the weather history in the Eve App
  • See translations and icons in the Eve App
  • Use all values in HomeKit rules with the Eve App

Observations and Forecasts

The following 19 observation and forecast values can be displayed and used in HomeKit rules.

  • Air Pressure
  • Cloud Cover
  • Condition
  • Condition Category (Sun = 0, Clouds = 1, Rain = 2, Snow = 3)
  • Dew Point
  • Humidity
  • Ozone
  • Rain Last Hour
  • Rain All Day
  • Rain Chance
  • Solar Radiation
  • Temperature
  • Temperature Min
  • Temperature Max
  • UV-Index
  • Visibility
  • Wind Direction
  • Wind Speed
  • Wind Speed Maximum
  • Observation Time
  • Observation Station
  • Forecast day

Choose your Weather Service

This plugin supports multiple weather services. Each has it's own advantages. The following table shows a comparison to help you choosing one.

Dark Sky (recommended) OpenWeatherMap Yahoo (currently offline) Weather Underground (currently offline)
Current observation values 15 7 10 13
Forecast values 16 9 4 10
Forecast days 7 5 10 4
Location geo-coordinates city name, city id, geo-coordinates city name city name or zip
Personal weather stations ✔️ ✔️
Free ✔️ ✔️ ✔️ ❌ (only legacy accounts)
Register here here not needed here

You can add more services by forking the project and submitting a pull request.

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. Update your configuration file. See the samples below.

Configuration

Below are example configurations for all weather apis.

Dark Sky

The key parameter is the API key that you get by registering for the Dark Sky service.

The locationGeo parameter must be a list with the latitude longitude for your location (dont forget the square brackets). You can use this page to find your coordinates: http://www.mapcoordinates.net/en.

"platforms": [
	{
		"platform": "WeatherPlus",
		"name": "WeatherPlus",
		"service": "darksky",
		"key": "XXXXXXXXXXXXXXX",
		"locationGeo": [52.5200066, 13.404954]
	}
]

OpenWeatherMap

The key parameter is the API key that you get by registering for the OpenWeather service

Please choose from one of these location properties.

The location parameter must be a numerical unique city-id (can be found here)

The locationCity parameter must be a city-name with an optional country code e.g. "Berlin, DE" (you can check it here)

The locationGeo parameter must be a list with the latitude longitude for your location (don't forget the square brackets). You can use this page to find your coordinates: http://www.mapcoordinates.net/en.

"platforms": [
	{
		"platform": "WeatherPlus",
		"name": "WeatherPlus",
		"service": "openweathermap",
		"key": "XXXXXXXXXXXXXXX",
		"location": 2950159,
		"locationCity": "Berlin, DE",
		"locationGeo": [52.5200066, 13.404954]
	}
]

Yahoo

The location parameter is a text for finding a location with YQL (see here)

"platforms": [
	{
		"platform": "WeatherPlus",
		"name": "WeatherPlus",
		"service": "yahoo",
		"location": "Berlin, DE",
		"forecast": [1,2,3,4,5,6,7]
	}
]

Weather Underground

The location parameter can be a city name or a zip. You can also use a station from the Personal Weather Station Network to receive weather information. Just enter pws:YOURID.

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

"platforms": [
	{
		"platform": "WeatherPlus",
		"name": "WeatherPlus",
		"service": "weatherunderground",
		"key": "XXXXXXXXXXXXXXX",
		"location": "New York",
		"forecast": [1,2,3,4]
	}
]

Advanced Configuration

Below are explanations for all advanced parameters of this plugin. Most parameters are optional.

The forecast parameter is optional and defines a list of forecast days with 1 for today, 2 for tomorrow etc. Default are none.

The interval parameter is optional and sets the update interval in minutes. The default is 4 minutes because the rate for free API keys is limited. This parameter is global for all weather accessories.

The units parameter is optional and sets the conventions used for reporting values. The default is "metric". This parameter is global for all weather accessories. The choices are:

  • "si" (or "metric")
  • "us" (or "imperial")
  • "ca" to report wind speeds in km/h instead of m/s
  • "uk" to report visibility in miles and wind speeds in km/h instead of m/s

The language parameter is optional and sets the translation for the description of the day and the weather report for each API. Available languages can be found here. The default is en.

The forecast parameter is optional and defines a list of forecast days with 1 for today, 2 for tomorrow etc. The default is none.

The displayName parameter is optional and sets the CurrentConditons accessory's name. The default is "Now". IMPORTANT NOTE: If setting multiple weather accessories, ensure that each accessory has a unique name, or you will get an error from homebridge. If you do not set this parameter the plugin will take care of that.

The displayNameForecast parameter is optional and sets the Forecast accessories name. If the forecast parameter is present, then the names of the forecasts are prefixed with the displayNameForecast parameter. IMPORTANT NOTE: If setting multiple weather accessories, ensure that each accessory has a unique name, or you will get an error from homebridge. If you do not set this parameter the plugin will take care of that.

The currentObservations parameter is optional and sets how the 3 current observations temperature, humidity and pressure are displayed. You can choose one of these 2 options:

  • "eve" (this combines all 3 values into one row in the eve app but shows nothing in the Apple Home app)
  • "normal" (default, this shows all 3 values in a seperate row in the eve app and shows the temperature in the Apple Home app)

The fakegatoParameters parameter is optional. By default, history is persisted on filesystem. You can pass your own parameters to fakegato-history module using this paramter, in order to change the location of the persisted file or use GoogleDrive persistance. See https://github.com/simont77/fakegato-history#file-system and https://github.com/simont77/fakegato-history#google-drive for more info. IMPORTANT NOTE: Do not modify the parameter for the fakegato internal timer.

The serial parameter is optional and sets the Serial Number of the accessory. If it's not provided the serial number will be set to the location if present, or to 999 if not. Note that for proper operation of fakegato when multiple fakegato-enabled weather accessories are present in your system, the serial number must be unique.

Example

"platforms": [
        {
            "platform": "WeatherPlus",
            "name": "WeatherPlus",
            "interval": 5,
            "displayName":"Conditions OWM",
            "displayNameForecast":"Forecast OWM",
            "service": "openweathermap",
            "key": "XXXXXXXXXXXXXXX",
            "forecast": [1,2],
            "locationGeo": [45.4999952, 9.3061655],
            "serial": "OWM"                        
        }
    ]

Multiple Stations Configuration

You can set up multiple stations for different locations and/or weather services by putting your configuration in an stations array. The parameters interval and units are global to all accessories, and must be set at the top level.

Example

"platforms": [
        {
            "platform": "WeatherPlus",
            "name": "WeatherPlus",
            "interval": 5,
            "units": "si",
            "stations":[{
                "displayName":"Conditions OWM",
                "displayNameForecast":"Forecast OWM",
                "service": "openweathermap",
                "key": "XXXXXXXXXXXXXXX",
                "forecast": [1,2],
                "locationGeo": [45.4999952, 9.3061655],
                "serial": "OWM" 
            },{
                "displayName":"Conditions DS",
                "displayNameForecast":"Forecast DS",
                "service": "darksky",
                "key": "XXXXXXXXXXXXXXX",
                "forecast": [1,2],
                "locationGeo": [45.4999952, 9.3061655],
                "serial": "DS"
            }]
        }
    ]

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.

Screenshots

Current Conditions in Elgato Eve app History graph in Elgato Eve app

(c) Screenshots are taken from the Elgato Eve app

Contributors

Many thanks go to

  • Kevin Harwood for his original homebridge-weather-station
  • Clark Endrizzi for his wundergroundnode library
  • 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 wunderground api

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

Attribution

homebridge-weather-plus's People

Contributors

naofireblade avatar werthdavid avatar kcharwood avatar mrose17 avatar gatopharaoh avatar simont77 avatar ctgreybeard avatar xfjx avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.