Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support Tempest Weatherflow weather station (#262)
* Add Tempest WeatherFlow as a weather source 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 * Correct WeatherFlow links Add the correct links to the ReadMe * Properly support condition detail Support the condition detail setting. * Add support for RainBool characteristic RainBool reports if it is raining right now. * Update Tempest battery percent Use the details published about Tempest battery levels to better calculate the current battery percentage * Update compatibility.js LightLevel is not a compatible type, it is actually a native type. Remove it from the list of compatible types. Issue was reported here: #262 (comment) * Update package.json Add the dependency on weather-formulas that support for Tempest weather station requires. As reported here: #262 (comment) * Update package.json Fix typo when adding new dependency. * Persist current values Persist the current values so that when HomeBridge is restarted it doesn't take up to a minute to get the values. Also this will ensure that the current Daily Rainfall total is close to being correct. Rain over the last hour is lost still during a restart. Also adding Tempest/Weather Flow support is a significant update to the plugin bump the version to 3.3 * Update apis/smartweather.js Co-authored-by: Wim Leers <[email protected]> * Rename to tempest Change internal weather station type token from smartweather to tempest. * Add comment for wet-bulb Add a link for more information on what wet-bulb temperature is. * Incorporate feedback Add a header block with a general description of the API Change attribution to Weatherflow Tempest. Separate calculated Characteristics from measured Characteristics. Update some comments Add a TODO for forecasts * Save and restore rainfall over last minute Don't assume that the function getHourlyAccumulatedRain is called every minute. Rather pass in the observation time and store the rainfall reported for that observation time. Clear any skipped minutes. Save the rainfall array with a time to live of an hour. * Remove unused code Wet bulb temperature is not listed as a compatibility Service in the compatibility array, therefore it won't appear when Apple Home or Apple Home (plus Eve) is selected in Settings. This is ok as it is just a calculated value. * Adjust max value for wet-bulb temp The maximum observed wet bulb temperature is in the high 30s according to Wikipedia, therefore override the Temperature Service maximum value from 100 to 40. * Update Changelog to include changes in new version New version of plugin now supports Weatherflow's tempest weather station * Update apis/smartweather.js Co-authored-by: Wim Leers <[email protected]> * Update README.md Co-authored-by: Wim Leers <[email protected]> * Update index.js Co-authored-by: Wim Leers <[email protected]> * Update apis/smartweather.js This is only an issue with the old/depricated 'AIR' weather station module. The current Tempest weather station does not include this field. Co-authored-by: Wim Leers <[email protected]> * Update apis/smartweather.js I'll also change the corresponding 'getItemSync()' Co-authored-by: Wim Leers <[email protected]> * Rename class to TempestAPI Rename to TempestAPI Revert to persisting array via loop * Update weatherflow.js * Update README.md Update readme and add table. * Update README.md Fix numbered list below weather service so that 7 and 8 appear on their own lines. --------- Co-authored-by: Wim Leers <[email protected]>
- Loading branch information