naofireblade / homebridge-weather-plus

A comprehensive weather plugin for homebridge.
MIT License
315 stars 63 forks source link

Support tempest weathflow weather station #266

Closed dacarson closed 1 year ago

dacarson commented 1 year ago

Changes per file. package.json:

  1. Add dependency on weather-formulas which is used in the api/smartweather.js file below.

api/smartweather.js:

  1. WeatherFlow broadcasts UDP packets on the local network. This adds a UDP listener for events, parses them and stores them in the relative parameters.
  2. This file requires UDP support so it requires (dgram)
  3. Also make use of standard weather formulas for some calculations (weather-formulas)

Index.api:

  1. There is no geo location for the weather station is it is assumed to be in the Home
  2. UDP packets are broadcast on the local network and picked up by the plugin. WeatherFlow broadcasts new data every minute, so the update interval is fixed to 1 minute.
  3. As a local wether station, there are a couple of new characteristics that it has: 1. Light level (Illuminance) is available. As light level is a standard HomeKit characteristic, I coded it in the same style as humidity. 2. Weatherflow devices are battery powered, some with solar to charge. I added a battery characteristic for this data source too, similar to light level. 4.

util/compatibility.js:

  1. The default min/max for light level are too restricted for outdoor light levels (lux), increase the range to support outside light levels
  2. Add another temperature object to support WetBulb temperature

util/characteristics.js:

  1. There are four additional characteristics that I believe are interesting to show. 1. Data reported by the WeatherFlow hardware. LightningStrikes (count of lightning strikes in the area), LightningAvgDistance (the average distance of the strikes) and WindLull (Idle wind speed). 2. TemperatureWetBulb. Calculated characteristic from humidity and temperature. Found it to be useful when viewing the current weather status.

accessories/currentConditions.js:

  1. Added support for the HomeKit characteristics LightLevel and Battery

config.schema.json:

  1. Add Tempest WeatherFlow as an option.

README.md:

  1. Add information about Tempest WeatherFlow option
dacarson commented 1 year ago

Tracking merge with https://github.com/naofireblade/homebridge-weather-plus/pull/262