CB
The CB component monitors voltage and handles a circuit breaker lever. It uses CB as RPC namespace and provides the methods:
CB.GetConfigto obtain the component's configurationCB.SetConfigto update the component's configurationCB.GetStatusto obtain the component's statusCB.Setto control the output stateCB.GetLogsto get last saved 50 activities
CB components are identified with cb:<id> in objects containing multiple component payloads.
Methods:
CB.SetConfig
| Property | Type | Description |
|---|---|---|
| number | Id of the CB component instance |
| object | Configuration that the method takes |
Find more about the config properties in config section
CB.GetConfig
Parameters:
| Property | Type | Description |
|---|---|---|
| number | Id of the CB component instance |
Find the CB.GetConfig response properties in config section
CB.GetStatus
Parameters:
| Property | Type | Description |
|---|---|---|
| number | Id of the CB component instance |
Find more about the status response properties in status section
CB.Set
This method sets the output of the CB component to OFF (breaker lever disengaged). It can be used to trigger webhooks. More information about the events triggering webhooks available for this component can be found below.
Request
Parameters:
| Property | Type | Description |
|---|---|---|
| number | Id of the CB component instance. Required |
| boolean |
|
output: only acceptsfalse, otherwise an error is returned. The breaker lever can not be engaged remotely!
CB.GetLog
Parameters:
| Property | Type | Description |
|---|---|---|
| number | Id of the CB component instance |
| number | Loads logs created after the specified Unix timestamp |
Find more about the get log response properties in log records section
Configuration
The configuration of the CB component contains information about over-/undervoltage protection tresholds and delayed reaction time. To Get/Set the configuration of the CB component its id must be specified.
Parameters:
| Property | Type | Description |
|---|---|---|
| number | Id of the CB component instance |
| string or null | Name of the CB instance |
| number | Limit (in Volts) under which undervoltage condition occurs |
| number | Limit (in Volts) over which overvoltage condition occurs |
| number | Voltage monitor filter time (in seconds) before protection is triggered |
Status
The status of the CB component contains information about breaker lever state, total breaker disengagement cycles and internal temperature. To obtain the status of the CB component its id must be specified.
Parameters:
| Property | Type | Description | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| number | Id of the CB component instance | |||||||||
| boolean | True if the breaker is engaged, false otherwise | |||||||||
| string | Source of the last command, for example: | |||||||||
| number | Counter how many times breaker was disengaged | |||||||||
| object | Information about the temperature (shown if applicable)
| |||||||||
| array of type string | Error conditions occurred. May contain |
LogRecords
Response of CB.GetLog is packed as json object with single member records which contains list with last 50 activity records.
| Property | Type | Description |
|---|---|---|
| array of type object | List with last 50 activity records |
Activity record:
| Property | Type | Description |
|---|---|---|
| number | Unix timestamp (in UTC), Device uptime when time is not synced from NTP server. |
| boolean | Breaker lever state. |
| string | Source of the activity, for example: |
Webhook Events
Currently, there are four events related to the CB component that can trigger webhooks:
cb.on- produced when the output changes its state fromfalsetotruecb.off- produced when the output changes its state fromtruetofalsecb.undervoltage- produced when voltage on one of the channels is underundervoltage_limitfor period ofreaction_delaysecondscb.overvoltage- produced when voltage on one of the channels is overvoltage_limitfor period ofreaction_delayseconds
Examples
CB.SetConfig example
- CB.SetConfig HTTP GET Request
- CB.SetConfig Curl Request
- CB.SetConfig Mos Request
http://192.168.33.1/rpc/CB.SetConfig?id=0&config={"name":"CB0"}
curl -X POST -d '{"id":1,"method":"CB.SetConfig","params":{"id":0,"config":{"name":"CB0"}}}' http://${SHELLY}/rpc
mos --port ${PORT} call CB.SetConfig '{"id":0,"config":{"name":"CB0"}}'
Response
- Switch.SetConfig HTTP GET Response
- Switch.SetConfig Curl Response
- Switch.SetConfig Mos Response
{
"restart_required": false
}
{
"id": 1,
"src": "shellypro3cb-c8f09e8a2bbc",
"params": {
"restart_required": false
}
}
{
"restart_required": false
}
CB.GetConfig example
- CB.GetConfig HTTP GET Request
- CB.GetConfig Curl Request
- CB.GetConfig Mos Request
http://192.168.33.1/rpc/CB.GetConfig?id=0
curl -X POST -d '{"id":1,"method":"CB.GetConfig","params":{"id":0}}' http://${SHELLY}/rpc
mos --port ${PORT} call CB.GetConfig '{"id":0}'
Response
- CB.GetConfig HTTP GET Response
- CB.GetConfig Curl Response
- CB.GetConfig Mos Response
{
"id": 0,
"name": null,
"undervoltage_limit": 200,
"voltage_limit": 300,
"reaction_delay": 5
}
{
"id": 1,
"src": "shellypro3cb-c8f09e8a2bbc",
"params": {
"id": 0,
"name": null,
"undervoltage_limit": 200,
"voltage_limit": 300,
"reaction_delay": 5
}
}
{
"id": 0,
"name": null,
"undervoltage_limit": 200,
"voltage_limit": 300,
"reaction_delay": 5
}
CB.GetStatus example
- CB.GetStatus HTTP GET Request
- CB.GetStatus Curl Request
- CB.GetStatus Mos Request
http://192.168.33.1/rpc/CB.GetStatus?id=0
curl -X POST -d '{"id":1,"method":"CB.GetStatus","params":{"id":0}}' http://${SHELLY}/rpc
mos --port ${PORT} call CB.GetStatus '{"id":0}'
Response
- RGB.GetStatus HTTP GET Response
- RGB.GetStatus Curl Response
- RGB.GetStatus Mos Response
{
"id": 0,
"output": false,
"source": "init",
"total_cycles": 1,
"temperature": {
"tC": 39.4,
"tF": 102.8
}
}
{
"id": 1,
"src": "shellypro3cb-c8f09e8a2bbc",
"params": {
"id": 0,
"output": false,
"source": "init",
"total_cycles": 1,
"temperature": {
"tC": 39.4,
"tF": 102.8
}
}
}
{
"id": 0,
"output": false,
"source": "init",
"total_cycles": 1,
"temperature": {
"tC": 39.4,
"tF": 102.8
}
}
CB.Set example
- CB.Set HTTP GET Request
- CB.Set Curl Request
- CB.Set Mos Request
http://192.168.33.1/rpc/CB.Set?id=0&output=false
curl -X POST -d '{"id":1,"method":"CB.Set","params":{"id":0,"output":false}}' http://${SHELLY}/rpc
mos --port ${PORT} call CB.Set '{"id":0,"output":false}'
Response
- RGB.Set HTTP GET Response
- RGB.Set Curl Response
- RGB.Set Mos Response
{
"was_on": false
}
{
"id": 1,
"src": "shellypro3cb-c8f09e8a2bbc",
"params": {
"was_on": false
}
}
{
"was_on": false
}
CB.GetLog example
- CB.GetLog HTTP GET Request
- CB.GetLog Curl Request
- CB.GetLog Mos Request
http://192.168.33.1/rpc/CB.GetLog?id=0&after=1751389921
curl -X POST -d '{"id":1,"method":"CB.GetLog","params":{"id":0,"after":1751389921}}' http://${SHELLY}/rpc
mos --port ${PORT} call CB.GetLog '{"id":0,"after":1751389921}'
Response
- RGB.Set HTTP GET Response
- RGB.Set Curl Response
- RGB.Set Mos Response
{
"records": [
{
"ts": 1686507478,
"output": true,
"source": "local"
},
{
"ts": 1686507480,
"output": false,
"source": "HTTP_in"
},
{
"ts": 1686507481,
"output": true,
"source": "local"
},
{
"ts": 1686507482,
"output": false,
"source": "local"
}
]
}
{
"id": 1,
"src": "shellypro3cb-c8f09e8a2bbc",
"params": {
"records": [
{
"ts": 1686507478,
"output": true,
"source": "local"
},
{
"ts": 1686507480,
"output": false,
"source": "HTTP_in"
},
{
"ts": 1686507481,
"output": true,
"source": "local"
},
{
"ts": 1686507482,
"output": false,
"source": "local"
}
]
}
}
{
"records": [
{
"ts": 1686507478,
"output": true,
"source": "local"
},
{
"ts": 1686507480,
"output": false,
"source": "HTTP_in"
},
{
"ts": 1686507481,
"output": true,
"source": "local"
},
{
"ts": 1686507482,
"output": false,
"source": "local"
}
]
}