diff --git a/custom_components/ble_monitor/ble_parser/mocreo.py b/custom_components/ble_monitor/ble_parser/mocreo.py index 42872c42..06a0e198 100644 --- a/custom_components/ble_monitor/ble_parser/mocreo.py +++ b/custom_components/ble_monitor/ble_parser/mocreo.py @@ -15,7 +15,8 @@ 0x86: "ST9", 0x87: "ST10", 0x8B: "MS1", - 0x8D: "MS2", + 0x94: "MS2", + 0x96: "MS3", } COMMON_DATA_PARSING_FORMAT = { @@ -53,9 +54,11 @@ 0x8B: { "temperature": (6, 0, -16, True, lambda x: x / 100), }, - 0x8D: { + 0x94: { + "temperature": (6, 0, -16, True, lambda x: x / 100), + }, + 0x96: { "temperature": (6, 0, -16, True, lambda x: x / 100), - "humidity": (8, 0, -16, True, lambda x: x / 100), }, } diff --git a/custom_components/ble_monitor/const.py b/custom_components/ble_monitor/const.py index db1251f0..41d5e020 100755 --- a/custom_components/ble_monitor/const.py +++ b/custom_components/ble_monitor/const.py @@ -2206,7 +2206,8 @@ class BLEMonitorBinarySensorEntityDescription( 'ST9' : [["temperature", "humidity", "battery", "rssi"], [], []], 'ST10' : [["temperature", "battery", "rssi"], [], []], 'MS1' : [["temperature", "battery", "rssi"], [], []], - 'MS2' : [["temperature", "humidity", "battery", "rssi"], [], []], + 'MS2' : [["temperature", "battery", "rssi"], [], []], + 'MS3' : [["temperature", "battery", "rssi"], [], []], 'TMS' : [["temperature", "voltage", "pressure", "count", "steps", "text", "rssi"], [], []], 'S-MATE' : [["rssi"], ["three btn switch left", "three btn switch middle", "three btn switch right"], []], 'R5' : [["rssi"], ["six btn switch top left", "six btn switch top middle", "six btn switch top right", "six btn switch bottom left", "six btn switch bottom middle", "six btn switch bottom right"], []], @@ -2361,6 +2362,7 @@ class BLEMonitorBinarySensorEntityDescription( 'ST10' : 'MOCREO', 'MS1' : 'MOCREO', 'MS2' : 'MOCREO', + 'MS3' : 'MOCREO', 'TMS' : 'Michelin', 'S-MATE' : 'Sonoff', 'R5' : 'Sonoff', diff --git a/custom_components/ble_monitor/test/test_mocreo_parser.py b/custom_components/ble_monitor/test/test_mocreo_parser.py index 2a14e77a..3dc6bcde 100644 --- a/custom_components/ble_monitor/test/test_mocreo_parser.py +++ b/custom_components/ble_monitor/test/test_mocreo_parser.py @@ -115,7 +115,7 @@ def test_MOCREO_MS1(self): def test_MOCREO_MS2(self): """Test MOCREO parser for MS2.""" - data_string = "043e2b02010001bbaa00a4ae301f02010607094d4f4352454f13ff018d7b00e4b0370a6212000000002e000000d6" + data_string = "043e2b02010001bbaa00a4ae301f02010607094d4f4352454f13ff01947b00e4b0370a6212000000002e000000d6" data = bytes(bytearray.fromhex(data_string)) # pylint: disable=unused-variable @@ -126,7 +126,6 @@ def test_MOCREO_MS2(self): assert sensor_msg["mac"] == "30AEA400AABB" assert sensor_msg["packet"] == "no packet id" assert sensor_msg["temperature"] == 26.15 - assert sensor_msg["humidity"] == 47.06 assert sensor_msg["battery"] == 100 assert sensor_msg["data"] assert sensor_msg["rssi"] == -42 @@ -147,3 +146,20 @@ def test_MOCREO_SW2(self): assert sensor_msg["battery"] == 100 assert sensor_msg["data"] assert sensor_msg["rssi"] == -63 + + def test_MOCREO_MS3(self): + """Test MOCREO parser for MS3.""" + data_string = "043e2b02010001bbaa00a4ae301f02010607094d4f4352454f13ff41960a00e4b0730a00000000000040000000d3" + data = bytes(bytearray.fromhex(data_string)) + + # pylint: disable=unused-variable + ble_parser = BleParser() + sensor_msg, tracker_msg = ble_parser.parse_raw_data(data) + assert sensor_msg["firmware"] == "MOCREO" + assert sensor_msg["type"] == "MS3" + assert sensor_msg["mac"] == "30AEA400AABB" + assert sensor_msg["packet"] == "no packet id" + assert sensor_msg["temperature"] == 26.75 + assert sensor_msg["battery"] == 100 + assert sensor_msg["data"] + assert sensor_msg["rssi"] == -45 diff --git a/docs/_devices/MOCREO_MS2.md b/docs/_devices/MOCREO_MS2.md index 17a4e68d..b2d68b64 100644 --- a/docs/_devices/MOCREO_MS2.md +++ b/docs/_devices/MOCREO_MS2.md @@ -1,12 +1,11 @@ --- manufacturer: MOCREO -name: Temperature Humidity Sensor +name: Temperature Sensor model: MS2 image: MOCREO_MS2.png physical_description: Oval body, without probe broadcasted_properties: - temperature - - humidity - battery - rssi broadcasted_property_notes: @@ -16,11 +15,9 @@ encryption_key: custom_firmware: notes: > Key Features: - - Temp range: -4 to +140°F - - Humidity range: 0 to 100%RH - - Temp accuracy: ±0.5℉ - - Humidity accuracy: ±2% (10~90%RH), ±3% (0~10% / 90~100%RH) - - BLE advertising mode + - Temp range: -40 to +158°F + - Temp accuracy: ±0.5°C + - BLE advertising mode (no pairing needed) - Low power consumption, 2 years of battery life - Fully supported by Passive BLE Monitor (auto-discovery) - Real-time data is available in Home Assistant dashboards diff --git a/docs/_devices/MOCREO_MS3.md b/docs/_devices/MOCREO_MS3.md new file mode 100644 index 00000000..60bbc53d --- /dev/null +++ b/docs/_devices/MOCREO_MS3.md @@ -0,0 +1,25 @@ +--- +manufacturer: MOCREO +name: Temperature Sensor +model: MS3 +image: MOCREO_MS3.png +physical_description: Oval body, with display +broadcasted_properties: + - temperature + - battery + - rssi +broadcasted_property_notes: +broadcast_rate: +active_scan: +encryption_key: +custom_firmware: +notes: > + Key Features: + - Temp range: -40 to +158°F + - Temp accuracy: ±0.5°C + - BLE advertising mode (no pairing needed) + - Built-in display for real-time temperature reading + - Low power consumption, 2 years of battery life + - Fully supported by Passive BLE Monitor (auto-discovery) + - Real-time data is available in Home Assistant dashboards +--- diff --git a/docs/assets/images/MOCREO_MS2.png b/docs/assets/images/MOCREO_MS2.png index 2d24c414..ab8f7914 100644 Binary files a/docs/assets/images/MOCREO_MS2.png and b/docs/assets/images/MOCREO_MS2.png differ diff --git a/docs/assets/images/MOCREO_MS3.png b/docs/assets/images/MOCREO_MS3.png new file mode 100644 index 00000000..4b978a18 Binary files /dev/null and b/docs/assets/images/MOCREO_MS3.png differ