04-10-2014, 02:20 PM
(This post was last modified: 10-11-2018, 11:07 AM by Dean Roddey.)
General Description
This thread is for discussion of the Weather device class. This class defines a basic set of fields that any weather source should be able to provide, not a local weather station but an online weather source.  It includes current condition information, plus forecast information for at least a small number of days (which a local station wouldn't provide.)
Any given source might conceivably support many more data values, but this device class must stick to what is likely to be widely supported, so that it can be used generically.
Fields Provided
The fields provided by this device class have pre-determined names, and these MUST be implemented as indicated here. They are all prefixed by the device class prefix in the form:
WEATH#fieldname
where WEATH# indicates it is a field of this device class, and fieldname meets the general requirements of CQC field names. There will never be multi-unit considerations for this type of device class.
Most such sources will either allow the user to indicate standard vs. metric units for any units that have those options, or will inherently support one or the other based on non-CQC configuration options. It is assumed below that all such values are displayed in the user's selected units.
The WEATH# prefix is left off of the field names below for brevity. For the forecast day fields, they will be replicated at least three times (for three days of forecast information), though there may be more available.
This device class does not expect there to ever be multiple weather sources within one controllable device, server, etc... at least not any that are considered to be of a piece.
Weather Condition Codes
Some user interface widgets assume that the icon fields of drivers that implement this class will have specific values, so that they can display predefined representations of the weather conditions. Some weather sources may have more and some may have less that this device class supports, but all must be mapped to this set of condition codes:
This thread is for discussion of the Weather device class. This class defines a basic set of fields that any weather source should be able to provide, not a local weather station but an online weather source.  It includes current condition information, plus forecast information for at least a small number of days (which a local station wouldn't provide.)
Any given source might conceivably support many more data values, but this device class must stick to what is likely to be widely supported, so that it can be used generically.
Fields Provided
The fields provided by this device class have pre-determined names, and these MUST be implemented as indicated here. They are all prefixed by the device class prefix in the form:
WEATH#fieldname
where WEATH# indicates it is a field of this device class, and fieldname meets the general requirements of CQC field names. There will never be multi-unit considerations for this type of device class.
Most such sources will either allow the user to indicate standard vs. metric units for any units that have those options, or will inherently support one or the other based on non-CQC configuration options. It is assumed below that all such values are displayed in the user's selected units.
The WEATH# prefix is left off of the field names below for brevity. For the forecast day fields, they will be replicated at least three times (for three days of forecast information), though there may be more available.
- CurAsOf. This field MUST be of Time type and indicate that time at which the currently available field information was originally obtained. Most sources will only update the information so often, and this field can be used to determine how old the displayed data is.
- CurBaro. This field MUST be of Float type, and it indicates the current barometric pressure.
- CurCondText. This field MUST be of String type and contains a text string that indicates the current weather conditions. It MUST be marked with the CurWeather semantic type.
- CurHumidity. This field MUST be of semantic type Current External Humidity and conform to the definition of that semantic type.
- CurIcon. This field MUST be of Card type and will contain a code that reflects the current weather conditions. The valid values and their meanings are listed below. It MUST have a Range limit of 0 to 48.
- CurPrecip. This field MUST be of Float type, read only, and should reflect the current day precipitation, rendered in either inches or millimeters, depending on the standard/metric setting of the driver. If the source cannot provide this, it MUST be set to zero.
- CurTemp. This field MUST be of semantic type Current External Temp and conform to the definition of that semantic type. It reflects the current external temperature in the user's selected scale.
- DayXCondText. This field MUST be of String type and contains a short description of the forecasted weather conditions for day X.
- DayXHigh. This field MUST be of Int type and reflects the forecasted high for day X. It MAY have a range limit.
- DayXIcon. This field MUST be of Card type and contains the same icon type code as CurIcon, but forecast day X. It MUST have a Range limit of 0 to 48.
- DayXLow. This field MUST be of Int type and reflects the forecasted low for day X. It MAY have a range limit.
- DayXPrecipProb. This field MUST be of Card type, and have percentage limits (0 to 100) and reflect the likelihood of precipitation on forecast day X. If the source cannot provide this, it MUST be set to zero.
- DayXStamp. This field MUST be of Time type and should contain a time stamp for midnight of forecast day X.
- FCCurrent. This field MUST be of String type and should be filled with text that describes, briefly, the current forecast, i.e. for the next 12 hours or so. Forecasts for further out MAY be provided but are not required, and MUST NOT use the device class prefix as they are beyond the scope of this class. If no forecast information is available, the driver should set this field to "Unavailable".
- FCDayCount. The number of forecast days available. It must be at least three as per this device class' requirements, but can be more. This is to support tools like the auto-generation system.
- LocName. Drivers that implement this device class MUST either allow the user to provide a name for the location that the weather is being reported for (Home, Spain, Dad's House, etc...), or get such a name from the weather source. This field MUST be of String type, read only, and filled in with this location name.
This device class does not expect there to ever be multiple weather sources within one controllable device, server, etc... at least not any that are considered to be of a piece.
Weather Condition Codes
Some user interface widgets assume that the icon fields of drivers that implement this class will have specific values, so that they can display predefined representations of the weather conditions. Some weather sources may have more and some may have less that this device class supports, but all must be mapped to this set of condition codes:
- Unknown : 48
- Chance of Flurries : 15
- Chance of Rain : 40
- Chance of Sleet : 11
- Chance of Snow : 16
- Chance of T-storms : 35
- Clear : 32
- Cloudy : 26
- Flurries : 15
- Fog : 20
- Hazy : 21
- Mostly Cloudy : 28
- Mostly Sunny : 34
- Partly Cloudy : 30
- Partly Sunny : 34
- Sleet : 11
- Rain : 12
- Snow : 14
- Sunny : 32
- T-Storms : 35
Dean Roddey
Explorans limites defectum
Explorans limites defectum