Fix for Govee H5198
@@ -177,24 +177,26 @@ def parse_govee(self, data, service_class_uuid16, source_mac, rssi):
"temperature alarm probe 2": decode_temps_probes(temp_alarm_2)
})
elif msg_length == 24 and service_class_uuid16 == 0x5198:
- _LOGGER.debug("Govee H5198 detected with data %s", data.hex())
device_type = "H5198"
sensor_id = data[10]
- (temp_probe_first, temp_alarm_first, _, temp_probe_second, temp_alarm_second) = unpack(">hhhhh", data[12:22])
- if sensor_id == 1:
+ (temp_probe_first, temp_alarm_first, _, temp_probe_second, temp_alarm_second, _) = unpack(">hhhhhh", data[12:24])
+ if sensor_id in [0x01, 0x41, 0x81, 0xC1]:
result.update({
"temperature probe 1": decode_temps_probes(temp_probe_first),
"temperature alarm probe 1": decode_temps_probes(temp_alarm_first),
"temperature probe 2": decode_temps_probes(temp_probe_second),
"temperature alarm probe 2": decode_temps_probes(temp_alarm_second)
})
- elif sensor_id == 2:
+ elif sensor_id in [0x02, 0x42, 0x82, 0xC2]:
result.update({
"temperature probe 3": decode_temps_probes(temp_probe_first),
"temperature alarm probe 3": decode_temps_probes(temp_alarm_first),
"temperature probe 4": decode_temps_probes(temp_probe_second),
"temperature alarm probe 4": decode_temps_probes(temp_alarm_second)
})
+ else:
+ _LOGGER.debug("Unkown sensor id found for Govee H5198. Data %s", data.hex())
+ return None
else:
if self.report_unknown == "Govee":
_LOGGER.info(
