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

[openweathermap] Add JSON channels #15580

Closed
wants to merge 4 commits into from

Conversation

florian-h05
Copy link
Contributor

This adds string channels for both for the "Weather and Forecast" and the "One Call" APIs to allow access to the raw JSON responses.

This is especially useful from JS Scripting, where you can parse that JSON and then perform operations on it as on any other JS object, which is much more straighforward than reading the state of 1000 Items.

This adds a channel that allows access to the raw JSON response from the Open Weather Map One Call API.

Signed-off-by: Florian Hotze <[email protected]>
This adds another channel to access the raw JSON response from the Open Weather Map Weather and Forecast API.

Signed-off-by: Florian Hotze <[email protected]>
Signed-off-by: Florian Hotze <[email protected]>
@lsiepel
Copy link
Contributor

lsiepel commented Sep 12, 2023

I can understand the use case. On the other hand isn't the http binding allready handling this case? Imho it also feels a bit uncomfortable have bindings that interface/model between external service and openHAB domain, and also expose a full raw json object from the remote service.
If i'm the only one, discard my thoughts ;-)

@florian-h05
Copy link
Contributor Author

florian-h05 commented Sep 12, 2023

I want to access that JSON and have some information in Items at the same time, so I would need to have both the Open Weather Map and the HTTP binding doing regular requests to the API.
This means double the traffic, which IMO is unnecessary, and possible problems with rate limits or daily/monthly API usage limits.

I would definitely consider JSON channels as advanced, and as long as nothing like openhab/openhab-core#3597 is available, they IMO are the only comfortable way to deal with large data sets.

@lolodomo lolodomo added the enhancement An enhancement or new feature for an existing add-on label Sep 23, 2023
@florian-h05 florian-h05 requested a review from jlaur October 11, 2023 13:40
@lolodomo
Copy link
Contributor

Can we close this PR now that you proposed #15963 ?
Please also read the discussion in #15889 .

@florian-h05
Copy link
Contributor Author

Yes, let’s close it.
Can you please have a look at #15963?

@lolodomo
Copy link
Contributor

Can you please have a look at #15963?

@jlaur is expert in this new core feature.

@florian-h05 florian-h05 deleted the owm-json branch May 30, 2024 09:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement An enhancement or new feature for an existing add-on
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants