Skip to content

Commit 33d9de8

Browse files
author
Ernst
committed
Add H5055
1 parent 13081f7 commit 33d9de8

File tree

6 files changed

+134
-0
lines changed

6 files changed

+134
-0
lines changed

custom_components/ble_monitor/ble_parser/__init__.py

+4
Original file line numberDiff line numberDiff line change
@@ -411,6 +411,10 @@ def parse_advertisement(
411411
# Thermobeacon
412412
sensor_data = parse_thermobeacon(self, man_spec_data, mac)
413413
break
414+
elif comp_id == 0xEA1C and data_len == 0x17:
415+
# Govee H50555
416+
sensor_data = parse_govee(self, man_spec_data, service_class_uuid16, local_name, mac)
417+
break
414418
elif comp_id == 0xEC88 and data_len in [0x09, 0x0A, 0x0C, 0x22, 0x24, 0x25]:
415419
# Govee H5051/H5071/H5072/H5075/H5074
416420
sensor_data = parse_govee(self, man_spec_data, service_class_uuid16, local_name, mac)

custom_components/ble_monitor/ble_parser/govee.py

+43
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,13 @@ def decode_temps_probes(packet_value: int) -> float:
4444
return float(packet_value / 100)
4545

4646

47+
def decode_temps_probes_negative(packet_value: int) -> float:
48+
"""Filter potential negative temperatures."""
49+
if packet_value < 0:
50+
return 0.0
51+
return float(packet_value)
52+
53+
4754
def decode_pm25_from_4_bytes(packet_value: int) -> int:
4855
"""Decode humidity values"""
4956
packet_value &= 0x7FFFFFFF
@@ -231,6 +238,42 @@ def parse_govee(self, data: str, service_class_uuid16: int, local_name: str, mac
231238
else:
232239
_LOGGER.debug("Unknown sensor id found for Govee H5198. Data %s", data.hex())
233240
return None
241+
elif msg_length == 24 and device_id == 0xEA1C:
242+
device_type = "H5055"
243+
battery = data[6]
244+
if battery:
245+
result.update({"battery": battery})
246+
sensor_id = data[7]
247+
(temp_probe_first, high_temp_alarm_first, low_temp_alarm_first, _, temp_probe_second, high_temp_alarm_second, low_temp_alarm_second) = unpack(
248+
"<hhhchhh", data[9:22]
249+
)
250+
if int(sensor_id) & 0xC0 == 0:
251+
result.update({
252+
"temperature probe 1": decode_temps_probes_negative(temp_probe_first),
253+
"temperature alarm probe 1": decode_temps_probes_negative(high_temp_alarm_first),
254+
"low temperature alarm probe 1": decode_temps_probes_negative(low_temp_alarm_first),
255+
"temperature probe 2": decode_temps_probes_negative(temp_probe_second),
256+
"temperature alarm probe 2": decode_temps_probes_negative(high_temp_alarm_second),
257+
"low temperature alarm probe 2": decode_temps_probes_negative(low_temp_alarm_second)
258+
})
259+
elif int(sensor_id) & 0xC0 == 64:
260+
result.update({
261+
"temperature probe 3": decode_temps_probes_negative(temp_probe_first),
262+
"temperature alarm probe 3": decode_temps_probes_negative(high_temp_alarm_first),
263+
"low temperature alarm probe 3": decode_temps_probes_negative(low_temp_alarm_first),
264+
"temperature probe 4": decode_temps_probes_negative(temp_probe_second),
265+
"temperature alarm probe 4": decode_temps_probes_negative(high_temp_alarm_second),
266+
"low temperature alarm probe 4": decode_temps_probes_negative(low_temp_alarm_second),
267+
})
268+
elif int(sensor_id) & 0xC0 == 128:
269+
result.update({
270+
"temperature probe 5": decode_temps_probes_negative(temp_probe_first),
271+
"temperature alarm probe 5": decode_temps_probes_negative(high_temp_alarm_first),
272+
"low temperature alarm probe 5": decode_temps_probes_negative(low_temp_alarm_first),
273+
"temperature probe 6": decode_temps_probes_negative(temp_probe_second),
274+
"temperature alarm probe 6": decode_temps_probes_negative(high_temp_alarm_second),
275+
"low temperature alarm probe 6": decode_temps_probes_negative(low_temp_alarm_second),
276+
})
234277
else:
235278
if self.report_unknown == "Govee":
236279
_LOGGER.info(

custom_components/ble_monitor/const.py

+46
Original file line numberDiff line numberDiff line change
@@ -680,6 +680,28 @@ class BLEMonitorBinarySensorEntityDescription(
680680
suggested_display_precision=0,
681681
state_class=SensorStateClass.MEASUREMENT,
682682
),
683+
BLEMonitorSensorEntityDescription(
684+
key="temperature alarm probe 5",
685+
sensor_class="TemperatureSensor",
686+
update_behavior="Averaging",
687+
name="ble temperature alarm probe 5",
688+
unique_id="t_alarm_probe_5_",
689+
native_unit_of_measurement=UnitOfTemperature.CELSIUS,
690+
device_class=SensorDeviceClass.TEMPERATURE,
691+
suggested_display_precision=0,
692+
state_class=SensorStateClass.MEASUREMENT,
693+
),
694+
BLEMonitorSensorEntityDescription(
695+
key="temperature alarm probe 6",
696+
sensor_class="TemperatureSensor",
697+
update_behavior="Averaging",
698+
name="ble temperature alarm probe 6",
699+
unique_id="t_alarm_probe_6_",
700+
native_unit_of_measurement=UnitOfTemperature.CELSIUS,
701+
device_class=SensorDeviceClass.TEMPERATURE,
702+
suggested_display_precision=0,
703+
state_class=SensorStateClass.MEASUREMENT,
704+
),
683705
BLEMonitorSensorEntityDescription(
684706
key="low temperature alarm probe 1",
685707
sensor_class="TemperatureSensor",
@@ -724,6 +746,28 @@ class BLEMonitorBinarySensorEntityDescription(
724746
suggested_display_precision=0,
725747
state_class=SensorStateClass.MEASUREMENT,
726748
),
749+
BLEMonitorSensorEntityDescription(
750+
key="low temperature alarm probe 5",
751+
sensor_class="TemperatureSensor",
752+
update_behavior="Averaging",
753+
name="ble low temperature alarm probe 5",
754+
unique_id="t_alarm_low_probe_5_",
755+
native_unit_of_measurement=UnitOfTemperature.CELSIUS,
756+
device_class=SensorDeviceClass.TEMPERATURE,
757+
suggested_display_precision=0,
758+
state_class=SensorStateClass.MEASUREMENT,
759+
),
760+
BLEMonitorSensorEntityDescription(
761+
key="low temperature alarm probe 6",
762+
sensor_class="TemperatureSensor",
763+
update_behavior="Averaging",
764+
name="ble low temperature alarm probe 6",
765+
unique_id="t_alarm_low_probe_6_",
766+
native_unit_of_measurement=UnitOfTemperature.CELSIUS,
767+
device_class=SensorDeviceClass.TEMPERATURE,
768+
suggested_display_precision=0,
769+
state_class=SensorStateClass.MEASUREMENT,
770+
),
727771
BLEMonitorSensorEntityDescription(
728772
key="temperature probe tip",
729773
sensor_class="TemperatureSensor",
@@ -1922,6 +1966,7 @@ class BLEMonitorBinarySensorEntityDescription(
19221966
'H5101/H5102/H5177' : [["temperature", "humidity", "battery", "rssi"], [], []],
19231967
'H5051/H5071' : [["temperature", "humidity", "battery", "rssi"], [], []],
19241968
'H5052' : [["temperature", "humidity", "battery", "rssi"], [], []],
1969+
'H5055' : [["temperature probe 1", "temperature alarm probe 1", "low temperature alarm probe 1", "temperature probe 2", "temperature alarm probe 2", "low temperature alarm probe 2", "temperature probe 3", "temperature alarm probe 3", "low temperature alarm probe 3", "temperature probe 4", "temperature alarm probe 4", "low temperature alarm probe 4", "temperature probe 5", "temperature alarm probe 5", "low temperature alarm probe 5", "temperature probe 6", "temperature alarm probe 6", "low temperature alarm probe 6", "battery", "rssi"], [], []],
19251970
'H5071' : [["temperature", "humidity", "battery", "rssi"], [], []],
19261971
'H5074' : [["temperature", "humidity", "battery", "rssi"], [], []],
19271972
'H5106' : [["temperature", "humidity", "pm2.5", "rssi"], [], []],
@@ -2059,6 +2104,7 @@ class BLEMonitorBinarySensorEntityDescription(
20592104
'H5101/H5102/H5177' : 'Govee',
20602105
'H5051/H5071' : 'Govee',
20612106
'H5052' : 'Govee',
2107+
'H5055' : 'Govee',
20622108
'H5071' : 'Govee',
20632109
'H5074' : 'Govee',
20642110
'H5106' : 'Govee',

custom_components/ble_monitor/test/test_govee_parser.py

+22
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,28 @@ def test_Govee_H5051(self):
2222
assert sensor_msg["battery"] == 99
2323
assert sensor_msg["rssi"] == -73
2424

25+
def test_Govee_H5055(self):
26+
"""Test Govee H5055 parser."""
27+
data_string = "043e270201000005351338c1a41b02010617ff1cea3500644120ffffffffffff203200ffffffff0000c4"
28+
data = bytes(bytearray.fromhex(data_string))
29+
# pylint: disable=unused-variable
30+
ble_parser = BleParser()
31+
sensor_msg, tracker_msg = ble_parser.parse_raw_data(data)
32+
33+
assert sensor_msg["firmware"] == "Govee"
34+
assert sensor_msg["type"] == "H5055"
35+
assert sensor_msg["mac"] == "A4C138133505"
36+
assert sensor_msg["packet"] == "no packet id"
37+
assert sensor_msg["data"]
38+
assert sensor_msg["temperature probe 3"] == 0.0
39+
assert sensor_msg["temperature alarm probe 3"] == 0.0
40+
assert sensor_msg["low temperature alarm probe 3"] == 0.0
41+
assert sensor_msg["temperature probe 4"] == 50.0
42+
assert sensor_msg["temperature alarm probe 4"] == 0.0
43+
assert sensor_msg["low temperature alarm probe 4"] == 0.0
44+
assert sensor_msg["battery"] == 100
45+
assert sensor_msg["rssi"] == -60
46+
2547
def test_Govee_H5074(self):
2648
"""Test Govee H5074 parser."""
2749
data_string = "043e1702010400aabb611d12e00b0aff88ec0088078c116402a6"

docs/_devices/Govee_H5055.md

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
---
2+
manufacturer: Govee
3+
name: Smart Meat Thermometer
4+
model: H5055
5+
image: Govee_H5055.png
6+
physical_description: Square body, with 6 probes.
7+
broadcasted_properties:
8+
- temperature probe
9+
- temperature alarm probe
10+
- battery
11+
- rssi
12+
broadcasted_property_notes:
13+
broadcast_rate:
14+
active_scan: true
15+
encryption_key:
16+
custom_firmware:
17+
notes:
18+
- actve scan needs to be enabled in the BLE Monitor settings for this sensor to work.
19+
---

docs/assets/images/Govee_H5055.png

29.1 KB
Loading

0 commit comments

Comments
 (0)