naofireblade / homebridge-weather-plus

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

Add Tempest WeatherFlow as a weather source #261

Closed dacarson closed 1 year ago

dacarson commented 1 year ago

Changes per file. 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

Merged this branch to my forked main and updated the ReadMe. Will propose new pull request.

jlg89 commented 1 year ago

Is this going to get merged into a new release? I can get most of the basic info from my Tempest WeatherFlow by going back & forth to Weather Underground, but the main thing I'm after is lightning notifications, which WU doesn't give me. Does your update use a sensor or switch in HomeKit to display lightning status, so that e.g. it could be used to trigger automations?

dacarson commented 1 year ago

I have not made lightning a sensor or switch, because the two lightning values I get from the observation data are lightning count, ie the number of strikes and average distance to the lightning. I am open to a feature request to move lightning events to a senor or switch. Though off the top of my head I am not sure when I would reset the state.

jlg89 commented 1 year ago

If there's a time stamp associated with the strikes, maybe have a sensor that could be configured to stay on for xx minutes when lightning is detected within yy miles. That sensor could be used for e.g. a swimming pool lightning-safety timer (the 30-30 rule), or a custom config.

jlg89 commented 1 year ago

Or maybe easier...keep track of lightning count, and when it increases, turn on a sensor for, say, ten seconds. That sensor could then be used to trigger other things via Automations, homebridge-dummy, etc.

But maybe this could be done with what you've already added in characteristics.js. How do I go about installing your version of the plugin?