BTHomeDevice
The BTHomeDevice
component stands for an individual physical device identified by its MAC address. It uses BTHomeDevice
as RPC namespace and has the following methods:
BTHomeDevice.SetConfig
to update the component's configurationBTHomeDevice.GetConfig
to obtain the component's configurationBTHomeDevice.GetStatus
to obtain the component's statusBTHomeDevice.GetKnownObjects
get a list of the known object ids from the device's packets
Methods
BTHomeDevice.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
BTHomeDevice.GetConfig
Properties:
Property | Type | Description |
---|---|---|
| number | Id of the component instance |
Find the BTHomeDevice.GetConfig response properties in config section
BTHomeDevice.GetStatus
Properties:
Property | Type | Description |
---|---|---|
| number | Id of the component instance |
Find more about the status response properties in status section
BTHomeDevice.GetKnownObjects
Request
Parameters:
Property | Type | Description |
---|---|---|
| number | Id of the component instance. Required |
The new_objects
event is triggered upon the discovery of a new sensor. See example event at new_objects
example.
Response
Attributes in the result:
Property | Type | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| number | Id of the component instance | ||||||||||||
| array of objects |
|
Configuration
The configuration of the BTHomeDevice component contains information about its MAC address, display name, id, and meta data. To Get/Set the configuration of the BTHomeDevice component its id
must be specified.
Properties:
Property | Type | Description | ||||||
---|---|---|---|---|---|---|---|---|
| number | Id of the component instance | ||||||
| string or null | Name of the component instance | ||||||
| string | MAC address of the physical device | ||||||
| string or null | AES encryption key as hexadecimal string for encrypted devices | ||||||
| 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 BTHomeDevice component contains information about its id, signal strength received with the latest packet, battery percentage of the device, the last packet id and a timestamp for when the packet is received. To obtain the status of the BTHomeDevice component its id
must be specified.
Properties:
Property | Type | Description |
---|---|---|
| number | Id of the component instance |
| number or null | Strength of the signal in dBms from the latest packet |
| number or null | Device's battery percentage |
| number or null | Id of the latest received packet |
| number | Unix timestamp of the latest received packet |
| array of type string | Component error conditions. May contain |
Examples
BTHomeDevice.SetConfig example
- BTHomeDevice.SetConfig HTTP GET Request
- BTHomeDevice.SetConfig Curl Request
- BTHomeDevice.SetConfig Mos Request
http://192.168.33.1/rpc/BTHomeDevice.SetConfig?id=200&config={"name":"Bathroom temperature"}
curl -X POST -d '{"id":1,"method":"BTHomeDevice.SetConfig","params":{"id":200,"config":{"name":"Bathroom temperature"}}}' http://${SHELLY}/rpc
mos --port ${PORT} call BTHomeDevice.SetConfig '{"id":200,"config":{"name":"Bathroom temperature"}}'
Response
- BTHomeDevice.SetConfig HTTP GET Response
- BTHomeDevice.SetConfig Curl Response
- BTHomeDevice.SetConfig Mos Response
{
"restart_required": false
}
{
"id": 1,
"src": "shelly1pmminig3-84fce63fe000",
"params": {
"restart_required": false
}
}
{
"restart_required": false
}
BTHomeDevice.GetConfig example
- BTHomeDevice.GetConfig HTTP GET Request
- BTHomeDevice.GetConfig Curl Request
- BTHomeDevice.GetConfig Mos Request
http://192.168.33.1/rpc/BTHomeDevice.GetConfig?id=200
curl -X POST -d '{"id":1,"method":"BTHomeDevice.GetConfig","params":{"id":200}}' http://${SHELLY}/rpc
mos --port ${PORT} call BTHomeDevice.GetConfig '{"id":200}'
Response
- BTHomeDevice.GetConfig HTTP GET Response
- BTHomeDevice.GetConfig Curl Response
- BTHomeDevice.GetConfig Mos Response
{
"id": 200,
"addr": "3c:2e:f5:71:d5:2a",
"name": "Bathroom temperature",
"key": null,
"meta": null
}
{
"id": 1,
"src": "shelly1pmminig3-84fce63fe000",
"params": {
"id": 200,
"addr": "3c:2e:f5:71:d5:2a",
"name": "Bathroom temperature",
"key": null,
"meta": null
}
}
{
"id": 200,
"addr": "3c:2e:f5:71:d5:2a",
"name": "Bathroom temperature",
"key": null,
"meta": null
}
BTHomeDevice.GetStatus example
- BTHomeDevice.GetStatus HTTP GET Request
- BTHomeDevice.GetStatus Curl Request
- BTHomeDevice.GetStatus Mos Request
http://192.168.33.1/rpc/BTHomeDevice.GetStatus?id=200
curl -X POST -d '{"id":1,"method":"BTHomeDevice.GetStatus","params":{"id":200}}' http://${SHELLY}/rpc
mos --port ${PORT} call BTHomeDevice.GetStatus '{"id":200}'
Response
- BTHomeDevice.GetStatus HTTP GET Response
- BTHomeDevice.GetStatus Curl Response
- BTHomeDevice.GetStatus Mos Response
{
"id": 200,
"rssi": -55,
"battery": 100,
"packet_id": 1,
"last_updated_ts": 1706593991.91
}
{
"id": 1,
"src": "shelly1pmminig3-84fce63fe000",
"params": {
"id": 200,
"rssi": -55,
"battery": 100,
"packet_id": 1,
"last_updated_ts": 1706593991.91
}
}
{
"id": 200,
"rssi": -55,
"battery": 100,
"packet_id": 1,
"last_updated_ts": 1706593991.91
}
BTHomeDevice.GetKnownObjects example
- BTHomeDevice.GetKnownObjects HTTP GET Request
- BTHomeDevice.GetKnownObjects Curl Request
- BTHomeDevice.GetKnownObjects Mos Request
http://192.168.33.1/rpc/BTHomeDevice.GetKnownObjects?id=200
curl -X POST -d '{"id":1,"method":"BTHomeDevice.GetKnownObjects","params":{"id":200}}' http://${SHELLY}/rpc
mos --port ${PORT} call BTHomeDevice.GetKnownObjects '{"id":200}'
Response
- BTHomeDevice.GetKnownObjects HTTP GET Response
- BTHomeDevice.GetKnownObjects Curl Response
- BTHomeDevice.GetKnownObjects Mos Response
{
"id": 200,
"objects": [
{
"obj_id": 5,
"idx": 3,
"component": "bthomesensor:200"
}
]
}
{
"id": 1,
"src": "shelly1pmminig3-84fce63fe000",
"params": {
"id": 200,
"objects": [
{
"obj_id": 5,
"idx": 3,
"component": "bthomesensor:200"
}
]
}
}
{
"id": 200,
"objects": [
{
"obj_id": 5,
"idx": 3,
"component": "bthomesensor:200"
}
]
}
Events
new_objects
example
{
"component": "bthomedevice:200",
"id": 200,
"event": "new_objects",
"ts": 1706593991.91
}