Skip to content

0002: External Sensor

David Bonnes edited this page Jan 21, 2020 · 1 revision
Description: Request or return the temperature from an external sensor. This command appears to have other uses which are still to be fully documented
Examples: RQ --- HGI CTL --:------ 0002 001 00
RP --- CTL HGI --:------ 0002 004 007FFF01
I --- TRV --:------ TRV 0002 004 007FFF01
I --- HGI --:------ HGI 0002 008 0000000202045601
Payload decode:
Unknown [0:2]
Temperature [2:6] degrees C
Unknown [6:8]
Unknown [8:12]

Using Python, the payload can be decoded as:

def _temp(seqx) -> Optional[float]:
    if seqx == "7FFF":
        return None
    temp = int(seqx, 16)
    return (temp if temp < 2 ** 15 else temp - 2 ** 16) / 100

def parser_1290(payload) -> dict:
    assert payload[:2] == "00"

    return {"temperature": _temp(payload[2:6])}

Related Packets

Clone this wiki locally