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.ListList added mappingsBTHomeControl.CreateCreate BTHomeControl component with mappingsBTHomeControl.UpdateUpdate BTHomeControl component with mappingsBTHomeControl.DeleteAllDelete one or all BTHomeControl componentsBTHomeControl.StartLearningStart process of adding mappingsBTHomeControl.StopLearningStop process of adding mappingsBTHomeControl.SetConfigto update the component's configurationBTHomeControl.GetConfigto obtain the component's configurationBTHomeControl.GetStatusto obtain the component's statusBTHomeControl.EnumerateShows output components which could be controlled with BTHomeControl.
Devices which supports BTHomecontrol:
With Switch component
- Pro 1
- Pro 1 PM
- Pro 2
- Pro 2 PM
- Pro 3
- Pro 4 PM
- 1L Gen3
- 2L Gen3
- 1 Gen3
- 1 Gen4
- 1 PM Gen3
- 1 PM Gen4
- 2 PM Gen3
- 2 PM Gen4
- 1 Mini Gen3
- 1 Mini Gen4
- 1 PM Mini Gen3
- 1 PM Mini Gen4
- PowerStrip
- Ogemray 25A
- PlugS Gen3
- OutdoorPlugS Gen3
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 Gen4
- Dimmer Gen4 US
- 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_pushdouble_pushtriple_pushrotate_leftrotate_righthold_press
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_downFor output of type Coveron,off,toggleFor output of type Switchon,off,toggle,dim_up,dim_downFor output of type Light
Note: step_up, step_down and dim_up, dim_down actions are used for driving cover and dimming lights by keep button pressed or rotate scroller. Currently supported on BLU Remote Control events rotate_left and rotate_right. Since version 1.0.23 BLU devices with 4 buttons like Wall EU Wall US supports actions on hold_press event.
BTHomeControl.StartLearning
Starts process of adding mapping. Requires one of the parameters input_id or component_key. If Bluetooth on Shelly WiFi device is disabled will be enabled. When mapping is added successfully, Bluetooth will stay enabled, otherwise will be disabled
Request
Parameters:
| Property | Type | Description |
|---|---|---|
| number | Id of the Input component |
| string | Output component key in the format |
Response
The result from calling this method is null on success, otherwise it will return an error.
BTHomeControl.StopLearning
Stops process of learning.
Request
The method takes no parameters.
Response
The result from calling this method is null on success
BTHomeControl.SetConfig
Request
Parameters:
| Property | Type | Description |
|---|---|---|
| number | Id of the component instance |
| object | Configuration that the method takes |
Find more about the config properties in config section
BTHomeControl.GetConfig
Request
Parameters:
| Property | Type | Description |
|---|---|---|
| number | Id of the component instance |
Find the BTHomeControl.GetConfig response properties in config section
BTHomeControl.GetStatus
Request
Parameters:
| Property | Type | Description |
|---|---|---|
| number | Id of the component instance |
Find more about the status response properties in status section
BTHomeControl.Create
Creates BTHomeControl component with given output key and maps Shelly BLU devices inputs to outputs of Shelly WiFi device.
Request
Parameters:
| Property | Type | Description |
|---|---|---|
| string | Output component key in the format |
| array of objects | See - |
Response
The result from calling this method is a JSON object, with an id on success, otherwise it will return an error.
BTHomeControl.Update
Updates BTHomeControl with given id with output key and maps Shelly BLU devices inputs to outputs of Shelly WiFi device.
Request
Parameters:
| Property | Type | Description |
|---|---|---|
| number | Id of the component instance. Required |
| string | Output component key in the format |
| array of objects | See - |
Response
The result from calling this method is null on success, otherwise it will return an error.
BTHomeControl.DeleteAll
When id is given BTHomeControl component with given id is removed. Without id all BTHomeControl components will be deleted.
Request
Parameters:
| Property | Type | Description |
|---|---|---|
| number | Id of the component instance |
Response
The result from calling this method is null on success, otherwise it will return an error.
BTHomeControl.Enumerate
Shows which outputs could be controlled with BTHomeControl. When there are no BTHomeControl components result will be null
Request
The method takes no parameters.
Response
| Property | Type | Description |
|---|---|---|
| string | Key is component key in the format |
Configuration
The configuration of the BTHomeControl component contains information about how cover is controlled by BLU Remote. To Get/Set the configuration of the BTHomeControl component its id must be specified.
Parameters:
| Property | Type | Description |
|---|---|---|
| number | Id of the component instance |
| number | Cover control mode by BLU Remote. Applicable only when BTHomeControl has output_key of type Cover
|
Status
The status of the BTHomeControl component contains information about learn progress when procedure of creating mapping between Shelly BLU devices and outputs of Shelly WiFi device has been started. To obtain the status of the BTHomeControl component its id must be specified.
Parameters:
| Property | Type | Description | ||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| number | Id of the component instance | ||||||||||||||||||||||||
| object | Information about the learning progress, only presented when Learn procedure is started with
|
learning.stage could be one of following: pairing, press, done, remove, and error.
pairing- when Shelly WiFi device is looking for BLU devicepress- after Shelly WiFi device found and added BLU device and it is ready to accept user press on button of BLU devicedone- when successfull mapping is created between Shelly WiFi device and BLU deviceremove- when mapping is removederror- when there is an error
| learning.err.code | learning.err.msg |
|---|---|
| 1 | Internal Error |
| 2 | Pairing timeout |
| 3 | Press timeout |
| 4 | Stopped by input |
| 5 | Stopped by RPC |
| 6 | Bluetooth is disabled |
| 7 | BLU device is not button type |
| 8 | No BLU devices found |
| 9 | Event received from wrong device |
| any other | Unknown error |
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
null
{
"id": 1,
"src": "shelly1pmg3-84fce73fe000",
"params": null
}
null
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
null
{
"id": 1,
"src": "shelly1pmg3-84fce73fe000",
"params": null
}
null
BTHomeControl.SetConfig example
- BTHomeControl.SetConfig HTTP GET Request
- BTHomeControl.SetConfig Curl Request
- BTHomeControl.SetConfig Mos Request
http://192.168.33.1/rpc/BTHomeControl.SetConfig?id=200&config={"blu_remote_cover_mode":0}
curl -X POST -d '{"id":1,"method":"BTHomeControl.SetConfig","params":{"id":200,"config":{"blu_remote_cover_mode":0}}}' http://${SHELLY}/rpc
mos --port ${PORT} call BTHomeControl.SetConfig '{"id":200,"config":{"blu_remote_cover_mode":0}}'
Response
- BTHomeControl.SetConfig HTTP GET Response
- BTHomeControl.SetConfig Curl Response
- BTHomeControl.SetConfig Mos Response
{
"restart_required": false
}
{
"id": 1,
"src": "shelly1pmg3-84fce73fe000",
"params": {
"restart_required": false
}
}
{
"restart_required": false
}
BTHomeControl.GetConfig example
- BTHomeControl.GetConfig HTTP GET Request
- BTHomeControl.GetConfig Curl Request
- BTHomeControl.GetConfig Mos Request
http://192.168.33.1/rpc/BTHomeControl.GetConfig?id=200
curl -X POST -d '{"id":1,"method":"BTHomeControl.GetConfig","params":{"id":200}}' http://${SHELLY}/rpc
mos --port ${PORT} call BTHomeControl.GetConfig '{"id":200}'
Response
- BTHomeControl.GetConfig HTTP GET Response
- BTHomeControl.GetConfig Curl Response
- BTHomeControl.GetConfig Mos Response
{
"id": 200,
"blu_remote_cover_mode": "0"
}
{
"id": 1,
"src": "shelly1pmg3-84fce73fe000",
"params": {
"id": 200,
"blu_remote_cover_mode": "0"
}
}
{
"id": 200,
"blu_remote_cover_mode": "0"
}
BTHomeControl.GetStatus example
- BTHomeControl.GetStatus HTTP GET Request
- BTHomeControl.GetStatus Curl Request
- BTHomeControl.GetStatus Mos Request
http://192.168.33.1/rpc/BTHomeControl.GetStatus?id=200
curl -X POST -d '{"id":1,"method":"BTHomeControl.GetStatus","params":{"id":200}}' http://${SHELLY}/rpc
mos --port ${PORT} call BTHomeControl.GetStatus '{"id":200}'
Response
- BTHomeControl.GetStatus HTTP GET Response
- BTHomeControl.GetStatus Curl Response
- BTHomeControl.GetStatus Mos Response
{
"learning": {
"stage": "pairing",
"err": null,
"ts": 1751280234.92,
"duration": 60
}
}
{
"id": 1,
"src": "shelly1pmg3-84fce73fe000",
"params": {
"learning": {
"stage": "pairing",
"err": null,
"ts": 1751280234.92,
"duration": 60
}
}
}
{
"learning": {
"stage": "pairing",
"err": null,
"ts": 1751280234.92,
"duration": 60
}
}
BTHomeControl.Create example
- BTHomeControl.Create HTTP GET Request
- BTHomeControl.Create Curl Request
- BTHomeControl.Create Mos Request
http://192.168.33.1/rpc/BTHomeControl.Create?output="switch:0"&inputs=[{"bthomedevice:200":{"58:0":{"single_push":{"action":"on"}},"58:1":{"single_push":{"action":"off"}}}}]
curl -X POST -d '{"id":1,"method":"BTHomeControl.Create","params":{"output":"switch:0","inputs":[{"bthomedevice:200":{"58:0":{"single_push":{"action":"on"}},"58:1":{"single_push":{"action":"off"}}}}]}}' http://${SHELLY}/rpc
mos --port ${PORT} call BTHomeControl.Create '{"output":"switch:0","inputs":[{"bthomedevice:200":{"58:0":{"single_push":{"action":"on"}},"58:1":{"single_push":{"action":"off"}}}}]}'
Response
- BTHomeControl.Create HTTP GET Response
- BTHomeControl.Create Curl Response
- BTHomeControl.Create Mos Response
{
"id": 200
}
{
"id": 1,
"src": "shelly1pmg3-84fce73fe000",
"params": {
"id": 200
}
}
{
"id": 200
}
BTHomeControl.Update example
- BTHomeControl.Update HTTP GET Request
- BTHomeControl.Update Curl Request
- BTHomeControl.Update Mos Request
http://192.168.33.1/rpc/BTHomeControl.Update?id=200&output="switch:1"&inputs=[{"bthomedevice:200":{"58:0":{"single_push":{"action":"off"}}}}]
curl -X POST -d '{"id":1,"method":"BTHomeControl.Update","params":{"id":200,"output":"switch:1","inputs":[{"bthomedevice:200":{"58:0":{"single_push":{"action":"off"}}}}]}}' http://${SHELLY}/rpc
mos --port ${PORT} call BTHomeControl.Update '{"id":200,"output":"switch:1","inputs":[{"bthomedevice:200":{"58:0":{"single_push":{"action":"off"}}}}]}'
Response
- BTHomeControl.Update HTTP GET Response
- BTHomeControl.Update Curl Response
- BTHomeControl.Update Mos Response
null
{
"id": 1,
"src": "shelly1pmg3-84fce73fe000",
"params": null
}
null
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
null
{
"id": 1,
"src": "shelly1pmg3-84fce73fe000",
"params": null
}
null
BTHomeControl.Enumerate example
- BTHomeControl.Enumerate HTTP GET Request
- BTHomeControl.Enumerate Curl Request
- BTHomeControl.Enumerate Mos Request
http://192.168.33.1/rpc/BTHomeControl.Enumerate
curl -X POST -d '{"id":1,"method":"BTHomeControl.Enumerate"}' http://${SHELLY}/rpc
mos --port ${PORT} call BTHomeControl.Enumerate
Response
- BTHomeControl.Enumerate HTTP GET Response
- BTHomeControl.Enumerate Curl Response
- BTHomeControl.Enumerate Mos Response
{
"light:0": 200,
"light:1": 201,
"light:2": 202
}
{
"id": 1,
"src": "shelly1pmg3-84fce73fe000",
"params": {
"light:0": 200,
"light:1": 201,
"light:2": 202
}
}
{
"light:0": 200,
"light:1": 201,
"light:2": 202
}