Skip to main content
Version: 1.0

Shelly Pro Output Add-On

ProOutputAddon is a Service (similar to Webhook and Schedule), which manages the exposure of add-on peripherals. It uses ProOutputAddon as RPC namespace and provides the following methods:

ProOutputAddon allows the client to link add-on peripherals to Component instances, which in effect means that access to said peripherals is available through the standard Component interfaces: <Component>.GetStatus(), <Component>.GetConfig(), <Component>.SetConfig(). Ids of Components linked to add-on peripherals start from 100 and are limited to 199. Ids range [0..99] is reserved for Components linked to "internal" peripherals. Below is a list of supported add-on peripherals and the Component types they can be linked to:

Peripheral typeComponent type
digital_outswitch

Changes in peripheral<->component links made with ProOutputAddon.AddPeripheral, ProOutputAddon.RemovePeripheral bond the firmware to spawn/destroy Component instances and therefore require reboot to apply.

Devices that support Shelly Pro Output Addon

Addon configuration​

Addon board can be enabled or disabled by setting device.addon_type parameter in Sys config. To enable Shelly Pro Output Addon, addon_type must be set to "prooutput". When Addon is enabled, device must be restarted and methods for managing Addon peripherals will become available. To disable Shelly Pro Output Addon, parameter device.addon_type must be set to null.

Methods​

ProOutputAddon.AddPeripheral​

ProOutputAddon.AddPeripheral links an add-on peripheral to a Component instance. After adding a peripheral, the device needs reboot in order to use it.

Request​

Parameters:

PropertyTypeDescription

type

string

Peripheral type

attrs

object

Attributes that the method takes

Find more about the attrs properties in AddPeripheral attributes section

Response​

List of JSON objects, where the object key designates the Component key (in format <type>:<id>, e.g. switch:100) to which the peripheral is linked.

Examples: ProOutputAddon.AddPeripheral Example​

ProOutputAddon.GetPeripherals​

ProOutputAddon.GetPeripherals returns the configured links between add-on peripherals and Components.

Request​

This method takes no parameters.

Response​

List of JSON objects, one for each supported peripheral, where the object key designates the peripheral type ([digital_out]). The object body contains a nested list of JSON objects, where the object key designates the Component keys (in format <type>:<id>, e.g. switch:100) to which the peripheral is linked. The object body may contain additional attributes depending on the peripheral type.

Examples: ProOutputAddon.GetPeripherals Examples​

ProOutputAddon.RemovePeripheral​

Request​

PropertyTypeDescription

component

string

Linked Component key (in format <type>:<cid>, e.g. switch:100)

Response​

The result from this method is null on success otherwise will return error information.

Examples: ProOutputAddon.RemovePeripheral Examples​

AddPeripheral Attributes​

For every ProOutputAddon peripheral, component cid can be predefined or will be taken first available.

PropertyTypeDescription

cid

number

Id of component. (optional)

Examples​

Enable / Disable ProOutputAddon examples​

Enable ProOutputAddon​

http://192.168.33.1/rpc/Sys.SetConfig?config={"device":{"addon_type":"prooutput"}}

Disable ProOutputAddon​

http://192.168.33.1/rpc/Sys.SetConfig?config={"device":{"addon_type":null}}

ProOutputAddon.AddPeripheral example​

http://192.168.33.1/rpc/ProOutputAddon.AddPeripheral?type="digital_out"&attrs={"cid":100}

Response

{
"switch:100": {}
}

ProOutputAddon.RemovePeripheral example​

http://192.168.33.1/rpc/ProOutputAddon.RemovePeripheral?component="switch:100"

Response

null

ProOutputAddon.GetPeripherals example​

http://192.168.33.1/rpc/ProOutputAddon.GetPeripherals

Response

{
"digital_out": {
"switch:100": {}
}
}