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:
Voltmeter.GetConfig
to obtain the component's configurationVoltmeter.SetConfig
to update the component's configurationVoltmeter.GetStatus
to obtain the component's status
Methods
Voltmeter.SetConfig
Properties:
Property | Type | Description |
---|---|---|
| number | Id of the Voltmeter component instance |
| object | Configuration that the method takes |
Find more about the config properties in config section
Voltmeter.GetConfig
Properties:
Property | Type | Description |
---|---|---|
| number | Id of the Voltmeter component instance |
Find the Voltmeter.GetConfig response properties in config section
Voltmeter.GetStatus
Properties:
Property | Type | Description |
---|---|---|
| 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:
Property | Type | Description |
---|---|---|
| number | Id of the Voltmeter component instance |
| string or null | Name of the Voltmeter instance. |
| 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.
Property | Type | Description |
---|---|---|
| number | Id of the Voltmeter component instance |
| number or null | Voltage in volts ( |
| array of type string | Shown only if at least one error is present. May contain |
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 thanreport_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:
Property | Type | Description |
---|---|---|
| number | New voltage |
Examples
Voltmeter.SetConfig example
- Voltmeter.SetConfig HTTP GET Request
- Voltmeter.SetConfig Curl Request
- Voltmeter.SetConfig Mos Request
http://192.168.33.1/rpc/Voltmeter.SetConfig?id=0&config={"name":"Voltmeter0","report_thr":2.5}
curl -X POST -d '{"id":1,"method":"Voltmeter.SetConfig","params":{"id":0,"config":{"name":"Voltmeter0","report_thr":2.5}}}' http://${SHELLY}/rpc
mos --port ${PORT} call Voltmeter.SetConfig '{"id":0,"config":{"name":"Voltmeter0","report_thr":2.5}}'
Response
- Voltmeter.SetConfig HTTP GET Response
- Voltmeter.SetConfig Curl Response
- Voltmeter.SetConfig Mos Response
{
"restart_required": false
}
{
"id": 1,
"params": {
"restart_required": false
}
}
{
"restart_required": false
}
Voltmeter.GetConfig example
- Voltmeter.GetConfig HTTP GET Request
- Voltmeter.GetConfig Curl Request
- Voltmeter.GetConfig Mos Request
http://192.168.33.1/rpc/Voltmeter.GetConfig?id=0
curl -X POST -d '{"id":1,"method":"Voltmeter.GetConfig","params":{"id":0}}' http://${SHELLY}/rpc
mos --port ${PORT} call Voltmeter.GetConfig '{"id":0}'
Response
- Voltmeter.GetConfig HTTP GET Response
- Voltmeter.GetConfig Curl Response
- Voltmeter.GetConfig Mos Response
{
"id": 0,
"name": null,
"report_thr": 2.5
}
{
"id": 1,
"params": {
"id": 0,
"name": null,
"report_thr": 2.5
}
}
{
"id": 0,
"name": null,
"report_thr": 2.5
}
Voltmeter.GetStatus example
- Voltmeter.GetStatus HTTP GET Request
- Voltmeter.GetStatus Curl Request
- Voltmeter.GetStatus Mos Request
http://192.168.33.1/rpc/Voltmeter.GetStatus?id=0
curl -X POST -d '{"id":1,"method":"Voltmeter.GetStatus","params":{"id":0}}' http://${SHELLY}/rpc
mos --port ${PORT} call Voltmeter.GetStatus '{"id":0}'
Response
- Voltmeter.GetStatus HTTP GET Response
- Voltmeter.GetStatus Curl Response
- Voltmeter.GetStatus Mos Response
{
"id": 0,
"voltage": 3.5
}
{
"id": 1,
"params": {
"id": 0,
"voltage": 3.5
}
}
{
"id": 0,
"voltage": 3.5
}