With Openweathermap, how do I find the “6 hours from now” temperature?
Openweathermap testing
I have a card (see “Other details” below) that displays multiple future temperatures. However I’m not sure how to retrieve exactly one of these future temperatures.
Credits to another post with a comment that is close to what I want.
Test query
{{states.weather.openweathermap.attributes}}
{{state_attr('weather.openweathermap','supported_features')}}
Test output
{'temperature': 60, 'apparent_temperature': 58, 'temperature_unit': <UnitOfTemperature.FAHRENHEIT: '°F'>, 'humidity': 68, 'cloud_coverage': 8, 'pressure': 29.83, 'pressure_unit': <UnitOfPressure.INHG: 'inHg'>, 'wind_bearing': 210, 'wind_gust_speed': 5.99, 'wind_speed': 1.99, 'wind_speed_unit': <UnitOfSpeed.MILES_PER_HOUR: 'mph'>, 'visibility_unit': <UnitOfLength.MILES: 'mi'>, 'precipitation_unit': <UnitOfPrecipitationDepth.INCHES: 'in'>, 'attribution': 'Data provided by OpenWeatherMap', 'friendly_name': 'OpenWeatherMap', 'supported_features': <WeatherEntityFeature.FORECAST_HOURLY: 2>}
2
Test next
How do I query beyond that “2”?
Other details
Openweathermap card source
- show_current: false
show_forecast: true
type: weather-forecast
entity: weather.openweathermap
forecast_type: hourly
Openweathermap rendered card
Use case
I see there’s a climate entity. Once I figure out how to query the future temperature, presumably I’ll control the HVAC with that.
Here’s an example automation rule I am planning to set up:
- If current thermostat mode is “heat”
- If weather forecast for “6 hours from now” exceeds 70 degrees F
- If current indoor temperature exceeds 70 degrees F
- Set thermostat to “off”
- If current indoor temperature exceeds 70 degrees F
- If weather forecast for “6 hours from now” exceeds 70 degrees F