Skip to content

VisualCrossing Binding ​

VisualCrossing Binding provides integration with VisualCrossing API

Visual Crossing Weather is the easiest-to-use and lowest-cost source for historical and forecast weather data. Our Weather API is designed to integrate easily into any app or code, and our prices are lower than any other provider in the industry.

Our data is used daily by a diverse customer-base including business analysts, data scientists, insurance professionals, energy producers, construction planners, and academics.

We have the Weather Data and expertise needed to serve any individual or organization from an independent event planner to a global enterprise.

from VisualCrossing site

Supported Things ​

Thing Configuration ​

weather Thing Configuration ​

NameTypeDescriptionDefaultRequiredAdvanced
passwordtextAPI Key to connect to the cloudN/Ayesno
locationtextAddress, partial address, or latitude/longitude for weather data retrieval. US ZIP Codes are also accepted.OH locationnono
langtextLanguage for translatable output parts (e.g., conditions field). Available languages: ar, bg, cs, da, de, el, en, es, fa, fi, fr, he, hu, it, ja, ko, nl, pl, pt, ru, sk, sr, sv, tr, uk, vi, zh.OH languagenono
hostnametextHostname or IP address of the serverhttps://weather.visualcrossing.comyesyes
refreshIntervalintegerInterval the device is polled in sec.3600noyes
httpRetriesintegerInterval the device is polled in sec.3noyes

Channels ​

basic-channel-group ​

ChannelTypeRead/WriteDescription
costSwitchRHow much API tokens Thing used since start
descriptionSwitchRLonger text descriptions suitable for displaying in weather displays. These descriptions summarize the day's main weather features, including precipitation and cloud cover. Daily descriptions are available for both historical and forecast days, and a seven-day outlook is provided when the timeline request includes the model forecast period.

day-channel-group ​

ChannelTypeRead/WriteDescription
datetimeStringR
timestampNumberR
temperatureNumber:TemperatureRTemperature at the location. Daily values are average values (mean) for the day
temperature-minNumber:TemperatureRMinimum temperature at the location
temperature-maxNumber:TemperatureRMaximum temperature at the location
feels-likeNumber:TemperatureRWhat the temperature feels like accounting for heat index or wind chill. Daily values are average values (mean) for the day.
feels-like-minNumber:TemperatureRMinimum feels like temperature at the location
feels-like-maxNumber:TemperatureRMaximum feels like temperature at the location
dewNumber:TemperatureRDew point temperature
humidityNumber:DimensionlessR
precipNumber:LengthRThe amount of liquid precipitation that fell or is predicted to fall in the period. This includes the liquid-equivalent amount of any frozen precipitation such as snow or ice.
precip-probNumber:DimensionlessRThe likelihood of measurable precipitation ranging from 0% to 100%
precip-typeStringRAn comma separated array indicating the type(s) of precipitation expected or that occurred. Possible values include rain, snow, freezingrain and ice.
precip-coverNumberRThe proportion of hours where there was non-zero precipitation
snowNumber:LengthRThe amount of snow that fell or is predicted to fall
snow-depthNumber:LengthR
wind-gustNumber:SpeedRInstantaneous wind speed at a location – May be empty if it is not significantly higher than the wind speed. Daily values are the maximum hourly value for the day.
wind-speedNumber:SpeedRThe sustained wind speed measured as the average windspeed that occurs during the preceding one to two minutes. Daily values are the maximum hourly value for the day.
wind-dirNumber:AngleRDirection from which the wind is blowing
pressureNumber:PressureRThe sea level atmospheric or barometric pressure in millibars (or hectopascals)
cloud-coverNumber:DimensionlessRHow much of the sky is covered in cloud ranging from 0–100%
visibilityNumber:LengthRDistance at which distant objects are visible
solar-radiationNumber:IntensityRThe solar radiation power at the instantaneous moment of the observation (or forecast prediction). See the full solar radiation data documentation and Wind and Solar Energy pages.
solar-energyNumberR(MJ /m^2) Indicates the total energy from the sun that builds up over an hour or day. See the full solar radiation data documentation and Wind and Solar Energy pages.
uv-indexNumberRA value between 0 and 10 indicating the level of ultra violet (UV) exposure for that hour or day. 10 represents high level of exposure, and 0 represents no exposure. The UV index is calculated based on amount of short wave solar radiation which in turn is a level the cloudiness, type of cloud, time of day, time of year and location altitude. Daily values represent the maximum value of the hourly values.
sunriseStringR
sunrise-epochR
sunsetStringR
sunset-epochR
moon-phaseNumberRRepresents the fractional portion through the current moon lunation cycle ranging from 0 (the new moon) to 0.5 (the full moon) and back to 1 (the next new moon).
conditionsStringRTextual representation of the weather conditions. See Weather Data Conditions
descriptionStringRLonger text descriptions suitable for displaying in weather displays. The descriptions combine the main features of the weather for the day such as precipitation or amount of cloud cover. Daily descriptions are provided for historical and forecast days. When the timeline request includes the model forecast period, a seven day outlook description is provided at the root response level.
iconStringRA fixed, machine readable summary that can be used to display an icon
stationsStringRThe weather stations (comma separated) used when collecting an historical observation record
sourceStringRThe type of weather data used for this weather object. – Values include historical observation (“obs”), forecast (“fcst”), historical forecast (“histfcst”) or statistical forecast (“stats”). If multiple types are used in the same day, “comb” is used. Today a combination of historical observations and forecast data.
severe-riskNumberRA value between 0 and 100 representing the risk of convective storms (e.g. thunderstorms, hail and tornadoes). Severe risk is a scaled measure that combines a variety of other fields such as the convective availabel potential energy (CAPE) and convective inhibition (CIN), predicted rain and wind. Typically, a severe risk value less than 30 indicates a low risk, between 30 and 70 a moderate risk and above 70 a high risk.

