wellhub_reloaded/main/SENSORDATA.md
2025-06-24 15:18:08 -07:00

81 lines
1.4 KiB
Markdown

# MQTT message structure
## MSG Header
Every message. Total len 18 bytes.
```mermaid
block-beta
T["<b>TIME</b><br>4 bytes<br>seconds"]:2
Tm["<b>TIME</b><br>4 bytes<br>useconds"]:2
MAC["WIFI MAC<br>6 bytes"]:3
GRP["Group id<br>4 bytes"]:2
```
# Block messages
## Radar message
Arrives every 10 seconds. Total len 49 + 18 = 67 bytes
```mermaid
block-beta
MSG_HEADER
B["0x10"]
C["14 uint16<br>motion energy"]
D["10 uint16<br>stationary energy"]
```
<br>
## Sensors message
Arrives every 10 seconds, when gas sensor data has been collected. Total len: 18 + 16 + 5 * number_data_pairs
```mermaid
block-beta
MSG_HEADER:1
B["0x11"]:1
C["Pressure<br>float"]:1
D["Temperature<br>float"]:1
E["light<br>2 bytes"]:1
F["humidity<br>float"]:1
G["Number of data pairs<br>byte"]:1
block:aa:3
H["index 1<br>byte"]
I["gas resistance 1<br>float"]
J["..."]
end
```
<br>
# Notification messages
## Pressure
Total len: 18 + 5 = 23 bytes
```mermaid
block-beta
MSG_HEADER
B["0x01"]
C["value<br>float"]
```
## Temperature
Total len: 18 + 5 = 23 bytes
```mermaid
block-beta
MSG_HEADER
B["0x02"]
C["value<br>float"]
```
## Humidity
Total len: 18 + 5 = 23 bytes
```mermaid
block-beta
MSG_HEADER
B["0x03"]
C["value<br>float"]
```
## Light
Total len: 18 + 3 = 21 bytes
```mermaid
block-beta
MSG_HEADER
B["0x04"]
C["value<br>2 bytes"]
```