Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Local Socket API support #16

Merged
merged 15 commits into from
Nov 28, 2023
Merged

Local Socket API support #16

merged 15 commits into from
Nov 28, 2023

Conversation

chasenicholl
Copy link
Owner

@chasenicholl chasenicholl commented Nov 2, 2023

[v4.0.0]

Added Local UDP API support! Now you can choose to listen to your Weather Stations observations directly over your local network. No Station ID or API Token needed. Observations are broadcasted every 60 seconds. This leverages the obs_st message. See documentation for more information.

@chasenicholl chasenicholl added the enhancement New feature or request label Nov 2, 2023
@chasenicholl
Copy link
Owner Author

@DMBlakeley take a look when you get a chance - local udp API implementation!

@DMBlakeley
Copy link
Collaborator

@chasenicholl will take a look. Nice work!

Have the 4.0.0 version running on my MacBook and 3.0.3 version running on my Mac mini so I can easily compare between the two versions.

@chasenicholl
Copy link
Owner Author

Thanks @DMBlakeley!

* Added Local UDP API support! Now you can choose to listen to your Weather Stations observations directly over your local network. No Station ID or API Token needed. Observations are broadcasted every 60 seconds. This leverages the `obs_st` message. See [documentation](https://weatherflow.github.io/Tempest/api/udp/v171/) for more information.
@DMBlakeley
Copy link
Collaborator

Hi @chasenicholl,

I have dug into v4.0.0 comparing it to v3.0.3 as well as the Tempest App directly. I have a number of recommended changes to a number of files:

  • config.schema.json: remove !model.local_api && from sensor properties. Still need functionBody for local API.
  • README.md: update Local API example to include functionBody
  • platformAccessory.ts: picked up an error in the getCurrentWindSpeed() function for windspeed that existed in v3.0.3.
  • tempest.ts: added equations for heatIndex, feelsLike and windChill. Corrected units.

For the tempest.ts changes I was reminded how HomeKit handles metric vs standard units. For supported units such as temperature, humidity, and wind speed calculations are done with metric units. How they are displayed is a function of the localization of your iOS or Mac device. The units for additional parameters that were added as dummy occupancy sensor are handled by the plugin settings.

All the updated files can be found in my directory (https://github.com/DMBlakeley/homebridge-weatherflow-tempest). Now need to figure out how to push to you.

config.schema.json Outdated Show resolved Hide resolved
config.schema.json Outdated Show resolved Hide resolved
config.schema.json Outdated Show resolved Hide resolved
config.schema.json Outdated Show resolved Hide resolved
config.schema.json Outdated Show resolved Hide resolved
config.schema.json Outdated Show resolved Hide resolved
README.md Show resolved Hide resolved
- Fixed error in config.schema.json which was blocking display of occupancy sensor type.
- Added note in README.md to indicate that `precip_accum_local_day` not available in local API.
@DMBlakeley
Copy link
Collaborator

  • Fixed additional error in config.schema.json which was blocking selection of occupancy sensor types.
  • Added note in README.md to indicate that precip_accum_local_day is not available when using local_API. Still need to code to check for this condition.

Changes are in my files.

Add description that states that  `precip_accum_local_day` is not supported using Local API.
config.schema.json Outdated Show resolved Hide resolved
@chasenicholl
Copy link
Owner Author

chasenicholl commented Nov 8, 2023

@DMBlakeley thank you for the thoughtful feedback. Please feel free to checkout this branch locally, commit your changes and push here for one more round of reviews before we publish the big update!

edit* apologies I didn't realize I hadn't added you as an official collaborator yet. I just corrected that. You should now be able to directly contribute. Thank you again.

Disable `precip_accum_local_day` Occupancy Sensor if using Local API.
@DMBlakeley
Copy link
Collaborator

Hi Chase,
As I am new to being an official collaborator I just wanted to make sure that I am adding or updating files correctly. I see 2 options:

  1. Open the local-websocket-support branch and add / replace the files directly.
  2. Create a new branch as a pull request.

Which do you prefer?
Regards, Doug

@chasenicholl
Copy link
Owner Author

@DMBlakeley great question. Lets have you create a branch from this branch. Make your changes. And open a new PR for me to review merging your changes back into this branch. Make sense?

@DMBlakeley
Copy link
Collaborator

@chasenicholl, I think that creating a PR against the local-wesocket-support branch is the safest and cleanest approach.

Let me give my updates one more review and I will submit the PR for your review and merging into this branch and then back into main.

@DMBlakeley
Copy link
Collaborator

@chasenicholl, I submitted PR #17 against the Local Socket API branch last evening. Let me know if there are any issues with this approach.

@chasenicholl
Copy link
Owner Author

@DMBlakeley I've been running this branch locally now since I merged your PR without issues. How about yourself?

@DMBlakeley
Copy link
Collaborator

@chasenicholl, I have also been running v4.0.0 without issues. Have found very good correlation between v4.0.0 and the Tempest app. My recommendation would be to release.

@chasenicholl chasenicholl merged commit 33d9df8 into main Nov 28, 2023
4 checks passed
@chasenicholl chasenicholl deleted the local-websocket-support branch November 28, 2023 01:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants