sensor_gas
Gas 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 gas sensors must have them.
Function | Mandatory? | Description |
alarm_mute | Is the sound alert turned off when the sensor is triggered | |
battery_low_power | Battery low or not | |
battery_percentage | Batter charge level | |
gas_leak_state | ✔︎ | Whether a gas leak detected |
online | ✔︎ | Device availability: offline or online |
sensor_sensitive | Sensor sensitivity | |
signal_strength | Signal strength |
Gas sensor model description example
The model is described according to the model structure. The example describes a sensor that can report gas detection, signal strength, sound alert setting, battery level and whether the battery is low. Also supports changing the sensitivity level.
In addition, the model changed has available values for the signal_strength
function (signal strength): this model supports only two levels of signal strength. The average medium
level is not supported and is excluded.
{
"id": "QWERTY124",
"manufacturer": "Xiaqara",
"model": "SM1123456789",
"hw_version": "3.1",
"sw_version": "5.6",
"description": "Xiaqara smart gas sensor",
"category": "sensor_gas",
"features": [
"alarm_mute",
"battery_low_power",
"battery_percentage",
"gas_leak_state",
"online",
"sensor_sensitive",
"signal_strength",
],
"allowed_values": {
"signal_strength": {
"type": "ENUM",
"enum_values": {
"values": [
"low",
"high",
]
}
}
}
}
User's gas sensor description example
The device is described according to the device structure. There is no description of the sensor model in the example — we assume that the models are described separately, so it is enough to specify only the model ID (here — QWERTY124).
The sensor has parent_id
specified - the ID of the hub through which the sensor is connected to the smart home.
{
"id": "ABCD_004",
"parent_id": "A_002",
"name": "My gas sensor",
"default_name": "Smart gas sensor",
"nicknames": ["Leak detector", "Alarm"],
"home": "My home",
"room": "Hallway",
"model_id": "QWERTY124",
"hw_version": "3.1",
"sw_version": "5.6",
"partner_meta": {
"internal-id": 1234,
"specificity": "microchip 2A"
},
}