hourXX ​

In day-channel-group there are 0–23 channels of type hourXX

ChannelTypeRead/WriteDescription
hourXX-datetimetime-channelR
hourXX-timestamptimestamp-channelR
hourXX-temperaturesystem.outdoor-temperatureR
hourXX-feels-liketemperature-channelR
hourXX-humiditysystem.atmospheric-humidityR
hourXX-dewtemperature-channelR
hourXX-precipprecip-channelR
hourXX-precip-probprecip-prob-channelR
hourXX-precip-typeprecip-type-channelR
hourXX-snowsnow-channelR
hourXX-snow-depthsnow-channelR
hourXX-wind-gustsystem.wind-speedR
hourXX-wind-speedsystem.wind-speedR
hourXX-wind-dirsystem.wind-directionR
hourXX-pressuresystem.barometric-pressureR
hourXX-visibilityvisibility-channelR
hourXX-cloud-covercloud-cover-channelR
hourXX-solar-radiationsolar-radiation-channelR
hourXX-solar-energysolar-energy-channelR
hourXX-uv-indexuv-index-channelR
hourXX-severe-risksevere-risk-channelR
hourXX-conditionsconditions-channelR
hourXX-iconicon-channelR
hourXX-stationsstations-channelR
hourXX-sourcesource-channelR

current-conditions-channel-group ​

ChannelTypeRead/WriteDescription
datetimetime-channelR
timestamptimestamp-channelR
temperaturesystem.outdoor-temperatureR
feels-liketemperature-channelR
humiditysystem.atmospheric-humidityR
dewtemperature-channelR
precipprecip-channelR
precip-probprecip-prob-channelR
precip-typeprecip-type-channelR
snowsnow-channelR
snow-depthsnow-channelR
wind-gustsystem.wind-speedR
wind-speedsystem.wind-speedR
wind-dirsystem.wind-directionR
pressuresystem.barometric-pressureR
visibilityvisibility-channelR
cloud-covercloud-cover-channelR
solar-radiationsolar-radiation-channelR
solar-energysolar-energy-channelR
uv-indexuv-index-channelR
conditionsconditions-channelR
iconicon-channelR
stationsstations-channelR
sourcesource-channelR
sunrisesunrise-channelR
sunrise-epochtimestamp-channelR
sunsetsunset-channelR
sunset-epochtimestamp-channelR
moon-phasemoon-phase-channelR

Full Example ​

Thing Configuration ​

