Skip to main content
Version: 1.0

CB

The CB component monitors voltage and handles a circuit breaker lever. It uses CB as RPC namespace and provides the methods:

CB components are identified with cb:<id> in objects containing multiple component payloads.

Methods:

CB.SetConfig

PropertyTypeDescription

id

number

Id of the CB component instance

config

object

Configuration that the method takes

Find more about the config properties in config section

CB.GetConfig

Parameters:

PropertyTypeDescription

id

number

Id of the CB component instance

Find the CB.GetConfig response properties in config section

CB.GetStatus

Parameters:

PropertyTypeDescription

id

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:

PropertyTypeDescription

id

number

Id of the CB component instance. Required

output

boolean

false to disengage the breaker. Required

info
  • output: only accepts false, otherwise an error is returned. The breaker lever can not be engaged remotely!

CB.GetLog

Parameters:

PropertyTypeDescription

id

number

Id of the CB component instance

after

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:

PropertyTypeDescription

id

number

Id of the CB component instance

name

string or null

Name of the CB instance

undervoltage_limit

number

Limit (in Volts) under which undervoltage condition occurs

voltage_limit

number

Limit (in Volts) over which overvoltage condition occurs

reaction_delay

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:

PropertyTypeDescription

id

number

Id of the CB component instance

output

boolean

True if the breaker is engaged, false otherwise

source

string

Source of the last command, for example: init, WS_in, http, ...

total_cycles

number

Counter how many times breaker was disengaged

temperature

object

Information about the temperature (shown if applicable)

PropertyTypeDescription

tC

number or null

Temperature in Celsius (null if temperature is out of the measurement range)

tF

number or null

Temperature in Fahrenheit (null if temperature is out of the measurement range)

errors

array of type string

Error conditions occurred. May contain overtemp, overvoltage:voltmeter_id, undervoltage:voltmeter_id, lever (shown if at least one error is present)

LogRecords

Response of CB.GetLog is packed as json object with single member records which contains list with last 50 activity records.

PropertyTypeDescription

records

array of type object

List with last 50 activity records

Activity record:

PropertyTypeDescription

ts

number

Unix timestamp (in UTC), Device uptime when time is not synced from NTP server.

output

boolean

Breaker lever state. true for engaged breaker lever, otherwise false

source

string

Source of the activity, for example: init, WS_in, http, ...

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 from false to true
  • cb.off - produced when the output changes its state from true to false
  • cb.undervoltage - produced when voltage on one of the channels is under undervoltage_limit for period of reaction_delay seconds
  • cb.overvoltage - produced when voltage on one of the channels is over voltage_limit for period of reaction_delay seconds

Examples

CB.SetConfig example

http://192.168.33.1/rpc/CB.SetConfig?id=0&config={"name":"CB0"}

Response

{
"restart_required": false
}

CB.GetConfig example

http://192.168.33.1/rpc/CB.GetConfig?id=0

Response

{
"id": 0,
"name": null,
"undervoltage_limit": 200,
"voltage_limit": 300,
"reaction_delay": 5
}

CB.GetStatus example

http://192.168.33.1/rpc/CB.GetStatus?id=0

Response

{
"id": 0,
"output": false,
"source": "init",
"total_cycles": 1,
"temperature": {
"tC": 39.4,
"tF": 102.8
}
}

CB.Set example

http://192.168.33.1/rpc/CB.Set?id=0&output=false

Response

{
"was_on": false
}

CB.GetLog example

http://192.168.33.1/rpc/CB.GetLog?id=0&after=1751389921

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"
}
]
}