Shelly Pro Sensor Add-On
ProSensorAddon is a Service for Shelly Pro devices that manages the exposure of add-on peripherals through an external addon board. It shares most functionality with SensorAddon but is designed specifically for Pro series devices.
ProSensorAddon uses ProSensorAddon, SensorAddon and Addon RPC namespaces and provides the following methods:
ProSensorAddon-specific methods:
ProSensorAddon.GetStatusto get addon component statusProSensorAddon.GetConfigto get addon configurationProSensorAddon.SetConfigto set addon configuration
Shared SensorAddon methods:
SensorAddon.AddPeripheralto add peripheralSensorAddon.RemovePeripheralto remove peripheralSensorAddon.UpdatePeripheralto update peripheral settingsSensorAddon.GetPeripheralsto list all peripheralsSensorAddon.OneWireScanto scan one wire bus
AddOn management methods:
AddOn.GetInfoto get addon hardware and firmware informationAddOn.CheckForUpdateto check for firmware updatesAddOn.Updateto update addon firmware
ProSensorAddon 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.
Supported IOs
The Pro Sensor Addon supports multiple IOs per peripheral type:
| Peripheral type | Supported IOs | Labels |
|---|---|---|
| analog_in | 0, 1 | GND, AIN (0, 1) |
| voltmeter | 0, 1 | GND, AIN (0, 1) |
| digital_in | 0, 1 | GND, DIN (0, 1) |
| ds18b20 | 0, 1 | GND, DATA (0, 1), VCC |
| dht22 | 0, 1 | GND, DATA (0, 1), VCC |
| digital_out | 0 | IN, OUT |
Peripheral Types and Component Mapping
Below is a list of supported add-on peripherals and the Component types they can be linked to:
| Peripheral type | Component type |
|---|---|
| analog_in | input |
| voltmeter | voltmeter |
| digital_in | input |
| ds18b20 | temperature |
| dht22 | temperature, humidity |
| digital_out | switch |
Changes in peripheral<->component links made with SensorAddon.AddPeripheral, SensorAddon.RemovePeripheral, SensorAddon.UpdatePeripheral bond the firmware to spawn/destroy Component instances and therefore require reboot to apply.
Supported Devices
Devices that support Shelly Pro Sensor Addon:
Addon Configuration
Addon board can be enabled or disabled by setting device.addon_type parameter in Sys config. To enable Shelly Pro Sensor Addon, addon_type must be set to "sensor". When Addon is enabled, device must be restarted and all related API will be accessible. To disable Shelly Pro Sensor Addon, parameter device.addon_type must be set to null.
Methods
ProSensorAddon.GetStatus
ProSensorAddon.GetStatus returns the status of the Pro Sensor Addon component.
Request
| Property | Type | Description |
|---|---|---|
| number | Id of the ProSensorAddon component instance. Required |
Response
| Property | Type | Description | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| number | Id of the component instance | ||||||||||||
| string | Current firmware version of the addon board | ||||||||||||
| object | Information about available firmware updates. Present only if an update is available and
| ||||||||||||
| object | Information about ongoing firmware update. Present only during update
| ||||||||||||
| array of strings | Error conditions. Possible values: |
Examples
- ProSensorAddon.GetStatus HTTP GET Request
- ProSensorAddon.GetStatus Curl Request
- ProSensorAddon.GetStatus Mos Request
http://192.168.33.1/rpc/ProSensorAddon.GetStatus?id=101
curl -X POST -d '{"id":1,"method":"ProSensorAddon.GetStatus","params":{"id":101}}' http://${SHELLY}/rpc
mos --port ${PORT} call ProSensorAddon.GetStatus '{"id":101}'
Response
- ProSensorAddon.GetStatus HTTP GET Response
- ProSensorAddon.GetStatus Curl Response
- ProSensorAddon.GetStatus Mos Response
{
"id": 101,
"fw_version": "1.0.0"
}
{
"id": 1,
"params": {
"id": 101,
"fw_version": "1.0.0"
}
}
{
"id": 101,
"fw_version": "1.0.0"
}
Response with available update:
Response
- ProSensorAddon.GetStatus HTTP GET Response
- ProSensorAddon.GetStatus Curl Response
- ProSensorAddon.GetStatus Mos Response
{
"id": 101,
"fw_version": "1.0.0",
"available_updates": {
"stable": {
"version": "1.1.0"
}
}
}
{
"id": 1,
"params": {
"id": 101,
"fw_version": "1.0.0",
"available_updates": {
"stable": {
"version": "1.1.0"
}
}
}
}
{
"id": 101,
"fw_version": "1.0.0",
"available_updates": {
"stable": {
"version": "1.1.0"
}
}
}
Response during firmware update:
Response
- ProSensorAddon.GetStatus HTTP GET Response
- ProSensorAddon.GetStatus Curl Response
- ProSensorAddon.GetStatus Mos Response
{
"id": 101,
"fw_version": "1.0.0",
"update": {
"progress": 45,
"state": "updating",
"ts": 1699876543.21
}
}
{
"id": 1,
"params": {
"id": 101,
"fw_version": "1.0.0",
"update": {
"progress": 45,
"state": "updating",
"ts": 1699876543.21
}
}
}
{
"id": 101,
"fw_version": "1.0.0",
"update": {
"progress": 45,
"state": "updating",
"ts": 1699876543.21
}
}
ProSensorAddon.GetConfig
ProSensorAddon.GetConfig returns the configuration of the Pro Sensor Addon component.
Request
This method takes no parameters.
Response
Returns an empty object {}. The ProSensorAddon component currently has no configurable parameters.
Examples
- ProSensorAddon.GetConfig HTTP GET Request
- ProSensorAddon.GetConfig Curl Request
- ProSensorAddon.GetConfig Mos Request
http://192.168.33.1/rpc/ProSensorAddon.GetConfig
curl -X POST -d '{"id":1,"method":"ProSensorAddon.GetConfig"}' http://${SHELLY}/rpc
mos --port ${PORT} call ProSensorAddon.GetConfig
Response
- ProSensorAddon.GetConfig HTTP GET Response
- ProSensorAddon.GetConfig Curl Response
- ProSensorAddon.GetConfig Mos Response
{}
{
"id": 1,
"params": {}
}
{}
ProSensorAddon.SetConfig
ProSensorAddon.SetConfig sets the configuration of the Pro Sensor Addon component.
Request
This method takes no parameters as there are currently no configurable parameters.
Response
The result from this method is null on success.
Examples
- ProSensorAddon.SetConfig HTTP GET Request
- ProSensorAddon.SetConfig Curl Request
- ProSensorAddon.SetConfig Mos Request
http://192.168.33.1/rpc/ProSensorAddon.SetConfig
curl -X POST -d '{"id":1,"method":"ProSensorAddon.SetConfig"}' http://${SHELLY}/rpc
mos --port ${PORT} call ProSensorAddon.SetConfig
Response
- ProSensorAddon.SetConfig HTTP GET Response
- ProSensorAddon.SetConfig Curl Response
- ProSensorAddon.SetConfig Mos Response
null
{
"id": 1,
"params": null
}
null
SensorAddon.AddPeripheral
SensorAddon.AddPeripheral links an add-on peripheral to a Component instance.
Request
Parameters:
| Property | Type | Description |
|---|---|---|
| string | Peripheral type: |
| 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. temperature:100) to which the peripheral is linked.
Examples: SensorAddon.AddPeripheral Examples
SensorAddon.GetPeripherals
SensorAddon.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 ([ds18b20, dht22, digital_in, analog_in, voltmeter, 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. temperature:100) to which the peripheral is linked. The object body also contains the io on which the sensor is attached and may contain additional attributes depending on the peripheral type.
Examples: SensorAddon.GetPeripherals Examples
SensorAddon.RemovePeripheral
Request
| Property | Type | Description |
|---|---|---|
| string | Linked |
Response
The result from this method is null on success otherwise will return error information.
Examples: SensorAddon.RemovePeripheral Examples
SensorAddon.UpdatePeripheral
SensorAddon.UpdatePeripheral serves to reconfigure peripheral-component links or reassign peripheral-specific properties.
Currently only ds18b20 peripheral has updateable attributes.
Request
| Property | Type | Description |
|---|---|---|
| string | Linked |
| object | Attributes that the method takes |
Find more about the attrs properties in UpdatePeripheral attributes section
Response
The result from this method is null on success otherwise will return error information.
Examples: SensorAddon.UpdatePeripheral Examples
SensorAddon.OneWireScan
SensorAddon.OneWireScan returns a list of discovered OneWire devices.
This method returns an error if a dht22 peripheral is currently in use on all IOs, as dht22 occupies the same GPIOs used for OneWire.
For now the only supported OneWire peripheral type is ds18b20.
Request
This method takes no parameters.
Response
Attributes in the result:
| Property | Type | Description | |||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| array of objects | List of all discovered devices on the bus
|
Examples: SensorAddon.OneWireScan Examples
AddOn.GetInfo
AddOn.GetInfo returns information about the addon hardware and firmware.
Request
This method takes no parameters.
Response
| Property | Type | Description | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| string | Addon type. For Pro Sensor Addon this is | ||||||||||||||||||
| string | Hardware version of the addon board. | ||||||||||||||||||
| string | Firmware version of the addon board. | ||||||||||||||||||
| object | Object describing supported IOs per peripheral type
|
Examples
- AddOn.GetInfo HTTP GET Request
- AddOn.GetInfo Curl Request
- AddOn.GetInfo Mos Request
http://192.168.33.1/rpc/AddOn.GetInfo
curl -X POST -d '{"id":1,"method":"AddOn.GetInfo"}' http://${SHELLY}/rpc
mos --port ${PORT} call AddOn.GetInfo
Response
- AddOn.GetInfo HTTP GET Response
- AddOn.GetInfo Curl Response
- AddOn.GetInfo Mos Response
{
"type": "ProSensorAddon",
"hw_ver": "1.0",
"fw_ver": "1.0.0",
"supported_ios": {
"digital_in": [
0,
1
],
"analog_in": [
0,
1
],
"digital_out": [
0
],
"ds18b20": [
0,
1
],
"dht22": [
0,
1
]
}
}
{
"id": 1,
"params": {
"type": "ProSensorAddon",
"hw_ver": "1.0",
"fw_ver": "1.0.0",
"supported_ios": {
"digital_in": [
0,
1
],
"analog_in": [
0,
1
],
"digital_out": [
0
],
"ds18b20": [
0,
1
],
"dht22": [
0,
1
]
}
}
}
{
"type": "ProSensorAddon",
"hw_ver": "1.0",
"fw_ver": "1.0.0",
"supported_ios": {
"digital_in": [
0,
1
],
"analog_in": [
0,
1
],
"digital_out": [
0
],
"ds18b20": [
0,
1
],
"dht22": [
0,
1
]
}
}
Response when addon is not connected:
Response
- AddOn.GetInfo HTTP GET Response
- AddOn.GetInfo Curl Response
- AddOn.GetInfo Mos Response
{}
{
"id": 1,
"params": {}
}
{}
AddOn.CheckForUpdate
AddOn.CheckForUpdate checks for available firmware updates for the addon board.
Request
This method takes no parameters.
Response
| Property | Type | Description | |||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| object | Information about available firmware updates. Present only if an update is available
|
The result from this method is null if no updates are available.
Examples
- AddOn.CheckForUpdate HTTP GET Request
- AddOn.CheckForUpdate Curl Request
- AddOn.CheckForUpdate Mos Request
http://192.168.33.1/rpc/AddOn.CheckForUpdate
curl -X POST -d '{"id":1,"method":"AddOn.CheckForUpdate"}' http://${SHELLY}/rpc
mos --port ${PORT} call AddOn.CheckForUpdate
Response with available update:
Response
- AddOn.CheckForUpdate HTTP GET Response
- AddOn.CheckForUpdate Curl Response
- AddOn.CheckForUpdate Mos Response
{
"available_updates": {
"type": "ProSensorAddon",
"stable": {
"version": "1.1.0"
}
}
}
{
"id": 1,
"params": {
"available_updates": {
"type": "ProSensorAddon",
"stable": {
"version": "1.1.0"
}
}
}
}
{
"available_updates": {
"type": "ProSensorAddon",
"stable": {
"version": "1.1.0"
}
}
}
Response when no update is available:
Response
- AddOn.CheckForUpdate HTTP GET Response
- AddOn.CheckForUpdate Curl Response
- AddOn.CheckForUpdate Mos Response
null
{
"id": 1,
"params": null
}
null
AddOn.Update
AddOn.Update initiates a firmware update of the addon board.
Request
| Property | Type | Description |
|---|---|---|
| string | URL to download the firmware from. Optional - if not provided, uses the URL from the last |
| number | Update timeout in seconds. Must be greater than 300 seconds. Optional, defaults to system timeout |
Response
The result from this method is null on success. The update progress can be monitored via ProSensorAddon.GetStatus.
Examples
Update using discovered update URL:
- AddOn.Update HTTP GET Request
- AddOn.Update Curl Request
- AddOn.Update Mos Request
http://192.168.33.1/rpc/AddOn.Update?timeout=600
curl -X POST -d '{"id":1,"method":"AddOn.Update","params":{"timeout":600}}' http://${SHELLY}/rpc
mos --port ${PORT} call AddOn.Update '{"timeout":600}'
Response
- AddOn.Update HTTP GET Response
- AddOn.Update Curl Response
- AddOn.Update Mos Response
null
{
"id": 1,
"params": null
}
null
Update from custom URL:
- AddOn.Update HTTP GET Request
- AddOn.Update Curl Request
- AddOn.Update Mos Request
http://192.168.33.1/rpc/AddOn.Update?url="https://example.com/firmware/prosensoraddon-1.1.0.bin"&timeout=600
curl -X POST -d '{"id":1,"method":"AddOn.Update","params":{"url":"https://example.com/firmware/prosensoraddon-1.1.0.bin","timeout":600}}' http://${SHELLY}/rpc
mos --port ${PORT} call AddOn.Update '{"url":"https://example.com/firmware/prosensoraddon-1.1.0.bin","timeout":600}'
Response
- AddOn.Update HTTP GET Response
- AddOn.Update Curl Response
- AddOn.Update Mos Response
null
{
"id": 1,
"params": null
}
null
AddPeripheral Attributes
Some peripherals require additional configuration attributes like one wire device address. For every SensorAddon peripheral, component cid can be predefined or will be taken first available.
| Property | Type | Description |
|---|---|---|
| number | Id of component. (optional) |
| string | Address of DS18B20 sensor. (required for DS18B20 sensor) |
| number | IO number on which the sensor is attached (required for ProSensorAddon as it has multiple IOs per peripheral type) |
UpdatePeripheral Attributes
| Property | Type | Description |
|---|---|---|
| string | Address of DS18B20 sensor. (required for DS18B20 sensor) |
| number | IO number on which the sensor is attached (required only for addons that can have multiple peripherals of the same type) |
Examples
Enable / Disable ProSensorAddon examples
Enable ProSensorAddon
- Sys.SetConfig HTTP GET Request
- Sys.SetConfig Curl Request
- Sys.SetConfig Mos Request
http://192.168.33.1/rpc/Sys.SetConfig?config={"device":{"addon_type":"sensor"}}
curl -X POST -d '{"id":1,"method":"Sys.SetConfig","params":{"config":{"device":{"addon_type":"sensor"}}}}' http://${SHELLY}/rpc
mos --port ${PORT} call Sys.SetConfig '{"config":{"device":{"addon_type":"sensor"}}}'
Disable ProSensorAddon
- Sys.SetConfig HTTP GET Request
- Sys.SetConfig Curl Request
- Sys.SetConfig Mos Request
http://192.168.33.1/rpc/Sys.SetConfig?config={"device":{"addon_type":null}}
curl -X POST -d '{"id":1,"method":"Sys.SetConfig","params":{"config":{"device":{"addon_type":null}}}}' http://${SHELLY}/rpc
mos --port ${PORT} call Sys.SetConfig '{"config":{"device":{"addon_type":null}}}'
SensorAddon.AddPeripheral examples
Add Digital Input on IO 0
- SensorAddon.AddPeripheral HTTP GET Request
- SensorAddon.AddPeripheral Curl Request
- SensorAddon.AddPeripheral Mos Request
http://192.168.33.1/rpc/SensorAddon.AddPeripheral?type="digital_in"&attrs={"cid":100,"io":0}
curl -X POST -d '{"id":1,"method":"SensorAddon.AddPeripheral","params":{"type":"digital_in","attrs":{"cid":100,"io":0}}}' http://${SHELLY}/rpc
mos --port ${PORT} call SensorAddon.AddPeripheral '{"type":"digital_in","attrs":{"cid":100,"io":0}}'
Response
- SensorAddon.AddPeripheral HTTP GET Response
- SensorAddon.AddPeripheral Curl Response
- SensorAddon.AddPeripheral Mos Response
{
"input:100": {
"io": 0
}
}
{
"id": 1,
"params": {
"input:100": {
"io": 0
}
}
}
{
"input:100": {
"io": 0
}
}
Add Digital Input on IO 1
- SensorAddon.AddPeripheral HTTP GET Request
- SensorAddon.AddPeripheral Curl Request
- SensorAddon.AddPeripheral Mos Request
http://192.168.33.1/rpc/SensorAddon.AddPeripheral?type="digital_in"&attrs={"io":1}
curl -X POST -d '{"id":1,"method":"SensorAddon.AddPeripheral","params":{"type":"digital_in","attrs":{"io":1}}}' http://${SHELLY}/rpc
mos --port ${PORT} call SensorAddon.AddPeripheral '{"type":"digital_in","attrs":{"io":1}}'
Response
- SensorAddon.AddPeripheral HTTP GET Response
- SensorAddon.AddPeripheral Curl Response
- SensorAddon.AddPeripheral Mos Response
{
"input:101": {
"io": 1
}
}
{
"id": 1,
"params": {
"input:101": {
"io": 1
}
}
}
{
"input:101": {
"io": 1
}
}
Add Analog Input on IO 0
- SensorAddon.AddPeripheral HTTP GET Request
- SensorAddon.AddPeripheral Curl Request
- SensorAddon.AddPeripheral Mos Request
http://192.168.33.1/rpc/SensorAddon.AddPeripheral?type="analog_in"&attrs={"io":0}
curl -X POST -d '{"id":1,"method":"SensorAddon.AddPeripheral","params":{"type":"analog_in","attrs":{"io":0}}}' http://${SHELLY}/rpc
mos --port ${PORT} call SensorAddon.AddPeripheral '{"type":"analog_in","attrs":{"io":0}}'
Response
- SensorAddon.AddPeripheral HTTP GET Response
- SensorAddon.AddPeripheral Curl Response
- SensorAddon.AddPeripheral Mos Response
{
"input:100": {
"io": 0
}
}
{
"id": 1,
"params": {
"input:100": {
"io": 0
}
}
}
{
"input:100": {
"io": 0
}
}
Add Analog Input on IO 1
- SensorAddon.AddPeripheral HTTP GET Request
- SensorAddon.AddPeripheral Curl Request
- SensorAddon.AddPeripheral Mos Request
http://192.168.33.1/rpc/SensorAddon.AddPeripheral?type="analog_in"&attrs={"io":1}
curl -X POST -d '{"id":1,"method":"SensorAddon.AddPeripheral","params":{"type":"analog_in","attrs":{"io":1}}}' http://${SHELLY}/rpc
mos --port ${PORT} call SensorAddon.AddPeripheral '{"type":"analog_in","attrs":{"io":1}}'
Response
- SensorAddon.AddPeripheral HTTP GET Response
- SensorAddon.AddPeripheral Curl Response
- SensorAddon.AddPeripheral Mos Response
{
"input:101": {
"io": 1
}
}
{
"id": 1,
"params": {
"input:101": {
"io": 1
}
}
}
{
"input:101": {
"io": 1
}
}
Add Digital Output
- SensorAddon.AddPeripheral HTTP GET Request
- SensorAddon.AddPeripheral Curl Request
- SensorAddon.AddPeripheral Mos Request
http://192.168.33.1/rpc/SensorAddon.AddPeripheral?type="digital_out"&attrs={"cid":100}
curl -X POST -d '{"id":1,"method":"SensorAddon.AddPeripheral","params":{"type":"digital_out","attrs":{"cid":100}}}' http://${SHELLY}/rpc
mos --port ${PORT} call SensorAddon.AddPeripheral '{"type":"digital_out","attrs":{"cid":100}}'
Response
- SensorAddon.AddPeripheral HTTP GET Response
- SensorAddon.AddPeripheral Curl Response
- SensorAddon.AddPeripheral Mos Response
{
"switch:100": {
"io": 0
}
}
{
"id": 1,
"params": {
"switch:100": {
"io": 0
}
}
}
{
"switch:100": {
"io": 0
}
}
Add DS18B20 sensor on IO/bus 0
- SensorAddon.AddPeripheral HTTP GET Request
- SensorAddon.AddPeripheral Curl Request
- SensorAddon.AddPeripheral Mos Request
http://192.168.33.1/rpc/SensorAddon.AddPeripheral?type="ds18b20"&attrs={"cid":101,"addr":"11:22:33:44:55:66:77:88","io":0}
curl -X POST -d '{"id":1,"method":"SensorAddon.AddPeripheral","params":{"type":"ds18b20","attrs":{"cid":101,"addr":"11:22:33:44:55:66:77:88","io":0}}}' http://${SHELLY}/rpc
mos --port ${PORT} call SensorAddon.AddPeripheral '{"type":"ds18b20","attrs":{"cid":101,"addr":"11:22:33:44:55:66:77:88","io":0}}'
Response
- SensorAddon.AddPeripheral HTTP GET Response
- SensorAddon.AddPeripheral Curl Response
- SensorAddon.AddPeripheral Mos Response
{
"temperature:101": {
"io": 0
}
}
{
"id": 1,
"params": {
"temperature:101": {
"io": 0
}
}
}
{
"temperature:101": {
"io": 0
}
}
Add DS18B20 sensor on IO/bus 1
- SensorAddon.AddPeripheral HTTP GET Request
- SensorAddon.AddPeripheral Curl Request
- SensorAddon.AddPeripheral Mos Request
http://192.168.33.1/rpc/SensorAddon.AddPeripheral?type="ds18b20"&attrs={"cid":102,"addr":"11:22:33:44:55:66:77:99","io":1}
curl -X POST -d '{"id":1,"method":"SensorAddon.AddPeripheral","params":{"type":"ds18b20","attrs":{"cid":102,"addr":"11:22:33:44:55:66:77:99","io":1}}}' http://${SHELLY}/rpc
mos --port ${PORT} call SensorAddon.AddPeripheral '{"type":"ds18b20","attrs":{"cid":102,"addr":"11:22:33:44:55:66:77:99","io":1}}'
Response
- SensorAddon.AddPeripheral HTTP GET Response
- SensorAddon.AddPeripheral Curl Response
- SensorAddon.AddPeripheral Mos Response
{
"temperature:102": {
"io": 1
}
}
{
"id": 1,
"params": {
"temperature:102": {
"io": 1
}
}
}
{
"temperature:102": {
"io": 1
}
}
Add DHT22 sensor on IO 0
- SensorAddon.AddPeripheral HTTP GET Request
- SensorAddon.AddPeripheral Curl Request
- SensorAddon.AddPeripheral Mos Request
http://192.168.33.1/rpc/SensorAddon.AddPeripheral?type="dht22"&attrs={"io":0}
curl -X POST -d '{"id":1,"method":"SensorAddon.AddPeripheral","params":{"type":"dht22","attrs":{"io":0}}}' http://${SHELLY}/rpc
mos --port ${PORT} call SensorAddon.AddPeripheral '{"type":"dht22","attrs":{"io":0}}'
Response
- SensorAddon.AddPeripheral HTTP GET Response
- SensorAddon.AddPeripheral Curl Response
- SensorAddon.AddPeripheral Mos Response
{
"humidity:100": {
"io": 0
},
"temperature:100": {
"io": 0
}
}
{
"id": 1,
"params": {
"humidity:100": {
"io": 0
},
"temperature:100": {
"io": 0
}
}
}
{
"humidity:100": {
"io": 0
},
"temperature:100": {
"io": 0
}
}
Add DHT22 sensor on IO 1
- SensorAddon.AddPeripheral HTTP GET Request
- SensorAddon.AddPeripheral Curl Request
- SensorAddon.AddPeripheral Mos Request
http://192.168.33.1/rpc/SensorAddon.AddPeripheral?type="dht22"&attrs={"io":1}
curl -X POST -d '{"id":1,"method":"SensorAddon.AddPeripheral","params":{"type":"dht22","attrs":{"io":1}}}' http://${SHELLY}/rpc
mos --port ${PORT} call SensorAddon.AddPeripheral '{"type":"dht22","attrs":{"io":1}}'
Response
- SensorAddon.AddPeripheral HTTP GET Response
- SensorAddon.AddPeripheral Curl Response
- SensorAddon.AddPeripheral Mos Response
{
"humidity:101": {
"io": 1
},
"temperature:101": {
"io": 1
}
}
{
"id": 1,
"params": {
"humidity:101": {
"io": 1
},
"temperature:101": {
"io": 1
}
}
}
{
"humidity:101": {
"io": 1
},
"temperature:101": {
"io": 1
}
}
Add Voltmeter on IO 0
- SensorAddon.AddPeripheral HTTP GET Request
- SensorAddon.AddPeripheral Curl Request
- SensorAddon.AddPeripheral Mos Request
http://192.168.33.1/rpc/SensorAddon.AddPeripheral?type="voltmeter"&attrs={"io":0}
curl -X POST -d '{"id":1,"method":"SensorAddon.AddPeripheral","params":{"type":"voltmeter","attrs":{"io":0}}}' http://${SHELLY}/rpc
mos --port ${PORT} call SensorAddon.AddPeripheral '{"type":"voltmeter","attrs":{"io":0}}'
Response
- SensorAddon.AddPeripheral HTTP GET Response
- SensorAddon.AddPeripheral Curl Response
- SensorAddon.AddPeripheral Mos Response
{
"voltmeter:100": {
"io": 0
}
}
{
"id": 1,
"params": {
"voltmeter:100": {
"io": 0
}
}
}
{
"voltmeter:100": {
"io": 0
}
}
SensorAddon.RemovePeripheral example
- SensorAddon.RemovePeripheral HTTP GET Request
- SensorAddon.RemovePeripheral Curl Request
- SensorAddon.RemovePeripheral Mos Request
http://192.168.33.1/rpc/SensorAddon.RemovePeripheral?component="input:100"
curl -X POST -d '{"id":1,"method":"SensorAddon.RemovePeripheral","params":{"component":"input:100"}}' http://${SHELLY}/rpc
mos --port ${PORT} call SensorAddon.RemovePeripheral '{"component":"input:100"}'
Response
- SensorAddon.RemovePeripheral HTTP GET Response
- SensorAddon.RemovePeripheral Curl Response
- SensorAddon.RemovePeripheral Mos Response
null
{
"id": 1,
"params": null
}
null
Remove Digital Output
- SensorAddon.RemovePeripheral HTTP GET Request
- SensorAddon.RemovePeripheral Curl Request
- SensorAddon.RemovePeripheral Mos Request
http://192.168.33.1/rpc/SensorAddon.RemovePeripheral?component="switch:100"
curl -X POST -d '{"id":1,"method":"SensorAddon.RemovePeripheral","params":{"component":"switch:100"}}' http://${SHELLY}/rpc
mos --port ${PORT} call SensorAddon.RemovePeripheral '{"component":"switch:100"}'
Response
- SensorAddon.RemovePeripheral HTTP GET Response
- SensorAddon.RemovePeripheral Curl Response
- SensorAddon.RemovePeripheral Mos Response
null
{
"id": 1,
"params": null
}
null
SensorAddon.UpdatePeripheral example
- SensorAddon.UpdatePeripheral HTTP GET Request
- SensorAddon.UpdatePeripheral Curl Request
- SensorAddon.UpdatePeripheral Mos Request
http://192.168.33.1/rpc/SensorAddon.UpdatePeripheral?component="temperature:100"&attrs={"addr":"40:255:100:6:199:204:149:177"}
curl -X POST -d '{"id":1,"method":"SensorAddon.UpdatePeripheral","params":{"component":"temperature:100","attrs":{"addr":"40:255:100:6:199:204:149:177"}}}' http://${SHELLY}/rpc
mos --port ${PORT} call SensorAddon.UpdatePeripheral '{"component":"temperature:100","attrs":{"addr":"40:255:100:6:199:204:149:177"}}'
Response
- SensorAddon.UpdatePeripheral HTTP GET Response
- SensorAddon.UpdatePeripheral Curl Response
- SensorAddon.UpdatePeripheral Mos Response
null
{
"id": 1,
"params": null
}
null
SensorAddon.GetPeripherals example
- SensorAddon.GetPeripherals HTTP GET Request
- SensorAddon.GetPeripherals Curl Request
- SensorAddon.GetPeripherals Mos Request
http://192.168.33.1/rpc/SensorAddon.GetPeripherals
curl -X POST -d '{"id":1,"method":"SensorAddon.GetPeripherals"}' http://${SHELLY}/rpc
mos --port ${PORT} call SensorAddon.GetPeripherals
Response
- SensorAddon.GetPeripherals HTTP GET Response
- SensorAddon.GetPeripherals Curl Response
- SensorAddon.GetPeripherals Mos Response
{
"digital_in": {
"input:100": {
"io": 0
},
"input:101": {
"io": 1
}
},
"ds18b20": {
"temperature:102": {
"addr": "40:255:100:6:199:204:149:177",
"io": 0
},
"temperature:103": {
"addr": "40:255:100:6:199:204:149:178",
"io": 1
}
},
"dht22": {
"temperature:104": {
"io": 0
},
"humidity:104": {
"io": 0
}
},
"analog_in": {
"input:105": {
"io": 0
}
},
"voltmeter": {
"voltmeter:106": {
"io": 1
}
},
"digital_out": {
"switch:107": {
"io": 0
}
}
}
{
"id": 1,
"params": {
"digital_in": {
"input:100": {
"io": 0
},
"input:101": {
"io": 1
}
},
"ds18b20": {
"temperature:102": {
"addr": "40:255:100:6:199:204:149:177",
"io": 0
},
"temperature:103": {
"addr": "40:255:100:6:199:204:149:178",
"io": 1
}
},
"dht22": {
"temperature:104": {
"io": 0
},
"humidity:104": {
"io": 0
}
},
"analog_in": {
"input:105": {
"io": 0
}
},
"voltmeter": {
"voltmeter:106": {
"io": 1
}
},
"digital_out": {
"switch:107": {
"io": 0
}
}
}
}
{
"digital_in": {
"input:100": {
"io": 0
},
"input:101": {
"io": 1
}
},
"ds18b20": {
"temperature:102": {
"addr": "40:255:100:6:199:204:149:177",
"io": 0
},
"temperature:103": {
"addr": "40:255:100:6:199:204:149:178",
"io": 1
}
},
"dht22": {
"temperature:104": {
"io": 0
},
"humidity:104": {
"io": 0
}
},
"analog_in": {
"input:105": {
"io": 0
}
},
"voltmeter": {
"voltmeter:106": {
"io": 1
}
},
"digital_out": {
"switch:107": {
"io": 0
}
}
}
SensorAddon.OneWireScan example
- SensorAddon.OneWireScan HTTP GET Request
- SensorAddon.OneWireScan Curl Request
- SensorAddon.OneWireScan Mos Request
http://192.168.33.1/rpc/SensorAddon.OneWireScan
curl -X POST -d '{"id":1,"method":"SensorAddon.OneWireScan"}' http://${SHELLY}/rpc
mos --port ${PORT} call SensorAddon.OneWireScan
Response
- SensorAddon.OneWireScan HTTP GET Response
- SensorAddon.OneWireScan Curl Response
- SensorAddon.OneWireScan Mos Response
{
"devices": [
{
"type": "ds18b20",
"addr": "40:255:100:6:199:204:149:177",
"component": null,
"io": 0
},
{
"type": "ds18b20",
"addr": "40:255:100:6:199:204:149:178",
"component": "temperature:100",
"io": 0
},
{
"type": "ds18b20",
"addr": "40:255:100:6:199:204:149:179",
"component": null,
"io": 1
}
]
}
{
"id": 1,
"params": {
"devices": [
{
"type": "ds18b20",
"addr": "40:255:100:6:199:204:149:177",
"component": null,
"io": 0
},
{
"type": "ds18b20",
"addr": "40:255:100:6:199:204:149:178",
"component": "temperature:100",
"io": 0
},
{
"type": "ds18b20",
"addr": "40:255:100:6:199:204:149:179",
"component": null,
"io": 1
}
]
}
}
{
"devices": [
{
"type": "ds18b20",
"addr": "40:255:100:6:199:204:149:177",
"component": null,
"io": 0
},
{
"type": "ds18b20",
"addr": "40:255:100:6:199:204:149:178",
"component": "temperature:100",
"io": 0
},
{
"type": "ds18b20",
"addr": "40:255:100:6:199:204:149:179",
"component": null,
"io": 1
}
]
}