Skip to content

Commit 68daa92

Browse files
committed
Add other sensors and docs
1 parent e0a4ca3 commit 68daa92

File tree

5 files changed

+115
-20
lines changed

5 files changed

+115
-20
lines changed

custom_components/ble_monitor/ble_parser/oras.py

+13-19
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@
99
0: "fresh tank",
1010
1: "black tank",
1111
2: "grey tank",
12-
3: "LPG tank",
13-
4: "LPG tank 2",
12+
3: "lpg tank",
13+
4: "lpg tank 2",
1414
5: "galley tank",
1515
6: "galley tank 2",
1616
7: "temperature",
17-
8: "temperature 2",
18-
9: "temperature 3",
19-
10: "temperature 4",
17+
8: "temperature probe 2",
18+
9: "temperature probe 3",
19+
10: "temperature probe 4",
2020
11: "chemical tank",
2121
12: "chemical tank 2",
2222
13: "voltage",
@@ -54,25 +54,19 @@ def parse_oras(self, data: bytes, mac: str):
5454

5555
sensor_volume = data[11:14].decode("ASCII")
5656
sensor_total = data[14:17].decode("ASCII")
57-
sensor_alarm = chr(data[17])
57+
sensor_alarm = data[17]
5858

59-
# remove later
6059
result.update({
61-
"sensor_id": sensor_id,
62-
"sensor_type": sensor_type,
63-
"sensor_data": sensor_data,
64-
"sensor_volume": sensor_volume,
65-
"sensor_total": sensor_total,
66-
"sensor_alarm": sensor_alarm,
60+
sensor_type: sensor_data,
61+
"problem": sensor_alarm,
6762
})
68-
_LOGGER.info(
69-
"BLE ADV from Oras DEVICE: %s, result: %s",
63+
_LOGGER.debug(
64+
"BLE ADV from Garnet DEVICE: %s, result: %s, not implemented volume %s, total %s",
7065
device_type,
71-
result
66+
result,
67+
sensor_volume,
68+
sensor_total
7269
)
73-
74-
result.update({sensor_type: sensor_data})
75-
7670
elif msg_length == 22:
7771
firmware = "Oras"
7872
device_type = "Electra Washbasin Faucet"

custom_components/ble_monitor/const.py

+79-1
Original file line numberDiff line numberDiff line change
@@ -1067,7 +1067,79 @@ class BLEMonitorBinarySensorEntityDescription(
10671067
sensor_class="MeasuringSensor",
10681068
update_behavior="Averaging",
10691069
name="grey tank",
1070-
unique_id="gray_tank_",
1070+
unique_id="grey_tank_",
1071+
icon="mdi:storage-tank-outline",
1072+
native_unit_of_measurement=PERCENTAGE,
1073+
device_class=None,
1074+
suggested_display_precision=0,
1075+
state_class=SensorStateClass.MEASUREMENT,
1076+
),
1077+
BLEMonitorSensorEntityDescription(
1078+
key="chemical tank",
1079+
sensor_class="MeasuringSensor",
1080+
update_behavior="Averaging",
1081+
name="chemical tank",
1082+
unique_id="chemical_tank_",
1083+
icon="mdi:chemical-weapon",
1084+
native_unit_of_measurement=PERCENTAGE,
1085+
device_class=None,
1086+
suggested_display_precision=0,
1087+
state_class=SensorStateClass.MEASUREMENT,
1088+
),
1089+
BLEMonitorSensorEntityDescription(
1090+
key="chemical tank 2",
1091+
sensor_class="MeasuringSensor",
1092+
update_behavior="Averaging",
1093+
name="chemical tank 2",
1094+
unique_id="chemical_tank_2_",
1095+
icon="mdi:chemical-weapon",
1096+
native_unit_of_measurement=PERCENTAGE,
1097+
device_class=None,
1098+
suggested_display_precision=0,
1099+
state_class=SensorStateClass.MEASUREMENT,
1100+
),
1101+
BLEMonitorSensorEntityDescription(
1102+
key="lpg tank",
1103+
sensor_class="MeasuringSensor",
1104+
update_behavior="Averaging",
1105+
name="lpg tank",
1106+
unique_id="lpg_tank_",
1107+
icon="mdi:gas-cylinder",
1108+
native_unit_of_measurement=PERCENTAGE,
1109+
device_class=None,
1110+
suggested_display_precision=0,
1111+
state_class=SensorStateClass.MEASUREMENT,
1112+
),
1113+
BLEMonitorSensorEntityDescription(
1114+
key="lpg tank 2",
1115+
sensor_class="MeasuringSensor",
1116+
update_behavior="Averaging",
1117+
name="lpg tank 2",
1118+
unique_id="lpg_tank_2_",
1119+
icon="mdi:gas-cylinder",
1120+
native_unit_of_measurement=PERCENTAGE,
1121+
device_class=None,
1122+
suggested_display_precision=0,
1123+
state_class=SensorStateClass.MEASUREMENT,
1124+
),
1125+
BLEMonitorSensorEntityDescription(
1126+
key="galley tank",
1127+
sensor_class="MeasuringSensor",
1128+
update_behavior="Averaging",
1129+
name="galley tank",
1130+
unique_id="galley_tank_",
1131+
icon="mdi:storage-tank-outline",
1132+
native_unit_of_measurement=PERCENTAGE,
1133+
device_class=None,
1134+
suggested_display_precision=0,
1135+
state_class=SensorStateClass.MEASUREMENT,
1136+
),
1137+
BLEMonitorSensorEntityDescription(
1138+
key="galley tank 2",
1139+
sensor_class="MeasuringSensor",
1140+
update_behavior="Averaging",
1141+
name="galley tank 2",
1142+
unique_id="galley_tank_2_",
10711143
icon="mdi:storage-tank-outline",
10721144
native_unit_of_measurement=PERCENTAGE,
10731145
device_class=None,
@@ -2038,6 +2110,8 @@ class BLEMonitorBinarySensorEntityDescription(
20382110
"battery",
20392111
"black tank",
20402112
"button",
2113+
"chemical tank",
2114+
"chemical tank 2",
20412115
"co2",
20422116
"conductivity",
20432117
"count",
@@ -2050,13 +2124,17 @@ class BLEMonitorBinarySensorEntityDescription(
20502124
"energy",
20512125
"flow",
20522126
"fresh tank",
2127+
"galley tank",
2128+
"galley tank 2",
20532129
"gas",
20542130
"gravity",
20552131
"grey tank",
20562132
"gyroscope",
20572133
"humidity",
20582134
"illuminance",
20592135
"impedance",
2136+
"lpg tank",
2137+
"lpg tank 2",
20602138
"meat temperature",
20612139
"moisture",
20622140
"movement counter",

custom_components/ble_monitor/test/test_oras.py

+2
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ def test_garnet_battery(self):
3434
assert sensor_msg["packet"] == "no packet id"
3535
assert sensor_msg["data"]
3636
assert sensor_msg["voltage"] == 13.2
37+
assert sensor_msg["problem"] == 0
3738
assert sensor_msg["rssi"] == -52
3839

3940
def test_garnet_black_tank(self):
@@ -50,4 +51,5 @@ def test_garnet_black_tank(self):
5051
assert sensor_msg["packet"] == "no packet id"
5152
assert sensor_msg["data"]
5253
assert sensor_msg["black tank"] == 71
54+
assert sensor_msg["problem"] == 0
5355
assert sensor_msg["rssi"] == -52
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
---
2+
manufacturer: Garnet
3+
name: SeeLeveL II 709-BTP3 Tank Monitor
4+
model: SeeLevel II 709-BTP3
5+
image: Garnet_Seelevel_709-BTP3.png
6+
physical_description: Tank Monitor
7+
broadcasted_properties:
8+
- tank
9+
- temperature
10+
- voltage
11+
- rssi
12+
broadcasted_property_notes:
13+
- property: tank
14+
note: Level of the tank in percentage of the total volume
15+
broadcast_rate:
16+
active_scan:
17+
encryption_key: false
18+
custom_firmware:
19+
notes:
20+
- The sensor also broadcasts volume and a total (per tank). These sensors are currently not implemented, as in tests these values stay 0 all the time. If you want to debug these sensors, you can make them visible by enabling debug logging. The values will be logged in the HA logs. Please report back here if these sensors actually report anything, such that we can implement them.
21+
---
31.9 KB
Loading

0 commit comments

Comments
 (0)