Added MQTT api
commit
2892da8005
@ -0,0 +1,81 @@
|
|||||||
|
# API
|
||||||
|
|
||||||
|
* Motion sensor
|
||||||
|
|
||||||
|
Topic: `motion`
|
||||||
|
|
||||||
|
Data example:
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"deviceId": 0,
|
||||||
|
"value": true
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
* Light sensor
|
||||||
|
|
||||||
|
Topic: `light`
|
||||||
|
|
||||||
|
Data example:
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"deviceId": 0,
|
||||||
|
"value": 1024
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
* Temperature sensor
|
||||||
|
|
||||||
|
Topic: `temperature`
|
||||||
|
|
||||||
|
Data example:
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"deviceId": 0,
|
||||||
|
"value": 20.4
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
* Door lock
|
||||||
|
|
||||||
|
Topic: `door/lock/{deviceId}/lock`
|
||||||
|
|
||||||
|
* Door unlocklock
|
||||||
|
|
||||||
|
Topic: `door/lock/{deviceId}/unlock`
|
||||||
|
|
||||||
|
* Door state changed
|
||||||
|
|
||||||
|
Topic: `door/status/{deviceId}`
|
||||||
|
|
||||||
|
Data example:
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"deviceId": 0,
|
||||||
|
"open": true
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
* Alarm state
|
||||||
|
|
||||||
|
Topic: `alarm/state`
|
||||||
|
|
||||||
|
Statuses:
|
||||||
|
|
||||||
|
- `Armed`
|
||||||
|
- `Disarmed`
|
||||||
|
- `Triggered`
|
||||||
|
- `Arming`
|
||||||
|
- `Disarming`
|
||||||
|
|
||||||
|
Data example:
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"status": "Disarmed"
|
||||||
|
}
|
||||||
|
```
|
||||||
Loading…
Reference in New Issue