diff --git a/custom_components/ble_monitor/ble_parser/__init__.py b/custom_components/ble_monitor/ble_parser/__init__.py index a4c7f41e..b9ae5490 100644 --- a/custom_components/ble_monitor/ble_parser/__init__.py +++ b/custom_components/ble_monitor/ble_parser/__init__.py @@ -411,6 +411,10 @@ def parse_advertisement( # Thermobeacon sensor_data = parse_thermobeacon(self, man_spec_data, mac) break + elif comp_id == 0xEA1C and data_len == 0x17: + # Govee H50555 + sensor_data = parse_govee(self, man_spec_data, service_class_uuid16, local_name, mac) + break elif comp_id == 0xEC88 and data_len in [0x09, 0x0A, 0x0C, 0x22, 0x24, 0x25]: # Govee H5051/H5071/H5072/H5075/H5074 sensor_data = parse_govee(self, man_spec_data, service_class_uuid16, local_name, mac) diff --git a/custom_components/ble_monitor/ble_parser/govee.py b/custom_components/ble_monitor/ble_parser/govee.py index 3ca9dc96..651a3612 100644 --- a/custom_components/ble_monitor/ble_parser/govee.py +++ b/custom_components/ble_monitor/ble_parser/govee.py @@ -44,6 +44,13 @@ def decode_temps_probes(packet_value: int) -> float: return float(packet_value / 100) +def decode_temps_probes_negative(packet_value: int) -> float: + """Filter potential negative temperatures.""" + if packet_value < 0: + return 0.0 + return float(packet_value) + + def decode_pm25_from_4_bytes(packet_value: int) -> int: """Decode humidity values""" packet_value &= 0x7FFFFFFF @@ -231,6 +238,42 @@ def parse_govee(self, data: str, service_class_uuid16: int, local_name: str, mac else: _LOGGER.debug("Unknown sensor id found for Govee H5198. Data %s", data.hex()) return None + elif msg_length == 24 and device_id == 0xEA1C: + device_type = "H5055" + battery = data[6] + if battery: + result.update({"battery": battery}) + sensor_id = data[7] + (temp_probe_first, high_temp_alarm_first, low_temp_alarm_first, _, temp_probe_second, high_temp_alarm_second, low_temp_alarm_second) = unpack( + "