Repository navigation
Temperature Encoding
wiki-publish edited this page Jul 18, 2026
·
7 revisions
- Wire temperatures are always Celsius.
- Display scale (°F/°C) is separate (Setup / Scale); convert at the UI boundary.
- Half-degree resolution using a packed byte.
| Bits | Meaning |
|---|---|
| 7 | Sign: 0 = positive, 1 = negative |
| 6 | Half degree: 0 = .0, 1 = .5
|
| 5–0 | Integer magnitude (0–63) |
Special:
| Value | Meaning on writes |
|---|---|
0x00 |
Null — do not modify this setpoint field |
For heat setpoints the guide also documents valid magnitude ranges (e.g. heat ~4–32 °C region); out-of-range writes NACK.
encode(celsius):
sign = 0x80 if celsius < 0 else 0
mag = abs(celsius)
half = 0x40 if (mag % 1) >= 0.5 else 0
return floor(mag) + half + sign
decode(byte):
value = byte & 0x3F
if byte & 0x40: value += 0.5
if byte & 0x80: value = -value
return value
Implemented in this repo as convertTemperatureToByte / convertByteToTemperature in src/AprilaireClient.ts.
| °C | Byte | Context |
|---|---|---|
| 21.0 | 0x15 |
Heat SP 70 °F |
| 26.5 | 0x5A |
Cool SP 80 °F |
| 21.5 | 0x55 |
Indoor 71 °F COS example |
| 43.5 | 0x6B |
Out-of-range heat example |
Guide appendix lists F↔C pairs at 0.5 °C steps. When converting F→C and two C values map to the same F, use the first table entry (e.g. 64 °F → 17.5 °C, not 18 °C).
- Host may write outdoor °C for thermostats in Automation outdoor-sensor mode.
- Status byte on write must be
0(status is read/COS only). - Refresh more often than every 10 minutes or thermostat treats ODT as timed out.
Protocol reference for scrypted-aprilaire · Validate codecs with npm test