Skip to main content
Version: 0.14

Voltmeter

The Voltmeter component handles the monitoring of device's voltmeter sensors. Voltmeter components are identified with voltmeter:<id> in objects containing multiple component payloads.

The Voltmeter component uses Voltmeter as RPC namespace and implements the minimal component interface:

Methods

Voltmeter.SetConfig

Properties:

PropertyTypeDescription

id

number

Id of the Voltmeter component instance

config

object

Configuration that the method takes

Find more about the config properties in config section

Voltmeter.GetConfig

Properties:

PropertyTypeDescription

id

number

Id of the Voltmeter component instance

Find the Voltmeter.GetConfig response properties in config section

Voltmeter.GetStatus

Properties:

PropertyTypeDescription

id

number

Id of the Voltmeter component instance

Find more about the status response properties in status section

Configuration

The configuration of the Voltmeter component allows to adjust the voltage report threshold value. To Get/Set the configuration of the Voltmeter component its id must be specified.

Properties:

PropertyTypeDescription

id

number

Id of the Voltmeter component instance

name

string or null

Name of the Voltmeter instance. name length should not exceed 64 chars

report_thr

number

Voltmeter report threshold in volts. Accepted range is device-specific

Status

The status of the Voltmeter component represents the measurement of the associated voltmeter sensor. To obtain the status of the Voltmeter component its id must be specified.

PropertyTypeDescription

id

number

Id of the Voltmeter component instance

voltage

number or null

Voltage in volts (null if valid value could not be obtained)

errors

array of type string

Shown only if at least one error is present. May contain out_of_range, read when there is problem reading sensor

Webhook Events

There are two events related to the Voltmeter component that can trigger webhooks:

  • voltmeter.change - produced when voltage delta between two measurements is greater than report_thr
  • voltmeter.measurement - produced on a monotonic measurement period (60s)

voltmeter.change and voltmeter.measurement support one attribute, that can be used to compose conditional webhooks:

PropertyTypeDescription

voltage

number

New voltage

Examples

Voltmeter.SetConfig example

http://192.168.33.1/rpc/Voltmeter.SetConfig?id=0&config={"name":"Voltmeter0","report_thr":2.5}

Response

{
"restart_required": false
}

Voltmeter.GetConfig example

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

Response

{
"id": 0,
"name": null,
"report_thr": 2.5
}

Voltmeter.GetStatus example

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

Response

{
"id": 0,
"voltage": 3.5
}