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
Voltmeter.CheckExpression
Request
Property | Type | Description |
---|---|---|
| string | JS expression to evaluate |
| array | Input values on which to apply |
Response
results
or error if any of the request parameters is missing or of the wrong type
Property | Type | Description |
---|---|---|
| array | Array of 2-tuples, each containing an input and an output value: |
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 | |||||||||
| number | Input range, which is device-specific. See the table below. | |||||||||
| object | Value transformation config for
|
Valid range
values depend of device.
range | 0 | 1 |
---|---|---|
PlusUni | 0-15VDC (default) | 0-30VDC |
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 ( |
| number or null |
|
| 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 two attributes, that can be used to compose conditional webhooks:
Property | Type | Description |
---|---|---|
| number | New voltage |
| number |
|
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,"range":0,"xvoltage":{"expr":"x+1","unit":"m/s"}}
curl -X POST -d '{"id":1,"method":"Voltmeter.SetConfig","params":{"id":0,"config":{"name":"Voltmeter0","report_thr":2.5,"range":0,"xvoltage":{"expr":"x+1","unit":"m/s"}}}}' http://${SHELLY}/rpc
mos --port ${PORT} call Voltmeter.SetConfig '{"id":0,"config":{"name":"Voltmeter0","report_thr":2.5,"range":0,"xvoltage":{"expr":"x+1","unit":"m/s"}}}'
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,
"range": 0,
"xvoltage": {
"expr": "x+1",
"unit": "m/s"
}
}
{
"id": 1,
"params": {
"id": 0,
"name": null,
"report_thr": 2.5,
"range": 0,
"xvoltage": {
"expr": "x+1",
"unit": "m/s"
}
}
}
{
"id": 0,
"name": null,
"report_thr": 2.5,
"range": 0,
"xvoltage": {
"expr": "x+1",
"unit": "m/s"
}
}
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,
"xvoltage": 4.5
}
{
"id": 1,
"params": {
"id": 0,
"voltage": 3.5,
"xvoltage": 4.5
}
}
{
"id": 0,
"voltage": 3.5,
"xvoltage": 4.5
}
Voltmeter.CheckExpression example
- Voltmeter.CheckExpression HTTP GET Request
- Voltmeter.CheckExpression Curl Request
- Voltmeter.CheckExpression Mos Request
http://192.168.33.1/rpc/Voltmeter.CheckExpression?expr="(x/3)+4"&inputs=[1,2,3]
curl -X POST -d '{"id":1,"method":"Voltmeter.CheckExpression","params":{"expr":"(x/3)+4","inputs":[1,2,3]}}' http://${SHELLY}/rpc
mos --port ${PORT} call Voltmeter.CheckExpression '{"expr":"(x/3)+4","inputs":[1,2,3]}'
Response
- Voltmeter.CheckExpression HTTP GET Response
- Voltmeter.CheckExpression Curl Response
- Voltmeter.CheckExpression Mos Response
{
"results": [
[
1,
4.333333
],
[
2,
4.666667
],
[
3,
5
]
]
}
{
"id": 1,
"params": {
"results": [
[
1,
4.333333
],
[
2,
4.666667
],
[
3,
5
]
]
}
}
{
"results": [
[
1,
4.333333
],
[
2,
4.666667
],
[
3,
5
]
]
}