dsl
Thing visualcrossing:weather:default_config "Total Weather Data" @ "Weather" [ apiKey="MKSH4W6U2H3BYJBB7CQVWLPTT" ]
Thing visualcrossing:weather:all_config "Total Weather Data" @ "Weather" [ apiKey="MKSH4W6U2H3BYJBB7CQVWLPTT", location="wrocław,poland", lang="pl", hostname="https://weather.visualcrossing.com", refreshInterval="3600", httpRetries="3" ]

Item Configuration ​

Note: I strongly suggest not using UI Items creation because it will kill the web browser. UI is getting unresponsive when loading so many channels and trying to bind them.

Note 2: Use docs/only_days.items to have forecast for days but without hours or join items from docs/Day_XX to get hourly forecast for each day

dsl
Group Total_Weather_Data "Total Weather Data" [ "Equipment" ]

// basic group
Group Total_Weather_Data_Basic "Basic" (Total_Weather_Data) [ "Equipment" ]
Number Total_Weather_Data_Basic_Cost "Cost" (Total_Weather_Data_Basic) [ "Point" ] {channel="visualcrossing:weather:default_config:basic#cost"}
String Total_Weather_Data_Basic_Description "Description" (Total_Weather_Data_Basic) [ "Point" ] {channel="visualcrossing:weather:default_config:basic#description"}

