Weather forecast
Note
In version 3.8.2 Dashticz switched to the new weather block as described here.
Dashticz supports the following weather forecast providers:
Open Weather Map: https://openweathermap.org/
KNMI: https://weerlive.nl/
Before you can use the weather module, you must request an API key:
For OpenWeatherMap via https://openweathermap.org/
For KNMI via https://weerlive.nl/api/toegang/index.php
Dashticz automatically detects the correct weather provider, by validating the API key at each provider.
Basic usage
A basic weather block can be defined as follows:
blocks['weather'] = {
type: 'weather',
apikey: 'abc123...xyz', /Your API key
city: 'Amsterdam',
}
Besides the daily forecast, you can also show the current weather or an hourly forecast.
Parameters
Block parameter |
Description |
---|---|
type |
|
width |
|
refresh |
|
scale |
Number between 0 and 1 to make the weather block smaller
1 Normal block width0.5 50% width |
apikey |
|
city |
|
country |
|
name |
|
lang |
|
provider |
By default Dashticz will auto-detect the provider of the weather info. You can also choose a specific provider by setting this parameter, but this should not be necessary anymore.
owmfree : Use OpenWeatherMap free account (since beginning 2023).owm3 : OpenWeatherMap Onecall API 3.0. See Open Weather Mapowm : OpenWeatherMap old account (API key requested before 2022)knmi : Use KNMI as provider |
layout |
Choose a layout for the weather block
0 : Daily forecast (=default)1 : Hourly forecast (for OWM only)2 : Current weather3 : Current weather detailed4 : Combination of 2,3,0,1 |
count |
|
interval |
Use every n-th forecast item. Only useful for owm3, because owm3 provides hourly forcast info
1 . Use every forecast item (=default)3 . Set to 3 to get 3-hourly forecast (owm3) |
decimals |
Number of temperature decimals to show
1 One decimal (=default) |
showMin |
Show/hide minimum temperature (only for daily forecast)
false : Hide minimum temperaturetrue : Show minimum temperature (=default) |
showRain |
Show/hide rain rate (only for daily and hourly forecast)
false : Hide rain ratetrue : Show rain rate (=default) |
showDescription |
Show/hide weather description (only for daily and hourly forecast)
false : Hide weather descriptiontrue : Show weather description |
showWind |
Show/hide wind info and wind dial (daily and hourly forecast only)
false : Hide wind infotrue : Show wind info (=default) |
showGust |
Show/hide wind gust info
false : Hide wind gust infotrue : Show wind gust info (=default) |
useBeaufort |
Set to |
skipFirst |
Set to |
monochrome |
false : Show colored icons (animated weather icons only)true : Show monochrome icons (animated weather icons only) |
showCurrent |
Set to |
showDetails |
Set to |
showDaily |
Set to |
showHourly |
Set to |
icons |
Icon set to use. See below
'line' Dynamic line icons'linestatic' Static version of the line icons'fill' Dynamic filled icons'static' Static icons'meteo' Alternative set of static icons |
The weather module makes use of the following CONFIG parameters:
Parameter |
Description |
---|---|
owm_api |
|
owm_city |
Your city or nearby city to use in OWM. You can also fill in the city id here.
'Utrecht' '2748075' |
owm_name |
Name to use instead of city name
'Tuinwijk' |
owm_country |
Your country to use in OWM
'nl' |
owm_lang |
Set language for de description of the forecast (rain, cloudy, etc.). For available languages, see https://openweathermap.org/forecast5/#multi
'' (empty string, default) Use Dashticz language setting |
owm_cnt |
Number of forecast elements (3-hour intervals or days) to show
1..5 |
owm_min |
Show minimum temperature on 2nd row (only for daily forecast)
false / true |
static_weathericons |
true Static weather settingsfalse (default) Animated weather icons |
use_beaufort |
This config setting is used as default value for block parameter
useBeaufort true Use Beaufort for wind speedfalse Use m/s for wind speed |
Usage
In the next examples the config parameter owm_api
and owm_city
have been set globally, so they are not part of the weather block definitions.
To show the hourly forecast with an 3 hour interval:
blocks['weather1'] = {
type: 'weather',
layout: 1,
count: 7,
interval: 3,
}
To show the current weather, with a custom name:
blocks['weather2'] = {
type: 'weather',
layout: 2,
name: 'My place',
}
To show detailed info on the current weather:
blocks['weather3'] = {
type: 'weather',
layout: 3,
name:'Home is home',
}
Icons
Via the block parameter icons you can choose one of the predefined icon sets:
‘line’ (=default)
‘linestatic’
‘fill’
‘static’
‘meteo’
By setting the block parameter monochrome
to true the icons will be displayed as monochrome.
This will give the following icons sets to choose from:
styling
All blocks have the css class weather
assigned in combination with weather_0
, weather_1
, …, where the number indicates the layout number.
Further, all info items have css classes assigned. The names are self explanatory.
icon
: Weather iconday
: Day item (‘Saturday’)time
: Forecast time (hourly forecast only)city
: City namedescription
: Weather descriptiontemp
: temperaturemax
: Max temperaturemin
: Min temperaturetemp
: Current temperaturefeels
: Feel-like temperaturerain
: Rain ratehumidity
pressure
: Barometric pressurewindspeed
windgust
winddirection
To capitalize the day of the week have to add the following code to custom.css
:
.weather .day {
text-transform: capitalize;
}
Open Weather Map
Via https://openweathermap.org/ you can request a new API key and subscribe to weather API.
At this moment (August 2023) two types of accounts can be created:
Free account
Onecall API 3.0
For the differences see https://openweathermap.org/price.
Main differences:
Onecall API requires you to provide your credit card info.
Onecall API provides 8 day weather forecast, free API only a 5 day forecast
Onecall API provides hourly forecast info, while the free API only provides 3-hourly forecast info
In the past it was possible to request a OWM 2.5 account as well.
Dashticz supports all three OWM APIs.
For the Onecall API 3.0 you have to provide a credit card number. However, the first 2000 API calls are free of charge. Further, on your OpenWeatherMap profile you can limit the number of daily allowed API calls, to prevent you accidentally make use of the service to often.
See https://home.openweathermap.org/subscriptions
If you want to use OpenWeatherMap One Call API 3.0 set provider
to owm3
in your block definition.