Cover
The Cover
component handles the operation of motorized garage doors, window blinds, roof skylights etc. It uses Cover
as RPC namespace and provides the methods:
Cover.GetConfig
to obtain the component's configurationCover.SetConfig
to update the component's configurationCover.GetStatus
to obtain the component's statusCover.Open
to open the coverCover.Close
to close the coverCover.Stop
to stop the covers movementCover.GoToPosition
to move the cover to a certain positionCover.Calibrate
to calibrate the cover
Methods
Cover.SetConfig
Preconditions:
Cover
configuration can not be changed if:
Cover
is moving at the time of the requestCover
calibration is running at the time of the request
Properties:
Property | Type | Description |
---|---|---|
| number | The numeric ID of the |
| object | Configuration that the method takes |
The parameters in config must meet the following restrictions:
name
: [0..64]charspower_limit
: [0..max_rated
]W ornull
to set default (=max_rated
)voltage_limit
: (undervoltage_limit
..max_rated
]V ornull
to set default (=max_rated
)undervoltage_limit
: [0..voltage_limit
)V ornull
to set default (= 0 -> disabled)current_limit
: [0..max_rated
]A ornull
to set default (=max_rated
)motor.idle_power_thr
: [0..50]Wmotor.idle_confirm_period
: [0.25..0.75]secondsmaxtime_open
: [0.1..300]secmaxtime_close
: [0.1..300]secobstruction_detection.power_thr
: [0..max_rated
]Wobstruction_detection.holdoff
: [0.1..300]seconds
Find more about the config properties in config section
Cover.GetConfig
Properties:
Property | Type | Description |
---|---|---|
| number | The numeric ID of the |
Find more about the config properties in config section
Cover.GetStatus
Properties:
Property | Type | Description |
---|---|---|
| number | The numeric ID of the |
Find more about the status properties in status section
Cover.Calibrate
Preconditions:
Cover
will not accept the command if:
Cover
has any of the following errors set at the time of the request:safety_switch
,overpower
,overvoltage
,undervoltage
,overcurrent
,obstruction
,overtemp
Cover
is moving at the time of the requestCover
is already calibrating
Properties:
Property | Type | Description |
---|---|---|
| number | The numeric ID of the |
Response:
null
on success; error if request can not be executed or failed
Notes:
1) The calibration procedure will be aborted if:
Cover
fails to reach fully open / fully closed position within the configured timeoutmaxtime_open
/maxtime_close
. This can happen if a)maxtime_open
/maxtime_close
are set too low and theCover
stops before reaching the end positions, or b) there is a physical problem with the limit switches and the end positions can not be detected;- Any
Cover
safety feature (except obstruction detection, see point 3) is triggered during the calibration procedure (overpower
,overtemp
, etc.); Cover
receives an external command to stop during the calibration procedure (via input, RPC call, etc.);Cover
reports a mismatch between motor feedback and expected state during the calibration procedure, e.g. motor turning in wrong direction;- The device reboots (for any reason, incl. ota, factory reset, etc.) during the calibration procedure;
2) Once started, the calibration procedure invalidates any previous calibration data, and only saves new calibration data if the complete procedure finishes successfully. If the calibration procedure is interrupted due to any of the reasons described in point 1), calibration data will not be available.
3) During calibration, obstruction detection is ignored and the Cover
will not stop if the power consumption rises above the obstruction detection threshold.
Cover.Open
Preconditions:
Cover
will not accept the command if:
- An
overvoltage
error is set at the time of the request - An
undervoltage
error is set at the time of the request - An
overtemp
error is set at the time of the request - An engaged
safety_switch
prohibits movement in the requested direction Cover
calibration is running at the time of the request
Properties:
Property | Type | Description |
---|---|---|
| number | The numeric ID of the |
| number | If |
Response:
null
on success; error if request can not be executed or failed
Cover.Close
Preconditions:
Cover
will not accept the command if:
- An
overvoltage
error is set at the time of the request - An
undervoltage
error is set at the time of the request - An
overtemp
error is set at the time of the request - An engaged
safety_switch
prohibits movement in the requested direction Cover
calibration is running at the time of the request
Properties:
Property | Type | Description |
---|---|---|
| number | The numeric ID of the |
| number | If |
Response:
null
on success; error if request can not be executed or failed
Cover.Stop
Properties:
Property | Type | Description |
---|---|---|
| number | The numeric ID of the |
Response:
null
on success; error if request can not be executed or failed
Cover.GoToPosition
Preconditions:
Cover
will not accept the command if:
Cover
is not calibrated orCover
calibration is running at the time of the request
Properties:
Property | Type | Description |
---|---|---|
| number | The numeric ID of the |
| number | Required and mutually exclusive with |
| number | Required and mutually exclusive with |
Response:
null
on success; error if request can not be executed or failed
HTTP Endpoint: /roller/id
Controls the roller
instance and retrieves its current status. This can be used to trigger webhooks. More information about the events triggering webhooks available for this component can be found below.
Request
Parameters:
Property | Type | Description |
---|---|---|
| string | Action to be executed, one of |
| number | Target position, [0..100]%. Required when |
| number | Movement duration, [0.1..300]s. Optional. If missing, |
| number | Offset from current position, [0..100]%. Optional. Used in combination with |
Response
Received attributes:
Property | Type | Description |
---|---|---|
| string | Roller state, one of |
| string | Source of the last command, for example: |
| number | Active power in Watts |
| bool | Whether the power meter functions properly |
| bool | Whether the safety input is currently triggered |
| bool | Whether an overtemperature condition occurred |
| string | Last stop cause, one of |
| string | Last direction of motion, one of |
| number | Current position in % |
| bool | Whether the device is currently performing a calibration procedure |
| bool | Whether the device is successfully calibrated |
Configuration
The configuration of the Cover component contains information about the input mode, the timers and the protection settings of the chosen cover instance. To Get/Set the configuration of the Cover component its id
must be specified.
Properties:
Property | Type | Description | |||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| number | The numeric ID of the | |||||||||||||||||||||||||||||
| string | Name of the | |||||||||||||||||||||||||||||
| string | One of
| |||||||||||||||||||||||||||||
| string | Defines | |||||||||||||||||||||||||||||
| number | Watts, limit that must be exceeded to trigger an | |||||||||||||||||||||||||||||
| number | Volts, limit that must be exceeded to trigger an | |||||||||||||||||||||||||||||
| number | Volts, limit that must be subceeded to trigger an | |||||||||||||||||||||||||||||
| number | Amperes, limit that must be exceeded to trigger an | |||||||||||||||||||||||||||||
| object | configuration of the | |||||||||||||||||||||||||||||
| number | Watts, threshold below which the motor is considered | |||||||||||||||||||||||||||||
| number | Seconds, minimum period of time in idle state before state is confirmed | |||||||||||||||||||||||||||||
| number | Default timeout after which | |||||||||||||||||||||||||||||
| number | Default timeout after which | |||||||||||||||||||||||||||||
| Only present if there are two inputs associated with the
| ||||||||||||||||||||||||||||||
| boolean | Defines the motor rotation for open and close directions (changing this parameter requires a reboot):
| |||||||||||||||||||||||||||||
| object | Defines the behavior of the obstruction detection safety feature
| |||||||||||||||||||||||||||||
| object | Defines the behavior of the safety switch feature, only present if there are two inputs associated with the
|
Config defaults:
name
=null
in_mode
=dual
initial_state
=stopped
power_limit
= max ratedvoltage_limit
= max ratedundervoltage_limit
= 0current_limit
= max ratedmotor.idle_power_thr
= 2motor.idle_confirm_period
= 0.25maxtime_open
= 60maxtime_close
= 60swap_inputs
=false
invert_directions
=false
obstruction_detection.enable
=false
obstruction_detection.direction
=both
obstruction_detection.action
=stop
obstruction_detection.power_thr
= 1000obstruction_detection.holdoff
= 1safety_switch.enable
=false
safety_switch.direction
=both
safety_switch.action
=stop
safety_switch.allowed_move
=null
Status
The status of the Cover component contains information about the temperature, voltage, accumulated energy level and other physical characteristics of the cover instance. To obtain the status of the Cover component its id
must be specified.
Properties:
Property | Type | Description |
---|---|---|
| number | The numeric ID of the |
| string | Source of the last command |
| string | One of |
| number | Active power in Watts |
| number | Volts |
| number | Amperes |
| number | power factor |
| object | Energy counter information, same as in the |
| number ot null | Only present if |
| number or null | Only present if |
| number | Seconds, only present if |
| number | Only present if |
| bool |
|
| object | Temperature sensor information, only present if a temperature monitor is associated with the |
| array | Only present if an error condition has occurred |
The errors are set when one or more of the following conditions occurs:
Error | Condition |
---|---|
| When temperature exceeds predefined limit, |
| When power exceeds configured limit, |
| When voltage exceeds configured limit, |
| When voltage subceeds configured limit, |
| When current exceeds configured limit, |
| When an obstruction is hit, |
| When the safety switch is engaged while |
| When power meters feedback indicates the motor is rotating in a different direction than commanded; |
| When power meters feedback indicates both outputs connected to the motor are active simultaneously (this should never be possible); |
| When power meters feedback indicates the motor is still rotating though it has been commanded to stop |
| When calibration is aborted since |
| When calibration is aborted since |
| When calibration is aborted since a |
| When calibration is aborted since |
| When calibration is aborted since |
| When calibration is aborted since the measured time to fully close is negative or 0 |
| When calibration is aborted since the measured time to fully open is negative or 0 |
| When calibration is aborted since measured power consumption in close direction is negative or 0 |
| When calibration is aborted since measured power consumption in open direction is negative or 0 |
| When calibration is aborted since it took more steps than allowed to reach fully closed position during the 10-step-calibration-movement |
| When calibration is aborted since it took fewer steps than allowed to reach fully closed position during the 10-step-calibration-movement |
| When calibration is aborted since the time to reach fully closed position during the 10-step-calibration-movement is negative or 0 |
| When calibration is aborted since the actual step duration during the 10-step-calibration-movement in open direction is negative or 0 |
| When calibration is aborted since it took more steps than allowed to reach fully open position during the 10-step-calibration-movement |
| When calibration is aborted since it took fewer steps than allowed to reach fully open position during the 10-step-calibration-movement |
| When calibration is aborted since the time to reach fully open position during the 10-step-calibration-movement is negative or 0 |
The errors are cleared when the device recovered from the wrong condition:
Error | Condition |
---|---|
| when temperature falls below a predefined limit |
| On the first open/close/go to position command after the emergency stop |
| When voltage falls below configured limit |
| When voltage goes above configured limit |
| On the first open/close/go to position command after the emergency stop |
| On the first open/close/go to position command after the recovery action |
| When the safety switch is disengaged |
| On the first open/close/go to position/calibrate command after the emergency stop |
| On the first open/close/calibrate command after the error has been set |
Webhook Events
There are five events related to the Cover
component that can trigger webhooks:
cover.open
:Cover
has reached fully open positioncover.closed
:Cover
has reached fully closed positioncover.opening
:Cover
has begun moving in open directioncover.closing
:Cover
has begun moving in close directioncover.stopped
:Cover
has stopped moving, but is neither fully open nor fully closed
MQTT Control
Since version 0.14.0
Shelly will subscribe to the following topics, accepting commands:
<topic_prefix>/command/cover:<id>
Shelly publishes on:
<topic_prefix>/status/cover:<id>
- topic where the result of thestatus_update
command is published. The command can be sent either on the common device topic or the component specific topic. This topic is already used for existing status notifications, if enabled.<topic_prefix>/error/cover:<id>
- error message is published if cover command receives incorrect parameters or results in an error.
Accepted commands are:
status_update
- causes status of the corresponding component to be published on its<topic_prefix>/status/cover:<id>
topic.calibrate
- starts calibration procedure.open[,number]
- opens the cover, optionalduration
parameter.close[,number]
- closes the cover, optionalduration
parameter.stop
- stops previously initiated movement.pos,number
- cover goes toposition
, required parameter.rel,number
- cover goes torelative position
, required parameter.
<topic_prefix>
is a custom prefix if set or defaults to <device_id>
Calibration KB
Overview
The purpose of the Cover
component calibration procedure is to endow position control. Once successfully calibrated, positioning between 0% and 100% becomes available. An uncalibrated Cover
component supports only Open
and Close
commands.
Whether a Cover
component is calibrated or not can be derived from the boolean pos_control
status attribute, which reflects the presence of valid calibration data. If valid calibration data is available this attribute is set to true
.
The calibration procedure relies on feedback from the device's power meters. Most motors used in roller shutters, blinds, garage doors, etc. have integrated limit switches or load control electronics which cut off power to the motor when fully open / fully closed positions are reached. During the calibration procedure, the Cover
component constantly monitors the power meter's feedback, and treats power consumption drops below motor.idle_power_thr
as an end position.
Correctly detecting fully open / fully closed positions is essential for calculating calibration data, and therefore, the success of the calibration procedure. Calibration will fail if the motor's power consumption can not be monitored (e.g. when the hardware setup is such that the Cover
component controls the motor via intermediate switches, contactors, etc.). The absence of valid calibration data is considered as an indication that adequate power meter's feedback can not be acquired and power meter readings will be ignored during Cover
component operation in regards to movement control and monitoring. In this case, the Cover
component will rely solely on maxtime_open
/ maxtime_close
to report that end positions are reached.
Before starting the calibration procedure
This checklist can be useful to rule out configuration, electrical or other hardware problems before starting:
It should be confirmed that the cover can be operated in both directions with simple
Open
/Close
/Stop
commands. It should be possible to perform a complete movement from fully open position to fully closed position and vice-versa without a timeout. If not,maxtime_open
and/ormaxtime_close
should be increased.The power consumption of the motor
apower
should rise abovemotor.idle_power_thr
while moving, and should fall belowmotor.idle_power_thr
when stopped. If not,motor.idle_power_thr
should be adjusted accordingly.For vertical covers,
invert_directions
parameter should be setup correctly (Open
should cause upward movement,Close
should cause downward movement). The calibration procedure can run anyway, but will result in reduced position control accuracy.Before starting calibration, cover must be idle (stopped) and all of the following errors must be cleared:
safety_switch
,overpower
,overvoltage
,undervoltage
,overcurrent
,obstruction
,overtemp
. If these conditions are not met, the calibration request will be rejected.
Aside from calculating movement parameters, during the calibration procedure the Cover
component will monitor the peak power consumption and automatically set the value of obstruction_detection.power_thr
. Hence, the obstruction detection protection mechanism will be disabled for the duration of the calibration procedure, regardless of the obstruction_detection.enable
property. Before starting calibration, it must be ensured there are no objects obstructing the movement and the device should not be left without supervision while calibration is in progress.
Calibration workflow
The execution flow of the calibration procedure is as follows:
- 1) Go to initial position (fully open)
- 2) Go to fully closed position in one uninterrupted movement
- 3) Go to fully open position in one uninterrupted movement
- 4) Go to fully closed position in consecutive movement steps
- 5) Go to fully open position in consecutive movement steps
The gathered measurements are used to calculate calibration data consisting of:
- the time it takes to travel 1% in
close
direction - the time it takes to travel 1% in
open
direction - the motor ramp-up time in
close
direction - the motor ramp-up time in
open
direction
When calibration data is available, the Cover
component will keep track of the duration of each movement and use the calibration data to determine the current position relative to the end positions. Similarly, the Cover
component will use the calibration data to translate GoToPosition
requests to movement durations in the corresponding direction.
Troubleshooting
1) Calibration fails with error cal_abort:timeout_open
/ cal_abort:timeout_close
Reason
The Cover
component failed to detect a fully open / fully closed position within the configured timeout maxtime_open
/ maxtime_close
Mitigation
- If the cover stops moving before (visibly) reaching the end positions, the timeouts are probably too short. Try to increase
maxtime_open
/maxtime_close
; - If the cover reaches the end positions but the calibration still fails with the same error, it is possible that the motor's power consumption remains above
motor.idle_power_thr
even when the motor has stopped. Try to icrease the value ofmotor.idle_power_thr
.
2) Calibration fails with error cal_abort:implausible_power_consumption_in_close_dir
/ cal_abort:implausible_power_consumption_in_open_dir
Reason
The Cover
component didn't detect positive power consumption during the calibration procedure.
Mitigation
- Check the reported power consumption when a simple
Open
/Close
command is issued. If the power consumption is 0 while the cover is moving, check the hardware setup; - If the power consumption is OK during simple
Open
/Close
but calibration still fails, it is possible that the value ofobstruction_detection.holdoff
is configured to be greater than the time to fully open / fully close, which effectively impedes power monitoring during this period. Try to decrease the value ofobstruction_detection.holdoff
.
3) Device is calibrated succesfully (pos_control
=true
) but current position is unknown (current_pos
=null
)
Reason
In certain conditions (e.g. after power outage) the Cover
component can loose track of its current position. This doesn't mean that calibration data is lost or broken, but only that the cover needs to be moved to a known reference point to resume tracking the current position.
Mitigation
Open
/ Close
the cover until a fully open / fully closed position is reached.
4) Cover.GoToPosition
fails with "-109 Precondition failed: Current position unknown!"
Reason
Position control is only possible if cover movement starts at a known reference point. If the Cover
component has lost its current position (see previous point), it's not possible to execute position requests.
Mitigation
Open
/ Close
the cover until a fully open / fully closed position is reached.
5) Position control looses accuracy over time
Reason
The Cover
component position control relies on time counting to keep track of the current position and execute GoToPosition
requests. As an open-loop control system the only reference points that can be feedback-confirmed during cover movement are the fully open / fully closed positions. If the cover is moved many times between fully open / fully closed without ever reaching them, error is accumulated and position control accuracy deteriorates.
Mitigation
Open
/ Close
the cover until a fully open / fully closed position is reached.
Examples
Cover.SetConfig example
Note: Setting a specific section.configurationOption
(for example motor.idle_power_thr
) can be done via:
- Cover.SetConfig HTTP GET Request
- Cover.SetConfig Curl Request
- Cover.SetConfig Mos Request
http://192.168.33.1/rpc/Cover.SetConfig?id=0&config={"motor":{"idle_power_thr":3}}
curl -X POST -d '{"id":1,"method":"Cover.SetConfig","params":{"id":0,"config":{"motor":{"idle_power_thr":3}}}}' http://${SHELLY}/rpc
mos --port ${PORT} call Cover.SetConfig '{"id":0,"config":{"motor":{"idle_power_thr":3}}}'
Response
- Cover.SetConfig HTTP GET Response
- Cover.SetConfig Curl Response
- Cover.SetConfig Mos Response
{
"restart_required": false
}
{
"id": 1,
"src": "shellyplus2pm-a8032ab67a84",
"params": {
"restart_required": false
}
}
{
"restart_required": false
}
Cover.GetConfig example
- Cover.GetConfig HTTP GET Request
- Cover.GetConfig Curl Request
- Cover.GetConfig Mos Request
http://192.168.33.1/rpc/Cover.GetConfig?id=0
curl -X POST -d '{"id":1,"method":"Cover.GetConfig","params":{"id":0}}' http://${SHELLY}/rpc
mos --port ${PORT} call Cover.GetConfig '{"id":0}'
Response
- Cover.GetConfig HTTP GET Response
- Cover.GetConfig Curl Response
- Cover.GetConfig Mos Response
{
"id": 0,
"name": "myCover",
"motor": {
"idle_power_thr": 2,
"idle_confirm_period": 0.25
},
"maxtime_open": 60,
"maxtime_close": 60,
"initial_state": "stopped",
"invert_directions": false,
"in_mode": "dual",
"swap_inputs": false,
"safety_switch": {
"enable": false,
"direction": "both",
"action": "stop",
"allowed_move": null
},
"power_limit": 2800,
"voltage_limit": 280,
"undervoltage_limit": 0,
"current_limit": 10,
"obstruction_detection": {
"enable": false,
"direction": "open",
"action": "stop",
"power_thr": 120,
"holdoff": 1
}
}
{
"id": 1,
"src": "shellyplus2pm-a8032ab67a84",
"params": {
"id": 0,
"name": "myCover",
"motor": {
"idle_power_thr": 2,
"idle_confirm_period": 0.25
},
"maxtime_open": 60,
"maxtime_close": 60,
"initial_state": "stopped",
"invert_directions": false,
"in_mode": "dual",
"swap_inputs": false,
"safety_switch": {
"enable": false,
"direction": "both",
"action": "stop",
"allowed_move": null
},
"power_limit": 2800,
"voltage_limit": 280,
"undervoltage_limit": 0,
"current_limit": 10,
"obstruction_detection": {
"enable": false,
"direction": "open",
"action": "stop",
"power_thr": 120,
"holdoff": 1
}
}
}
{
"id": 0,
"name": "myCover",
"motor": {
"idle_power_thr": 2,
"idle_confirm_period": 0.25
},
"maxtime_open": 60,
"maxtime_close": 60,
"initial_state": "stopped",
"invert_directions": false,
"in_mode": "dual",
"swap_inputs": false,
"safety_switch": {
"enable": false,
"direction": "both",
"action": "stop",
"allowed_move": null
},
"power_limit": 2800,
"voltage_limit": 280,
"undervoltage_limit": 0,
"current_limit": 10,
"obstruction_detection": {
"enable": false,
"direction": "open",
"action": "stop",
"power_thr": 120,
"holdoff": 1
}
}
Cover.GetStatus example
- Cover.GetStatus HTTP GET Request
- Cover.GetStatus Curl Request
- Cover.GetStatus Mos Request
http://192.168.33.1/rpc/Cover.GetStatus?id=0
curl -X POST -d '{"id":1,"method":"Cover.GetStatus","params":{"id":0}}' http://${SHELLY}/rpc
mos --port ${PORT} call Cover.GetStatus '{"id":0}'
Response
- Cover.GetStatus HTTP GET Response
- Cover.GetStatus Curl Response
- Cover.GetStatus Mos Response
{
"id": 0,
"source": "limit_switch",
"state": "open",
"apower": 0,
"voltage": 233,
"current": 0,
"pf": 0,
"aenergy": {
"total": 48.996,
"by_minute": [
0,
0,
0
],
"minute_ts": 1654604045
},
"temperature": {
"tC": 55.4,
"tF": 131.7
},
"pos_control": true,
"current_pos": 100
}
{
"id": 1,
"src": "shellyplus2pm-a8032ab67a84",
"params": {
"id": 0,
"source": "limit_switch",
"state": "open",
"apower": 0,
"voltage": 233,
"current": 0,
"pf": 0,
"aenergy": {
"total": 48.996,
"by_minute": [
0,
0,
0
],
"minute_ts": 1654604045
},
"temperature": {
"tC": 55.4,
"tF": 131.7
},
"pos_control": true,
"current_pos": 100
}
}
{
"id": 0,
"source": "limit_switch",
"state": "open",
"apower": 0,
"voltage": 233,
"current": 0,
"pf": 0,
"aenergy": {
"total": 48.996,
"by_minute": [
0,
0,
0
],
"minute_ts": 1654604045
},
"temperature": {
"tC": 55.4,
"tF": 131.7
},
"pos_control": true,
"current_pos": 100
}
Cover.Calibrate example
- Cover.Calibrate HTTP GET Request
- Cover.Calibrate Curl Request
- Cover.Calibrate Mos Request
http://192.168.33.1/rpc/Cover.Calibrate?id=0
curl -X POST -d '{"id":1,"method":"Cover.Calibrate","params":{"id":0}}' http://${SHELLY}/rpc
mos --port ${PORT} call Cover.Calibrate '{"id":0}'
Response
- Cover.Calibrate HTTP GET Response
- Cover.Calibrate Curl Response
- Cover.Calibrate Mos Response
null
{
"id": 1,
"src": "shellyplus2pm-a8032ab67a84",
"params": null
}
null
Cover.Open example
- Cover.Open HTTP GET Request
- Cover.Open Curl Request
- Cover.Open Mos Request
http://192.168.33.1/rpc/Cover.Open?id=0
curl -X POST -d '{"id":1,"method":"Cover.Open","params":{"id":0}}' http://${SHELLY}/rpc
mos --port ${PORT} call Cover.Open '{"id":0}'
Response
- Cover.Open HTTP GET Response
- Cover.Open Curl Response
- Cover.Open Mos Response
null
{
"id": 1,
"src": "shellyplus2pm-a8032ab67a84",
"params": null
}
null
Cover.Close example
- Cover.Close HTTP GET Request
- Cover.Close Curl Request
- Cover.Close Mos Request
http://192.168.33.1/rpc/Cover.Close?id=0
curl -X POST -d '{"id":1,"method":"Cover.Close","params":{"id":0}}' http://${SHELLY}/rpc
mos --port ${PORT} call Cover.Close '{"id":0}'
Response
- Cover.Close HTTP GET Response
- Cover.Close Curl Response
- Cover.Close Mos Response
null
{
"id": 1,
"src": "shellyplus2pm-a8032ab67a84",
"params": null
}
null
Cover.GoToPosition example
- Cover.GoToPosition HTTP GET Request
- Cover.GoToPosition Curl Request
- Cover.GoToPosition Mos Request
http://192.168.33.1/rpc/Cover.GoToPosition?id=0&pos=20
curl -X POST -d '{"id":1,"method":"Cover.GoToPosition","params":{"id":0,"pos":20}}' http://${SHELLY}/rpc
mos --port ${PORT} call Cover.GoToPosition '{"id":0,"pos":20}'
Response
- Cover.GoToPosition HTTP GET Response
- Cover.GoToPosition Curl Response
- Cover.GoToPosition Mos Response
null
{
"id": 1,
"src": "shellyplus2pm-a8032ab67a84",
"params": null
}
null
HTTP Endpoint example
Example:
curl http://${SHELLY}/roller/0
Example:
{
"state":"stop",
"source":"init",
"power":0.0,
"is_valid":true,
"safety_switch":false,
"overtemperature":false,
"stop_reason":"normal",
"last_direction":"close",
"calibrating":false,
"positioning":false
}
Open cover for 10 seconds over MQTT example
export MQTT_SERVER="broker.hivemq.com"
export MQTT_PORT=1883
export SHELLY_ID="shellyplus2pm-a8032ab67a84" # The <shelly-id> of your device
mosquitto_pub -h ${MQTT_SERVER} -p ${MQTT_PORT} -t ${SHELLY_ID}/command -m open,10