// current conditions
Group Total_Weather_Data_Current_Conditions "Current Conditions" (Total_Weather_Data) [ "Equipment" ]
String Total_Weather_Data_Basic_Datetime "Datetime" (Total_Weather_Data_Current_Conditions) [ "Point" ] {channel="visualcrossing:weather:default_config:current-conditions#datetime"}
DateTime Total_Weather_Data_Basic_Timestamp "Timestamp" (Total_Weather_Data_Current_Conditions) [ "Point" ] {channel="visualcrossing:weather:default_config:current-conditions#timestamp"}
Number:Temperature Total_Weather_Data_Basic_Temperature "Temperature" (Total_Weather_Data_Current_Conditions) [ "Point" ] {channel="visualcrossing:weather:default_config:current-conditions#temperature"}
Number:Temperature Total_Weather_Data_Basic_Feels_Like "Feels Like" (Total_Weather_Data_Current_Conditions) [ "Point" ] {channel="visualcrossing:weather:default_config:current-conditions#feels-like"}
Number:Dimensionless Total_Weather_Data_Basic_Humidity "Humidity" (Total_Weather_Data_Current_Conditions) [ "Point" ] {channel="visualcrossing:weather:default_config:current-conditions#humidity"}
Number:Temperature Total_Weather_Data_Basic_Dew "Dew" (Total_Weather_Data_Current_Conditions) [ "Point" ] {channel="visualcrossing:weather:default_config:current-conditions#dew"}
Number:Length Total_Weather_Data_Basic_Precip "Precip" (Total_Weather_Data_Current_Conditions) [ "Point" ] {channel="visualcrossing:weather:default_config:current-conditions#precip", unit="mm"}
Number:Dimensionless Total_Weather_Data_Basic_Precip_Probability "Precip Probability" (Total_Weather_Data_Current_Conditions) [ "Point" ] {channel="visualcrossing:weather:default_config:current-conditions#precip-prob"}
String Total_Weather_Data_Basic_Precip_Type "Precip Type" (Total_Weather_Data_Current_Conditions) [ "Point" ] {channel="visualcrossing:weather:default_config:current-conditions#precip-type"}
Number:Length Total_Weather_Data_Basic_Snow "Snow" (Total_Weather_Data_Current_Conditions) [ "Point" ] {channel="visualcrossing:weather:default_config:current-conditions#snow"}
Number:Length Total_Weather_Data_Basic_Snow_Depth "Snow Depth" (Total_Weather_Data_Current_Conditions) [ "Point" ] {channel="visualcrossing:weather:default_config:current-conditions#snow-depth"}
Number:Speed Total_Weather_Data_Basic_Wind_Gust "Wind Gust" (Total_Weather_Data_Current_Conditions) [ "Point" ] {channel="visualcrossing:weather:default_config:current-conditions#wind-gust"}
Number:Speed Total_Weather_Data_Basic_Wind_Speed "Wind Speed" (Total_Weather_Data_Current_Conditions) [ "Point" ] {channel="visualcrossing:weather:default_config:current-conditions#wind-speed"}
Number:Angle Total_Weather_Data_Basic_Wind_Direction "Wind Direction" (Total_Weather_Data_Current_Conditions) [ "Point" ] {channel="visualcrossing:weather:default_config:current-conditions#wind-dir"}
Number:Pressure Total_Weather_Data_Basic_Pressure "Pressure" (Total_Weather_Data_Current_Conditions) [ "Point" ] {channel="visualcrossing:weather:default_config:current-conditions#pressure"}
Number:Length Total_Weather_Data_Basic_Visibility "Visibility" (Total_Weather_Data_Current_Conditions) [ "Point" ] {channel="visualcrossing:weather:default_config:current-conditions#visibility"}
Number:Dimensionless Total_Weather_Data_Basic_Cloud_Cover "Cloud Cover" (Total_Weather_Data_Current_Conditions) [ "Point" ] {channel="visualcrossing:weather:default_config:current-conditions#cloud-cover"}
Number:Intensity Total_Weather_Data_Basic_Solar_Radiation "Solar Radiation" (Total_Weather_Data_Current_Conditions) [ "Point" ] {channel="visualcrossing:weather:default_config:current-conditions#solar-radiation"}
Number Total_Weather_Data_Basic_Solar_Energy "Solar Energy" (Total_Weather_Data_Current_Conditions) [ "Point" ] {channel="visualcrossing:weather:default_config:current-conditions#solar-energy"}
Number Total_Weather_Data_Basic_UV_Index "UV Index" (Total_Weather_Data_Current_Conditions) [ "Point" ] {channel="visualcrossing:weather:default_config:current-conditions#uv-index"}
String Total_Weather_Data_Basic_Conditions "Conditions" (Total_Weather_Data_Current_Conditions) [ "Point" ] {channel="visualcrossing:weather:default_config:current-conditions#conditions"}
String Total_Weather_Data_Basic_Icon "Icon" (Total_Weather_Data_Current_Conditions) [ "Point" ] {channel="visualcrossing:weather:default_config:current-conditions#icon"}
String Total_Weather_Data_Basic_Stations "Stations" (Total_Weather_Data_Current_Conditions) [ "Point" ] {channel="visualcrossing:weather:default_config:current-conditions#stations"}
String Total_Weather_Data_Basic_Source "Source" (Total_Weather_Data_Current_Conditions) [ "Point" ] {channel="visualcrossing:weather:default_config:current-conditions#source"}
String Total_Weather_Data_Basic_Sunrise "Sunrise" (Total_Weather_Data_Current_Conditions) [ "Point" ] {channel="visualcrossing:weather:default_config:current-conditions#sunrise"}
DateTime Total_Weather_Data_Basic_Sunrise_Epoch "Sunrise Epoch" (Total_Weather_Data_Current_Conditions) [ "Point" ] {channel="visualcrossing:weather:default_config:current-conditions#sunrise-epoch"}
String Total_Weather_Data_Basic_Sunset "Sunset" (Total_Weather_Data_Current_Conditions) [ "Point" ] {channel="visualcrossing:weather:default_config:current-conditions#sunset"}
DateTime Total_Weather_Data_Basic_Sunset_Epoch "Sunset Epoch" (Total_Weather_Data_Current_Conditions) [ "Point" ] {channel="visualcrossing:weather:default_config:current-conditions#sunset-epoch"}
Number Total_Weather_Data_Basic_Moon_Phase "Moon Phase" (Total_Weather_Data_Current_Conditions) [ "Point" ] {channel="visualcrossing:weather:default_config:current-conditions#moon-phase"}

Actions ​

Visual Crossing binding provides actions to use in rules:

rules
import static org.openhab.binding.visualcrossing.internal.api.VisualCrossingApi.UnitGroup.METRIC;

rule "test"
when
    /* when */
then
    val actions = getActions("visualcrossing", "visualcrossing:weather:as8af03m38")
    if (actions !== null) {
        val weatherResponse1 = actions.timeline()
        // lang - https://www.visualcrossing.com/resources/documentation/weather-api/how-to-create-or-modify-language-files/
        // dateFrom, dateTo - https://www.visualcrossing.com/resources/documentation/weather-api/using-the-time-period-parameter-to-specify-dynamic-dates-for-weather-api-requests/
        val weatherResponse2 = actions.timeline("wrocław,poland", METRIC, "pl", "last7days", "next5days")
    }
end