BTHomeSensor
The BTHomeSensor
component stands for a single sensor/object from a BTHomeDevice. It uses BTHomeSensor
as RPC namespace and has the following methods:
BTHomeSensor.SetConfig
to update the component's configurationBTHomeSensor.GetConfig
to obtain the component's configurationBTHomeSensor.GetStatus
to obtain the component's status
BTHomeSensor.SetConfig
Property | Type | Description |
---|---|---|
| number | Id of the component instance |
| object | Configuration that the method takes |
Find more about the config properties in config section
BTHomeSensor.GetConfig
Properties:
Property | Type | Description |
---|---|---|
| number | Id of the component instance |
Find the BTHomeSensor.GetConfig response properties in config section
BTHomeSensor.GetStatus
Properties:
Property | Type | Description |
---|---|---|
| number | Id of the component instance |
Find more about the status response properties in status section
Configuration
The configuration of the BTHomeSensor component contains information about the device's mac address, display name, id, and meta data, object id and object index. To Get/Set the configuration of the BTHomeSensor component its id
must be specified.
Properties:
Property | Type | Description | ||||||
---|---|---|---|---|---|---|---|---|
| number | Id of the component instance | ||||||
| string or null | Name of the component instance | ||||||
| number | BTHome object id in decimal | ||||||
| number | BTHome object index | ||||||
| string | MAC address of the physical device (a BTHomeDevice must be added first) | ||||||
| object | Object for storing meta data |
| object | Properties of how the component will be rendered in the UI |
| string or null | Allows setting custom icon for the component's card by providing an external hosted image via link. |
Status
The status of the BTHomeSensor component contains information about its id, the sensor value and a timestamp for when the value is received. To obtain the status of the BTHomeSensor component its id
must be specified.
Properties:
Property | Type | Description |
---|---|---|
| number | Id of the component instance |
| number, string or boolean | Latest sensor value |
| number | Unix timestamp of the latest received value |
Webhook Events
Available events from BTHomeSensor
component that can trigger webhooks:
bthomesensor.value_change
- produced when the value changes, supported for BTHomeSensor of typesensor
.bthomesensor.state_change
- produced when the value changes, supported for BTHomeSensor of typebinary_sensor
.bthomesensor.single_push
- produced when the value changes, supported for BTHomeSensor of typebutton
.bthomesensor.double_push
- produced when the value changes, supported for BTHomeSensor of typebutton
.bthomesensor.triple_push
- produced when the value changes, supported for BTHomeSensor of typebutton
.bthomesensor.long_push
- produced when the value changes, supported for BTHomeSensor of typebutton
.bthomesensor.long_double_push
- produced when the value changes, supported for BTHomeSensor of typebutton
.bthomesensor.long_triple_push
- produced when the value changes, supported for BTHomeSensor of typebutton
.bthomesensor.rotate_left
- produced when the value changes, supported for BTHomeSensor of typedimmer
.bthomesensor.rotate_right
- produced when the value changes, supported for BTHomeSensor of typedimmer
.
The sensor type can be checked using BTHome.GetObjectInfos method.
Examples
BTHomeSensor.SetConfig example
- BTHomeSensor.SetConfig HTTP GET Request
- BTHomeSensor.SetConfig Curl Request
- BTHomeSensor.SetConfig Mos Request
http://192.168.33.1/rpc/BTHomeSensor.SetConfig?id=200&config={"name":"Door status","obj_id":45}
curl -X POST -d '{"id":1,"method":"BTHomeSensor.SetConfig","params":{"id":200,"config":{"name":"Door status","obj_id":45}}}' http://${SHELLY}/rpc
mos --port ${PORT} call BTHomeSensor.SetConfig '{"id":200,"config":{"name":"Door status","obj_id":45}}'
Response
- BTHomeSensor.SetConfig HTTP GET Response
- BTHomeSensor.SetConfig Curl Response
- BTHomeSensor.SetConfig Mos Response
{
"restart_required": false
}
{
"id": 1,
"src": "shelly1pmminig3-84fce63fe000",
"params": {
"restart_required": false
}
}
{
"restart_required": false
}
BTHomeSensor.GetConfig example
- BTHomeSensor.GetConfig HTTP GET Request
- BTHomeSensor.GetConfig Curl Request
- BTHomeSensor.GetConfig Mos Request
http://192.168.33.1/rpc/BTHomeSensor.GetConfig?id=200
curl -X POST -d '{"id":1,"method":"BTHomeSensor.GetConfig","params":{"id":200}}' http://${SHELLY}/rpc
mos --port ${PORT} call BTHomeSensor.GetConfig '{"id":200}'
Response
- BTHomeSensor.GetConfig HTTP GET Response
- BTHomeSensor.GetConfig Curl Response
- BTHomeSensor.GetConfig Mos Response
{
"id": 200,
"addr": "3c:2e:f5:71:d5:2a",
"name": "Door status",
"meta": null,
"obj_id": 45,
"idx": 3
}
{
"id": 1,
"src": "shelly1pmminig3-84fce63fe000",
"params": {
"id": 200,
"addr": "3c:2e:f5:71:d5:2a",
"name": "Door status",
"meta": null,
"obj_id": 45,
"idx": 3
}
}
{
"id": 200,
"addr": "3c:2e:f5:71:d5:2a",
"name": "Door status",
"meta": null,
"obj_id": 45,
"idx": 3
}
BTHomeSensor.GetStatus example
- BTHomeSensor.GetStatus HTTP GET Request
- BTHomeSensor.GetStatus Curl Request
- BTHomeSensor.GetStatus Mos Request
http://192.168.33.1/rpc/BTHomeSensor.GetStatus?id=200
curl -X POST -d '{"id":1,"method":"BTHomeSensor.GetStatus","params":{"id":200}}' http://${SHELLY}/rpc
mos --port ${PORT} call BTHomeSensor.GetStatus '{"id":200}'
Response
- BTHomeSensor.GetStatus HTTP GET Response
- BTHomeSensor.GetStatus Curl Response
- BTHomeSensor.GetStatus Mos Response
{
"id": 200,
"value": false,
"last_updated_ts": 1706593991.91
}
{
"id": 1,
"src": "shelly1pmminig3-84fce63fe000",
"params": {
"id": 200,
"value": false,
"last_updated_ts": 1706593991.91
}
}
{
"id": 200,
"value": false,
"last_updated_ts": 1706593991.91
}