Apologies for the necro-post, but with DarkSky being unavailable to new subscribers there may be others who are seeking to set up the TileBoard Weather-List tile with OpenWeatherMap. Here’s how to do it.
The OpenWeatherMap integration doesn’t set up individual sensors for the values in the 5-day forecast, so you first have to create new template sensors from the weather.openweathermap entity. In your sensors.yaml, add the following template sensors, then restart HA.
- platform: template
sensors:
owm_daytime_high_temperature_1d:
friendly_name: "OpenWeatherMap Forecast High Temperature 1d"
unit_of_measurement: '°C'
value_template: "{{ state_attr('weather.openweathermap','forecast').1.temperature }}"
owm_daytime_high_temperature_2d:
friendly_name: "OpenWeatherMap Forecast High Temperature 2d"
unit_of_measurement: '°C'
value_template: "{{ state_attr('weather.openweathermap','forecast').2.temperature }}"
owm_daytime_high_temperature_3d:
friendly_name: "OpenWeatherMap Forecast High Temperature 3d"
unit_of_measurement: '°C'
value_template: "{{ state_attr('weather.openweathermap','forecast').3.temperature }}"
owm_daytime_high_temperature_4d:
friendly_name: "OpenWeatherMap Forecast High Temperature 4d"
unit_of_measurement: '°C'
value_template: "{{ state_attr('weather.openweathermap','forecast').4.temperature }}"
owm_daytime_high_temperature_5d:
friendly_name: "OpenWeatherMap Forecast High Temperature 5d"
unit_of_measurement: '°C'
value_template: "{{ state_attr('weather.openweathermap','forecast').5.temperature }}"
owm_overnight_low_temperature_1d:
friendly_name: "OpenWeatherMap Forecast Low Temperature 1d"
unit_of_measurement: '°C'
value_template: "{{ state_attr('weather.openweathermap','forecast').1.templow }}"
owm_overnight_low_temperature_2d:
friendly_name: "OpenWeatherMap Forecast Low Temperature 2d"
unit_of_measurement: '°C'
value_template: "{{ state_attr('weather.openweathermap','forecast').2.templow }}"
owm_overnight_low_temperature_3d:
friendly_name: "OpenWeatherMap Forecast Low Temperature 3d"
unit_of_measurement: '°C'
value_template: "{{ state_attr('weather.openweathermap','forecast').3.templow }}"
owm_overnight_low_temperature_4d:
friendly_name: "OpenWeatherMap Forecast Low Temperature 4d"
unit_of_measurement: '°C'
value_template: "{{ state_attr('weather.openweathermap','forecast').4.templow }}"
owm_overnight_low_temperature_5d:
friendly_name: "OpenWeatherMap Forecast Low Temperature 5d"
unit_of_measurement: '°C'
value_template: "{{ state_attr('weather.openweathermap','forecast').5.templow }}"
owm_condition_1d:
friendly_name: "OpenWeatherMap Forecast Condition 1d"
value_template: "{{ state_attr('weather.openweathermap','forecast').1.condition }}"
owm_condition_2d:
friendly_name: "OpenWeatherMap Forecast Condition 2d"
value_template: "{{ state_attr('weather.openweathermap','forecast').2.condition }}"
owm_condition_3d:
friendly_name: "OpenWeatherMap Forecast Condition 3d"
value_template: "{{ state_attr('weather.openweathermap','forecast').3.condition }}"
owm_condition_4d:
friendly_name: "OpenWeatherMap Forecast Condition 4d"
value_template: "{{ state_attr('weather.openweathermap','forecast').4.condition }}"
owm_condition_5d:
friendly_name: "OpenWeatherMap Forecast Condition 5d"
value_template: "{{ state_attr('weather.openweathermap','forecast').5.condition }}"
owm_wind_speed_1d:
friendly_name: "OpenWeatherMap Forecast Wind Speed 1d"
unit_of_measurement: 'km/h'
value_template: "{{ '%.2f'|format(state_attr('weather.openweathermap','forecast').1.wind_speed * 3.6) }}"
owm_wind_speed_2d:
friendly_name: "OpenWeatherMap Forecast Wind Speed 2d"
unit_of_measurement: 'km/h'
value_template: "{{ '%.2f'|format(state_attr('weather.openweathermap','forecast').2.wind_speed * 3.6) }}"
owm_wind_speed_3d:
friendly_name: "OpenWeatherMap Forecast Wind Speed 3d"
unit_of_measurement: 'km/h'
value_template: "{{ '%.2f'|format(state_attr('weather.openweathermap','forecast').3.wind_speed * 3.6) }}"
owm_wind_speed_4d:
friendly_name: "OpenWeatherMap Forecast Wind Speed 4d"
unit_of_measurement: 'km/h'
value_template: "{{ '%.2f'|format(state_attr('weather.openweathermap','forecast').4.wind_speed * 3.6) }}"
owm_wind_speed_5d:
friendly_name: "OpenWeatherMap Forecast Wind Speed 5d"
unit_of_measurement: 'km/h'
value_template: "{{ '%.2f'|format(state_attr('weather.openweathermap','forecast').5.wind_speed * 3.6) }}"
Note I’m in Canada, and temperatures are reported in Celsius here. The wind speed is reported in m/s in my area, so I used a multiplication factor of 3.6 to convert it to km/h. The '%.2f'|format(...)
code formats the result to 2 decimal places.
Once sensors.yaml is saved and HA is restarted, it should create the new sensor entities. Next we can create the weather-list tile in TileBoard as follows:
{
position: [0, 0],
type: TYPES.WEATHER_LIST,
width: 2,
height: 1.5,
title: 'Forecast',
id: {},
state: false,
icons: {
'clear-day': 'clear',
'clear-night': 'nt-clear',
'cloudy': 'cloudy',
'rain': 'rain',
'sleet': 'sleet',
'snow': 'snow',
'snowy-rainy': 'sleet',
'wind': 'hazy',
'fog': 'fog',
'partly-cloudy-day': 'partlycloudy',
'partly-cloudy-night': 'nt-partlycloudy',
'pouring': 'rain'
},
hideHeader: false,
secondaryTitle: 'Wind',
list: [1,2,3,4,5].map(function (id) {
var forecast = "&sensor.owm_overnight_low_temperature_" + id + "d.state - ";
forecast += "&sensor.owm_daytime_high_temperature_" + id + "d.state";
forecast += "&sensor.owm_daytime_high_temperature_" + id + "d.attributes.unit_of_measurement";
var wind = "&sensor.owm_wind_speed_" + id + "d.state";
wind += " &sensor.owm_wind_speed_" + id + "d.attributes.unit_of_measurement";
return {
date: function () {
var d = new Date(Date.now() + id * 24 * 60 * 60 * 1000);
return d.toString().split(' ').slice(1, 3).join(' ');
},
icon: "&sensor.owm_condition_" + id + "d.state",
//iconImage: null, replace icon with image
primary: forecast,
secondary: wind
}
})
}
I added in a couple more icon definitions (for ‘snowy-rainy’ and ‘pouring’), which otherwise don’t map across to icons matching TileBoard’s expectations. There may be more that I haven’t come across yet.
Adding state: false
hides the little rectangle in the top right of the tile, which would otherwise obscure the headings.
Result looks like this: