1.1.3 • Published 6 years ago

homebridge-snowswitch v1.1.3

Weekly downloads
2
License
MIT
Repository
github
Last release
6 years ago

homebridge-snowswitch

A switch that turns on when it's showing out using local weather forecast

This is a plugin for homebridge that is a simple switch that automatically switches ON when it's going to snow soon and OFF a while after it stops snowing.

Important Upgrade Info

If upgrading from 1.0 to 1.1. We have changed weather provider to DarkSky which uses latitude/longitude for location. There are other changes as well, like separate config values for how long in advance and after snow is detected to turn on/off the switch.

Installation

  1. Install homebridge using: npm install -g homebridge
  2. Install this plugin using: npm install -g homebridge-snowswitch
  3. Gather a free Secret Key for Dark Sky API
  4. Update your configuration file. Read below.

Configuration

Add the following information to your config file.

key no default is the Secret Key as assigned from DarkSky

latitude and longitude fields no default identify the location for the snow checking. You can find the coordinates by looking at Google Maps and finding the numbers after the @ symbol. Eg: @40.7484405,-73.9878584 means Latitude is 40.748 and Longitude is -73.988.

forecastFrequency field default=15 is how frequently (in minutes) to download the weather forecast. Don't do it too frequently or you will use up your API limit for the day.

beforeSnowStarts field default=3 is number of hours before snow starts that the switch should go on.

afterSnowStops field default=3 is number of hours after snow stops that the switch should go off.

precipProbabilityMin field default=0.5 is minimum probability of snow that you want to consider it snowy. From my exerimenting, it appeared that the "snowing" icon is displayed when that probability is over 0.5, but you may want to be more pessimistic. Thanks to i3laze for the suggestion.

"platforms": [
	{
		"platform": "SnowSwitch",
		"name": "Snow Switch",
		"key": "XXXXXXX_GET_YOUR_OWN_KEY_XXXXXXX",
		"latitude": "42.326",
		"longitude": "-71.220",
		"forecastFrequency": 15,
		"beforeSnowStarts": 3,
		"afterSnowStops": 3,
		"precipProbabilityMin": 0.25
	}
]

Why this exists

I created this for a specific use case, which is to turn on and off snow melting mats outside my house.

I have been happy with HeatTrak Snow Melting Mats and when I purchased wireless outlets for them, I liked them even more. So, on one snowy weekend I decided to take the automation to the next level and build this plug-in.

Now, if the local forecast expects snow in the next few hours, the Snow Melting Mats will turn on, and when the snow stops falling, they Mats will turn off a few hours later.

I bought a set of Etekcity outlets and installed homebridge and homebridge-vesync to control them from the my Apple-centric home using HomeKit.

To make them work with HomeKit, I needed to get homebridge working. I had an old Raspberry Pi sitting around so I installed it there and put the device in a closet with the rest of my network gear.

This should work pretty well with any switches you can get working with HomeKit, and if you can also get a homebridge setup working and a DarkSky API key, then the HomeKit App end of this is pretty trivial.

I had originally made additions to homebridge-weather-station-extended, a more sophisticated weather forecasting add-on where I had added fields indicating that it had snowed recently or was expected to snow soon, but that required more complex setup from the iPhone App. I wanted to make something simpler at the front-end and have this single-purpose.

Thanks to @mbriney on github for pointing out that the wunderground api is going away and suggesting DarkSky for the replacement api.

How to set up the automation

  • Launch the iPhone or iPad Home app
  • Create scenes; one to turn on the Snow Mats and another to turn them off
  • Create a new Automation
  • Select An accessory is Controlled as the trigger for the automation
  • Select the Controller IsSnowy
  • Select When to be Turns On
  • Select the Snow Mats On scene
  • Repeat for turning Off when the controller Turns Off

Contributors

This plugin borrowed code from and was inspired by homebridge-weather-station-extended which is a fork of homebridge-weather-station which is a fork of homebridge-wunderground.

1.1.3

6 years ago

1.1.2

6 years ago

1.1.1

6 years ago

1.1.0

6 years ago

1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago