Skip to content

Instantly share code, notes, and snippets.

@bobmcwhirter
Created July 2, 2025 19:19
Show Gist options
  • Select an option

  • Save bobmcwhirter/bc53b1b28e40f8f839769f4d0cbbbe86 to your computer and use it in GitHub Desktop.

Select an option

Save bobmcwhirter/bc53b1b28e40f8f839769f4d0cbbbe86 to your computer and use it in GitHub Desktop.
graph cluster:hvac:thermostat {
/// This cluster provides an interface to the functionality of a thermostat.
ThermostatCluster
core:subclass-of cluster:Cluster;
cluster:attribute
:attribute:supports-heating,
:attribute:supports-cooling,
:attribute:supports-occupancy-setpoints,
:attribute:supports-weekly-schedule,
:attribute:supports-setbacks,
:attribute:supports-auto-mode,
:attribute:supports-local-temperature-not-exposed,
:attribute:local-temperature,
:attribute:local-temperature-calibration,
:attribute:outdoor-temperature,
:attribute:occupancy,
:attribute:abs-min-heat-setpoint-limit,
:attribute:abs-max-heat-setpoint-limit,
:attribute:abs-min-cool-setpoint-limit,
:attribute:abs-max-cool-setpoint-limit,
:attribute:pi-cooling-demand,
:attribute:pi-heating-demand,
:attribute:occupied-cooling-setpoint,
:attribute:occupied-heating-setpoint,
:attribute:unoccupied-cooling-setpoint,
:attribute:unoccupied-heating-setpoint,
:attribute:min-heat-setpoint-limit,
:attribute:max-heat-setpoint-limit,
:attribute:min-cool-setpoint-limit,
:attribute:max-cool-setpoint-limit,
:attribute:min-setpoint-deadband,
:attribute:system-mode,
:attribute:thermostat-running-mode,
:attribute:occupied-setback,
:attribute:occupied-setback-min,
:attribute:occupied-setback-max,
:attribute:unoccupied-setback,
:attribute:unoccupied-setback-min,
:attribute:unoccupied-setback-max,
:attribute:emergency-heat-delta,
:attribute:ac-type,
:attribute:ac-refrigerant-type,
:attribute:ac-compressor-type;
cluster:command
:command:setpoint-raise-lower;
.
}
graph cluster:hvac:thermostat:attribute {
supports-heating
core:has-type cluster:Attribute;
cluster:access cluster:readable;
core:range value:boolean;
.
supports-cooling
core:has-type cluster:Attribute;
cluster:access cluster:readable;
core:range value:boolean;
.
supports-occupancy-setpoints
core:has-type cluster:Attribute;
cluster:access cluster:readable;
core:range value:boolean;
.
supports-weekly-schedule
core:has-type cluster:Attribute;
cluster:access cluster:readable;
core:range value:boolean;
.
supports-setbacks
core:has-type cluster:Attribute;
cluster:access cluster:readable;
core:range value:boolean;
.
supports-auto-mode
core:has-type cluster:Attribute;
cluster:access cluster:readable;
core:range value:boolean;
.
supports-local-temperature-not-exposed
core:has-type cluster:Attribute;
cluster:access cluster:readable;
core:range value:boolean;
.
/// This attribute SHALL indicate the current Calculated Local Temperature, when available.
/// * If the LTNE feature is not supported:
/// ** If the LocalTemperatureCalibration is invalid or currently unavailable, the attribute SHALL
/// report null.
/// ** If the LocalTemperatureCalibration is valid, the attribute SHALL report that value.
/// * Otherwise, if the LTNE feature is supported, there is no feedback externally available for the
/// `LocalTemperatureCalibration`. In that case, the LocalTemperature attribute SHALL always
/// report null.
local-temperature
core:has-type cluster:Attribute;
cluster:access cluster:readable;
core:range value:temperature;
.
/// Local temperature calibration.
local-temperature-calibration
core:has-type cluster:Attribute;
cluster:access cluster:readable,
cluster:writable;
core:range value:temperature;
.
/// This attribute SHALL indicate the outdoor temperature, as measured locally or remotely (over the
/// network)
outdoor-temperature
core:has-type cluster:Attribute;
cluster:access cluster:readable;
core:range value:temperature;
.
/// This attribute SHALL indicate whether the heated/cooled space is occupied or not, as measured
/// locally or remotely (over the network).
occupancy
core:has-type cluster:Attribute;
cluster:access cluster:readable;
core:range value:boolean;
.
/// This attribute SHALL indicate the absolute minimum level that the heating setpoint MAY be set to.
///
/// This is a limitation imposed by the manufacturer.
abs-min-heat-setpoint-limit
core:has-type cluster:Attribute;
cluster:access cluster:readable;
core:range value:temperature;
.
/// This attribute SHALL indicate the absolute maximum level that the heating setpoint MAY be set to.
///
/// This is a limitation imposed by the manufacturer
abs-max-heat-setpoint-limit
core:has-type cluster:Attribute;
cluster:access cluster:readable;
core:range value:temperature;
.
/// This attribute SHALL indicate the absolute minimum level that the cooling setpoint MAY be set to.
///
/// This is a limitation imposed by the manufacturer.
abs-min-cool-setpoint-limit
core:has-type cluster:Attribute;
cluster:access cluster:readable;
core:range value:temperature;
.
/// This attribute SHALL indicate the absolute maximum level that the cooling setpoint MAY be set to.
///
/// This is a limitation imposed by the manufacturer.
abs-max-cool-setpoint-limit
core:has-type cluster:Attribute;
cluster:access cluster:readable;
core:range value:temperature;
.
/// This attribute SHALL indicate the level of cooling demanded by the PI (proportional integral) control loop in use by the thermostat (if any), in percent. This value is 0 when the thermostat is in “off”
/// or “heating” mode.
///
/// This attribute is reported regularly and MAY be used to control a cooling device.
pi-cooling-demand
core:has-type cluster:Attribute;
cluster:access cluster:readable;
core:range value:strict-percentage;
.
/// This attribute SHALL indicate the level of heating demanded by the PI loop in percent. This value is
/// 0 when the thermostat is in “off” or “cooling” mode.
///
/// This attribute is reported regularly and MAY be used to control a heating device.
pi-heating-demand
core:has-type cluster:Attribute;
cluster:access cluster:readable;
core:range value:strict-percentage;
.
/// This attribute SHALL indicate the cooling mode setpoint when the room is occupied.
///
/// If this attribute is set to a value that is less than (OccupiedHeatingSetpoint + MinSetpointDeadBand),
/// the value of OccupiedHeatingSetpoint SHALL be adjusted to (OccupiedCoolingSetpoint - MinSetpointDeadBand).
///
/// If the occupancy status of the room is unknown, this attribute SHALL be used as the cooling mode
/// setpoint.
occupied-cooling-setpoint
core:has-type cluster:Attribute;
cluster:access cluster:readable,
cluster:writable;
core:range value:temperature;
.
/// This attribute SHALL indicate the heating mode setpoint when the room is occupied.
///
/// If this attribute is set to a value that is greater than (OccupiedCoolingSetpoint - MinSetpointDeadBand)
/// the value of OccupiedCoolingSetpoint SHALL be adjusted to (OccupiedHeatingSetpoint + MinSetpointDeadBand).
///
/// If the occupancy status of the room is unknown, this attribute SHALL be used as the heating mode
/// setpoint.
occupied-heating-setpoint
core:has-type cluster:Attribute;
cluster:access cluster:readable,
cluster:writable;
core:range value:temperature;
.
/// This attribute SHALL indicate the cooling mode setpoint when the room is unoccupied.
///
/// If an attempt is made to set this attribute to a value greater than MaxCoolSetpointLimit or less than
/// MinCoolSetpointLimit, a response with the status code CONSTRAINT_ERROR SHALL be returned.
/// If this attribute is set to a value that is less than (UnoccupiedHeatingSetpoint + MinSetpointDeadBand), the value of UnoccupiedHeatingSetpoint SHALL be adjusted to (UnoccupiedCoolingSetpoint -
/// MinSetpointDeadBand).
///
/// If the occupancy status of the room is unknown, this attribute SHALL NOT be used.
unoccupied-cooling-setpoint
core:has-type cluster:Attribute;
cluster:access cluster:readable,
cluster:writable;
core:range value:temperature;
.
/// This attribute SHALL indicate the heating mode setpoint when the room is unoccupied.
///
/// If this attribute is set to a value that is greater than (UnoccupiedCoolingSetpoint - MinSetpointDeadBand), the value of UnoccupiedCoolingSetpoint SHALL be adjusted to
/// (UnoccupiedHeatingSetpoint + MinSetpointDeadBand).
///
/// If the occupancy status of the room is unknown, this attribute SHALL NOT be used.
unoccupied-heating-setpoint
core:has-type cluster:Attribute;
cluster:access cluster:readable,
cluster:writable;
core:range value:temperature;
.
/// This attribute SHALL indicate the minimum level that the heating setpoint MAY be set to.
///
/// This attribute, and the following three attributes, allow the user to define setpoint limits more constrictive than the manufacturer imposed ones. Limiting users (e.g., in a commercial building) to
/// such setpoint limits can help conserve power.
///
/// If an attempt is made to set this attribute to a value which
/// conflicts with setpoint values then those setpoints SHALL be adjusted by the minimum amount to
/// permit this attribute to be set to the desired value.
min-heat-setpoint-limit
core:has-type cluster:Attribute;
cluster:access cluster:readable,
cluster:writable;
core:range value:temperature;
.
/// This attribute SHALL indicate the maximum level that the heating setpoint MAY be set to.
///
/// If an attempt is made to set this attribute to a value which
/// conflicts with setpoint values then those setpoints SHALL be adjusted by the minimum amount to
/// permit this attribute to be set to the desired value.
max-heat-setpoint-limit
core:has-type cluster:Attribute;
cluster:access cluster:readable,
cluster:writable;
core:range value:temperature;
.
/// Minimum cool setpoint limit.
min-cool-setpoint-limit
core:has-type cluster:Attribute;
cluster:access cluster:readable,
cluster:writable;
core:range value:temperature;
.
/// Maximum cool setpoint limit.
max-cool-setpoint-limit
core:has-type cluster:Attribute;
cluster:access cluster:readable,
cluster:writable;
core:range value:temperature;
.
/// Minimum setpoint deadband.
min-setpoint-deadband
core:has-type cluster:Attribute;
cluster:access cluster:readable,
cluster:writable;
core:range value:temperature;
.
/// This attribute SHALL indicate the current operating mode of the thermostat. Its value SHALL be
/// limited by the ControlSequenceOfOperation attribute.
system-mode
core:has-type cluster:Attribute;
cluster:access cluster:readable,
cluster:writable;
core:range cluster:hvac:thermostat:type:SystemMode;
.
/// This attribute SHALL indicate the running mode of the thermostat.
/// This attribute uses the same values as SystemModeEnum but can only be Off, Cool or Heat.
/// This attribute is intended to provide additional information when the thermostat’s system mode is in auto mode.
thermostat-running-mode
core:has-type cluster:Attribute;
cluster:access cluster:readable;
core:range cluster:hvac:thermostat:type:ThermostatRunningMode;
.
/// Occupied setback.
occupied-setback
core:has-type cluster:Attribute;
cluster:access cluster:readable,
cluster:writable;
core:range value:unsigned-temperature;
.
/// Occupied setback minimum.
occupied-setback-min
core:has-type cluster:Attribute;
cluster:access cluster:readable;
core:range value:unsigned-temperature;
.
/// Occupied setback maximum.
occupied-setback-max
core:has-type cluster:Attribute;
cluster:access cluster:readable;
core:range value:unsigned-temperature;
.
/// Unoccupied setback.
unoccupied-setback
core:has-type cluster:Attribute;
cluster:access cluster:readable,
cluster:writable;
core:range value:unsigned-temperature;
.
/// Unoccupied setback minimum.
unoccupied-setback-min
core:has-type cluster:Attribute;
cluster:access cluster:readable;
core:range value:unsigned-temperature;
.
/// Unoccupied setback maximum.
unoccupied-setback-max
core:has-type cluster:Attribute;
cluster:access cluster:readable;
core:range value:unsigned-temperature;
.
/// Emergency heat delta.
emergency-heat-delta
core:has-type cluster:Attribute;
cluster:access cluster:readable,
cluster:writable;
core:range value:unsigned-temperature;
.
/// AC type.
ac-type
core:has-type cluster:Attribute;
cluster:access cluster:readable;
core:range cluster:hvac:thermostat:type:AcType;
.
/// AC refrigerant type.
ac-refrigerant-type
core:has-type cluster:Attribute;
cluster:access cluster:readable;
core:range cluster:hvac:thermostat:type:AcRefrigerantType;
.
/// AC compressor type.
ac-compressor-type
core:has-type cluster:Attribute;
cluster:access cluster:readable;
core:range cluster:hvac:thermostat:type:AcCompressorType;
.
}
graph cluster:hvac:thermostat:command {
setpoint-raise-lower
core:has-type cluster:Command;
core:property mode
.
mode
core:has-type core:Property;
core:range SetPointRaiseLowerMode
.
amount
core:has-type core:Property;
core:range temperature
.
}
graph cluster:hvac:thermostat:type {
/// Raise/Lower mode (heat, cool, both).
SetpointRaiseLowerMode core:has-type core:Enumeration.
setpoint-raise-lower-mode-heat core:has-type SetpointRaiseLowerMode;
core:label "Heat".
setpoint-raise-lower-mode-cool core:has-type SetpointRaiseLowerMode;
core:label "Cool".
setpoint-raise-lower-mode-both core:has-type SetpointRaiseLowerMode;
core:label "Both".
/// System mode.
SystemMode core:has-type core:Enumeration.
/// Off
system-mode-off core:has-type SystemMode;
core:label "Off".
/// Auto
system-mode-auto core:has-type SystemMode;
core:label "Auto".
/// Cool
system-mode-cool core:has-type SystemMode;
core:label "Cool".
/// Heat
system-mode-heat core:has-type SystemMode;
core:label "Heat".
/// Emergency heat
system-mode-emergency-heat core:has-type SystemMode;
core:label "Emergency Heat".
/// Precooling
system-mode-precooling core:has-type SystemMode;
core:label "Precooling".
/// Fan only
system-mode-fan-only core:has-type SystemMode;
core:label "Fan Only".
/// Dry
system-mode-dry core:has-type SystemMode;
core:label "Dry".
/// Sleep
system-mode-sleep core:has-type SystemMode;
core:label "Sleep".
/// Thermostat running mode.
ThermostatRunningMode core:has-type core:Enumeration.
/// Off
thermostat-running-mode-off core:has-type ThermostatRunningMode;
core:label "Off".
/// Cool
thermostat-running-mode-cool core:has-type ThermostatRunningMode;
core:label "Cool".
/// Heat
thermostat-running-mode-heat core:has-type ThermostatRunningMode;
core:label "Heat".
/// AC type.
AcType core:has-type core:Enumeration.
/// Unknown AC type
ac-type-unknown core:has-type AcType;
core:label "Unknown".
/// Cooling (fixed)
ac-type-cooling-fixed core:has-type AcType;
core:label "Cooling (Fixed)".
/// Heat-pump (fixed)
ac-type-heat-pump-fixed core:has-type AcType;
core:label "Heat Pump (Fixed)".
/// Cooling (inverter)
ac-type-cooling-inverter core:has-type AcType;
core:label "Cooling (Inverter)".
/// Heat-pump (inverter)
ac-type-heap-pump-inverter core:has-type AcType;
core:label "Heat Pump (Inverter)".
/// AC refrigerant type.
AcRefrigerantType core:has-type core:Enumeration.
/// Uknown refrigerant type
ac-refrigerant-type-unknown core:has-type AcRefrigerantType;
core:label "Unknown".
/// R22 refrigerant
ac-refrigerant-type-r22 core:has-type AcRefrigerantType;
core:label "R22".
/// R410a refrigerant
ac-refrigerant-type-r410a core:has-type AcRefrigerantType;
core:label "R410a".
/// R407c refrigerant
ac-refrigerant-type-r407c core:has-type AcRefrigerantType;
core:label "R407c".
/// AC compressor type
AcCompressorType core:has-type core:Enumeration.
/// Unknown type
ac-compressor-type-unknown core:has-type AcCompressorType;
core:label "Unknown".
/// T1
ac-compressor-type-t1 core:has-type AcCompressorType;
core:label "T1".
/// T2
ac-compressor-type-t2 core:has-type AcCompressorType;
core:label "T2".
/// T3
ac-compressor-type-t3 core:has-type AcCompressorType;
core:label "T3".
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment