eclipse-archived / smarthome

Eclipse SmartHome™ project
https://www.eclipse.org/smarthome/
Eclipse Public License 2.0
862 stars 783 forks source link

[owm] The (3) hourly forecasts contain temp_min and temp_max but channels only exist for daily forecasts #6735

Open MHerbst opened 5 years ago

MHerbst commented 5 years ago

I am using the free API key from OWM and therefore don't get daily forecast values. According to the documentation the channels "min-temperature" and "max-temperature" are only available for daily forecasts.

But the JSON string returned from OWM contains a minimum and maximum temperature also for hourly forecasts (excerpt from the JSON string):

            "main": {
                "temp": 273.763,
                "temp_min": 273.763,
                "temp_max": 273.763,
                "pressure": 1016.55,
                "sea_level": 1043.89,
                "grnd_level": 1016.55,
                "humidity": 89,
                "temp_kf": 0
            },

This means the binding could provide these two channels for the hourly forecasts, too.

cweitkamp commented 5 years ago

I decided to not use the minimum and maximum temperature values for the (3) hourly forecast because of the following statement in the documentation of the OWM API:

In most cases both temp_min and temp_max parameters have the same volume as 'temp'.

Of course it is possible to add them. Maybe as advanced channels.

MHerbst commented 5 years ago

I understand. I don't remember whether I have really seen different values. Advanced channels seems to be a good solution.

cweitkamp commented 5 years ago

PR submitted https://github.com/openhab/openhab2-addons/pull/4741