Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions custom_components/ble_monitor/ble_parser/mocreo.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
0x86: "ST9",
0x87: "ST10",
0x8B: "MS1",
0x8D: "MS2",
0x94: "MS2",
0x96: "MS3",
}

COMMON_DATA_PARSING_FORMAT = {
Expand Down Expand Up @@ -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),
},
}

Expand Down
4 changes: 3 additions & 1 deletion custom_components/ble_monitor/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"], []],
Expand Down Expand Up @@ -2361,6 +2362,7 @@ class BLEMonitorBinarySensorEntityDescription(
'ST10' : 'MOCREO',
'MS1' : 'MOCREO',
'MS2' : 'MOCREO',
'MS3' : 'MOCREO',
'TMS' : 'Michelin',
'S-MATE' : 'Sonoff',
'R5' : 'Sonoff',
Expand Down
20 changes: 18 additions & 2 deletions custom_components/ble_monitor/test/test_mocreo_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
11 changes: 4 additions & 7 deletions docs/_devices/MOCREO_MS2.md
Original file line number Diff line number Diff line change
@@ -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:
Expand All @@ -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
Expand Down
25 changes: 25 additions & 0 deletions docs/_devices/MOCREO_MS3.md
Original file line number Diff line number Diff line change
@@ -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
---
Binary file modified docs/assets/images/MOCREO_MS2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/images/MOCREO_MS3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading