BTHomeControl
The BTHomeControl
component maintains mapping between Shelly BLU devices and outputs of Shelly WiFi device.
BTHomeControl.StartLearning
with input_id
parameter starts process of adding BLU device and maps its buttons to outputs like Switch, Cover or Light components.
Other way of starting process is triggering 4 times desired Input which corresponds to Output.
During process of creating mapping Shelly WiFi device has following indication of outputs:
- 1 blink/movement - Learn mode is enabled.
- 2 times blink/movement - a BLU device has been added or it already exists and it is seen that it is in pair mode. Now it is possible to add or remove mapping by pressing button on BLU device.
- 3 times blink/movement - mapping has been successfully added.
There might be device specific sequence of pressing Input or indicating.
BTHomeControl
component uses BTHomeControl
as RPC namespace and has the following methods:
BTHomeControl.List
List added mappingsBTHomeControl.DeleteAll
Delete one or all BTHomeControl componentsBTHomeControl.StartLearning
Start process of adding mappingsBTHomeControl.StopLearning
Stop process of adding mappings
Devices which supports BTHomecontrol:
With Switch component
- Pro2
- Pro 2 PM
- Pro3
- Pro 4 PM
- 2L Gen3
- 1 Gen3
- 1 Gen4
- 1 PM Gen3
- 1 PM Gen4
- 2 PM Gen3
- 1 Mini Gen3
- 1 Mini Gen4
- 1 PM Mini Gen3
- 1 PM Mini Gen4
- Ogemray 25A
With Cover component
With Light component
- Pro Dimmer 1 PM
- Pro Dimmer 2 PM
- Pro Dimmer 0/1-10V PM
- Pro RGBWW PM
- Dimmer Gen3
- Dimmer 0/1-10V PM Gen3
- D Dimmer
Methods
BTHomeControl.List
This method returns a list with mappings between BLU device buttons and device output.
Request
Parameters:
Property | Type | Description |
---|---|---|
| number | Id of the component instance |
Response
Attributes in the result:
Property | Type | Description | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| number | Id of the component instance | |||||||||||||||
| string | Output component key in the format | |||||||||||||||
| array of objects | Each entry is a object
|
offset
number
Index of the first BTHomeDevice component key in inputs array
total
number
Total number of BTHomeDevice component keys in inputs array
Possible values for event
:
single_push
double_push
triple_push
rotate_left
rotate_right
hold_press
Note: for BLU Devices with channel support event will be single_push@2
for channel 2.
Possible values for action
:
close
,open
,cycle
,step_up
,step_down
For output of type Coveron
,off
,toggle
For output of type Switchdim_up
,dim_down
,toggle
For output of type Light
BTHomeControl.StartLearning
Properties:
Property | Type | Description |
---|---|---|
| number | Id of the Input component |
Starts process of adding mapping. If Bluetooth on Shelly WiFi device is disabled will be enabled. When mapping is added successfully, Bluetooth will stay enabled, otherwise will be disabled
BTHomeControl.StopLearning
Stops process of learning.
BTHomeControl.DeleteAll
Property | Type | Description |
---|---|---|
| number | Id of the component instance |
When id
is given BTHomeControl
component with given id
is removed. Without id
all BTHomeControl
components will be deleted.
Examples
BTHomeControl.List example
- BTHomeControl.List HTTP GET Request
- BTHomeControl.List Curl Request
- BTHomeControl.List Mos Request
http://192.168.33.1/rpc/BTHomeControl.List?id=200
curl -X POST -d '{"id":1,"method":"BTHomeControl.List","params":{"id":200}}' http://${SHELLY}/rpc
mos --port ${PORT} call BTHomeControl.List '{"id":200}'
Response
- BTHomeControl.List HTTP GET Response
- BTHomeControl.List Curl Response
- BTHomeControl.List Mos Response
{
"id": 200,
"output": "switch:0",
"inputs": [
{
"bthomedevice:200": {
"58:0": {
"single_push": {
"action": "on"
}
},
"58:1": {
"single_push": {
"action": "off"
}
}
}
},
{
"bthomedevice:201": {
"58:0": {
"single_push": {
"action": "toggle"
}
}
}
}
],
"offset": 0,
"total": 2
}
{
"id": 1,
"src": "shelly1pmg3-84fce73fe000",
"params": {
"id": 200,
"output": "switch:0",
"inputs": [
{
"bthomedevice:200": {
"58:0": {
"single_push": {
"action": "on"
}
},
"58:1": {
"single_push": {
"action": "off"
}
}
}
},
{
"bthomedevice:201": {
"58:0": {
"single_push": {
"action": "toggle"
}
}
}
}
],
"offset": 0,
"total": 2
}
}
{
"id": 200,
"output": "switch:0",
"inputs": [
{
"bthomedevice:200": {
"58:0": {
"single_push": {
"action": "on"
}
},
"58:1": {
"single_push": {
"action": "off"
}
}
}
},
{
"bthomedevice:201": {
"58:0": {
"single_push": {
"action": "toggle"
}
}
}
}
],
"offset": 0,
"total": 2
}
BTHomeControl.StartLearning example
- BTHomeControl.StartLearning HTTP GET Request
- BTHomeControl.StartLearning Curl Request
- BTHomeControl.StartLearning Mos Request
http://192.168.33.1/rpc/BTHomeControl.StartLearning?input_id=2
curl -X POST -d '{"id":1,"method":"BTHomeControl.StartLearning","params":{"input_id":2}}' http://${SHELLY}/rpc
mos --port ${PORT} call BTHomeControl.StartLearning '{"input_id":2}'
Response
- BTHomeControl.StartLearning HTTP GET Response
- BTHomeControl.StartLearning Curl Response
- BTHomeControl.StartLearning Mos Response
{}
{
"id": 1,
"src": "shelly1pmg3-84fce73fe000",
"params": {}
}
{}
BTHomeControl.StopLearning example
- BTHomeControl.StopLearning HTTP GET Request
- BTHomeControl.StopLearning Curl Request
- BTHomeControl.StopLearning Mos Request
http://192.168.33.1/rpc/BTHomeControl.StopLearning
curl -X POST -d '{"id":1,"method":"BTHomeControl.StopLearning"}' http://${SHELLY}/rpc
mos --port ${PORT} call BTHomeControl.StopLearning
Response
- BTHomeControl.StopLearning HTTP GET Response
- BTHomeControl.StopLearning Curl Response
- BTHomeControl.StopLearning Mos Response
{}
{
"id": 1,
"src": "shelly1pmg3-84fce73fe000",
"params": {}
}
{}
BTHomeControl.DeleteAll example
- BTHomeControl.DeleteAll HTTP GET Request
- BTHomeControl.DeleteAll Curl Request
- BTHomeControl.DeleteAll Mos Request
http://192.168.33.1/rpc/BTHomeControl.DeleteAll?id=200
curl -X POST -d '{"id":1,"method":"BTHomeControl.DeleteAll","params":{"id":200}}' http://${SHELLY}/rpc
mos --port ${PORT} call BTHomeControl.DeleteAll '{"id":200}'
Response
- BTHomeControl.DeleteAll HTTP GET Response
- BTHomeControl.DeleteAll Curl Response
- BTHomeControl.DeleteAll Mos Response
{}
{
"id": 1,
"src": "shelly1pmg3-84fce73fe000",
"params": {}
}
{}