PM1
The PM1 component handles electrical power metering capabilities. It uses PM1
as RPC namespace and provides the methods:
PM1.SetConfig
to update the component's configurationPM1.GetConfig
to obtain the component's configurationPM1.GetStatus
to obtain the component's status
PM1 components are identified with PM1:<id>
in objects containing multiple component payloads.
Methods
PM1.SetConfig
Properties:
Property | Type | Description |
---|---|---|
| number | Id of the PM1 component instance |
| object | Configuration that the method takes |
Find more about the config properties in config section
PM1.GetConfig
Properties:
Property | Type | Description |
---|---|---|
| number | Id of the PM1 component instance |
Find the PM1.GetConfig response properties in config section
PM1.GetStatus
Properties:
Property | Type | Description |
---|---|---|
| number | Id of the PM1 component instance |
Find more about the status response properties in status section
Configuration
The configuration of the PM1 component contains information about the id and name of the component.
Property | Type | Description |
---|---|---|
| number | Id of the PM1 component instance |
| string or null | Name of the PM1 instance |
Status
The status of the PM1 component contains information about the measured variables. To obtain the status of the PM1 component its id
must be specified.
Property | Type | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| number | Id of the PM1 component instance | ||||||||||||
| number | Last measured voltage in Volts | ||||||||||||
| number | Last measured current in Amperes | ||||||||||||
| number | Last measured instantaneous active power (in Watts) delivered to the attached load | ||||||||||||
| number | Last measured instantaneous apparent power (in Volt-Amperes) delivered to the attached load (shown if applicable) | ||||||||||||
| number | Last measured power factor (shown if applicable) | ||||||||||||
| number | Last measured network frequency (shown if applicable) | ||||||||||||
| object | Information about the active energy counter
| ||||||||||||
| object | Information about the returned active energy counter
| ||||||||||||
| array of type string | Error conditions occurred. May contain |
Webhook Events
PM1 component supports conditional webhooks.
Events related to the PM1 component that can trigger webhooks:
voltage_change
- when the voltage has changed with at least 1V and 5% from the last reported value.voltage_change
event supports attributes, that can be used to compose conditional webhooks:Property Type Description voltage
number
New voltage in Volts
current_change
- when the current has changed with at least 0.05A and 5% from the last reported value.current_change
event supports attributes, that can be used to compose conditional webhooks:Property Type Description current
number
New current in Amps
apower_change
- when the active power has changed with at least 1W and 5% from the last reported value.apower_change
event supports attributes, that can be used to compose conditional webhooks:Property Type Description apower
number
New active power in Watts
Examples
PM1.SetConfig example
- PM1.SetConfig HTTP GET Request
- PM1.SetConfig Curl Request
- PM1.SetConfig Mos Request
http://192.168.33.1/rpc/PM1.SetConfig?id=0&config={"name":"Meter"}
curl -X POST -d '{"id":1,"method":"PM1.SetConfig","params":{"id":0,"config":{"name":"Meter"}}}' http://${SHELLY}/rpc
mos --port ${PORT} call PM1.SetConfig '{"id":0,"config":{"name":"Meter"}}'
Response
- PM1.SetConfig HTTP GET Response
- PM1.SetConfig Curl Response
- PM1.SetConfig Mos Response
{
"restart_required": false
}
{
"id": 1,
"params": {
"restart_required": false
}
}
{
"restart_required": false
}
PM1.GetConfig example
- PM1.GetConfig HTTP GET Request
- PM1.GetConfig Curl Request
- PM1.GetConfig Mos Request
http://192.168.33.1/rpc/PM1.GetConfig?id=0
curl -X POST -d '{"id":1,"method":"PM1.GetConfig","params":{"id":0}}' http://${SHELLY}/rpc
mos --port ${PORT} call PM1.GetConfig '{"id":0}'
Response
- PM1.GetConfig HTTP GET Response
- PM1.GetConfig Curl Response
- PM1.GetConfig Mos Response
{
"id": 0,
"name": "PM1device"
}
{
"id": 1,
"params": {
"id": 0,
"name": "PM1device"
}
}
{
"id": 0,
"name": "PM1device"
}
PM1.GetStatus example
- PM1.GetStatus HTTP GET Request
- PM1.GetStatus Curl Request
- PM1.GetStatus Mos Request
http://192.168.33.1/rpc/PM1.GetStatus?id=0
curl -X POST -d '{"id":1,"method":"PM1.GetStatus","params":{"id":0}}' http://${SHELLY}/rpc
mos --port ${PORT} call PM1.GetStatus '{"id":0}'
Response
- PM1.GetStatus HTTP GET Response
- PM1.GetStatus Curl Response
- PM1.GetStatus Mos Response
{
"id": 0,
"voltage": 225.9,
"current": 0,
"apower": 0,
"freq": 50,
"aenergy": {
"total": 11.679,
"by_minute": [
0,
0,
0
],
"minute_ts": 1654511972
},
"ret_aenergy": {
"total": 4.126,
"by_minute": [
0,
0,
0
],
"minute_ts": 1654511318
},
"errors": [
"power_meter_failure",
"out_of_range:voltage",
"out_of_range:current",
"out_of_range:apower",
"out_of_range:aprtpower"
]
}
{
"id": 1,
"src": "shellyplus1pm-441793ce3f08",
"params": {
"id": 0,
"voltage": 225.9,
"current": 0,
"apower": 0,
"freq": 50,
"aenergy": {
"total": 11.679,
"by_minute": [
0,
0,
0
],
"minute_ts": 1654511972
},
"ret_aenergy": {
"total": 4.126,
"by_minute": [
0,
0,
0
],
"minute_ts": 1654511318
},
"errors": [
"power_meter_failure",
"out_of_range:voltage",
"out_of_range:current",
"out_of_range:apower",
"out_of_range:aprtpower"
]
}
}
{
"id": 0,
"voltage": 225.9,
"current": 0,
"apower": 0,
"freq": 50,
"aenergy": {
"total": 11.679,
"by_minute": [
0,
0,
0
],
"minute_ts": 1654511972
},
"ret_aenergy": {
"total": 4.126,
"by_minute": [
0,
0,
0
],
"minute_ts": 1654511318
},
"errors": [
"power_meter_failure",
"out_of_range:voltage",
"out_of_range:current",
"out_of_range:apower",
"out_of_range:aprtpower"
]
}