sensor_pir
Motion sensor.
Available device functions
The device can have all the functions listed below or some of them. E.g. if the sensor cannot report the battery charge level, there is no need in including the battery_percentage
function in its model description.
Some functions are mandatory, and all motion sensors must have them.
Function | Mandatory? | Description |
battery_low_power | Battery low or not | |
battery_percentage | Batter charge level | |
online | ✔︎ | Device availability: offline or online |
pir | ✔︎ | Whether movement is detected |
sensor_sensitive | Sensor sensitivity | |
signal_strength | Signal strength |
Motion sensor model description example
The model shall be described in accordance with the model structure. The example describes a sensor that can report the discovered motion, signal strength, battery charge level, and warn if it is low. Besides, its sensitivity level can be adjusted as appropriate.
In addition, the model's allowed values for the sensor_sensitive
function have been changed: it supports only two sensitivity levels. The medium
level is not supported and has been deleted.
{
"id": "QWERTY124",
"manufacturer": "Xiaqara",
"model": "SM1123456789",
"hw_version": "3.1",
"sw_version": "5.6",
"description": "Xiaqara smart motion sensor",
"category": "sensor_pir",
"features": [
"online",
"pir",
"battery_low_power",
"battery_percentage",
"sensor_sensitive",
"signal_strength"
],
"allowed_values": {
"sensor_sensitive": {
"type": "ENUM",
"enum_values": {
"values": [
"auto",
"high"
]
}
}
}
}
User's motion sensor description example
The device shall be describe in accordance with the device structure. The example contains no sensor model description as we believe that models are described independently and the model ID will be enough (in this case, QWERTY124).
For the sensor, parent_id
is indicated – a hub ID through which the sensor is connected to the Smart Home.
{
"id": "ABCD_004",
"parent_id": "A_002",
"name": "My motion sensor",
"default_name": "Smart motion sensor",
"nicknames": ["Infrared sensor", "Motion detector"],
"home": "My home",
"room": "Living room",
"model_id": "QWERTY124",
"hw_version": "3.1",
"sw_version": "5.6",
"partner_meta": {
"internal-id": 1234,
"specificity": "microchip 2A"
},
}