Temperature
The Temperature component handles the monitoring of device's temperature sensors. Temperature components are identified with temperature:<id> in objects containing multiple component payloads.
The Temperature component uses Temperature as RPC namespace and implements the minimal component interface:
Temperature.GetConfigto obtain the component's configurationTemperature.SetConfigto update the component's configurationTemperature.GetStatusto obtain the component's status
Methods
Temperature.SetConfig
Properties:
| Property | Type | Description |
|---|---|---|
| number | Id of the Temperature component instance |
| object | Configuration that the method takes |
Find more about the config properties in config section
Temperature.GetConfig
Properties:
| Property | Type | Description |
|---|---|---|
| number | Id of the Temperature component instance |
Find the Temperature.GetConfig response properties in config section
Temperature.GetStatus
Properties:
| Property | Type | Description |
|---|---|---|
| number | Id of the Temperature component instance |
Find more about the status response properties in status section
Configuration
The configuration of the Temperature component allows to adjust the temperature report threshold value. To Get/Set the configuration of the Temperature component its id must be specified.
Properties:
| Property | Type | Description |
|---|---|---|
| number | Id of the Temperature component instance |
| string or null | Name of the Temperature instance. |
| number | Temperature report threshold in Celsius. Accepted range is device-specific, default [0.5..5.0]C unless specified otherwise |
| number | Offset in Celsius to be applied to the measured temperature. Accepted range is device-specific, default [-50.0 .. 50.0] unless specified otherwise |
Status
The status of the Temperature component represents the measurement of the associated temperature sensor. To obtain the status of the Temperature component its id must be specified.
| Property | Type | Description |
|---|---|---|
| number | Id of the Temperature component instance |
| number or null | Temperature in Celsius ( |
| number or null | Temperature in Fahrenheit ( |
| array of type string | Shown only if at least one error is present. May contain |
Webhook Events
There are two events related to the Temperature component that can trigger webhooks:
temperature.change- produced when temperature delta between two measurements is greater thanreport_thr_Ctemperature.measurement- produced on a monotonic measurement period (60s)
temperature.change and temperature.measurement support two attributes, that can be used to compose conditional webhooks:
| Property | Type | Description |
|---|---|---|
| number | New temperature in Celsius |
| number | New temperature in Fahrenheit |
Examples
Temperature.SetConfig example
- Temperature.SetConfig HTTP GET Request
- Temperature.SetConfig Curl Request
- Temperature.SetConfig Mos Request
http://192.168.33.1/rpc/Temperature.SetConfig?id=0&config={"name":"Temperature0"}
curl -X POST -d '{"id":1,"method":"Temperature.SetConfig","params":{"id":0,"config":{"name":"Temperature0"}}}' http://${SHELLY}/rpc
mos --port ${PORT} call Temperature.SetConfig '{"id":0,"config":{"name":"Temperature0"}}'
Response
- Temperature.SetConfig HTTP GET Response
- Temperature.SetConfig Curl Response
- Temperature.SetConfig Mos Response
{
"restart_required": false
}
{
"id": 1,
"src": "shellyplusht-441793cc9d30",
"params": {
"restart_required": false
}
}
{
"restart_required": false
}
Temperature.GetConfig example
- Temperature.GetConfig HTTP GET Request
- Temperature.GetConfig Curl Request
- Temperature.GetConfig Mos Request
http://192.168.33.1/rpc/Temperature.GetConfig?id=0
curl -X POST -d '{"id":1,"method":"Temperature.GetConfig","params":{"id":0}}' http://${SHELLY}/rpc
mos --port ${PORT} call Temperature.GetConfig '{"id":0}'
Response
- Temperature.GetConfig HTTP GET Response
- Temperature.GetConfig Curl Response
- Temperature.GetConfig Mos Response
{
"id": 0,
"name": null,
"report_thr_C": 0.5,
"offset_C": 0
}
{
"id": 1,
"src": "shellyplusht-441793cc9d30",
"params": {
"id": 0,
"name": null,
"report_thr_C": 0.5,
"offset_C": 0
}
}
{
"id": 0,
"name": null,
"report_thr_C": 0.5,
"offset_C": 0
}
Temperature.GetStatus example
- Temperature.GetStatus HTTP GET Request
- Temperature.GetStatus Curl Request
- Temperature.GetStatus Mos Request
http://192.168.33.1/rpc/Temperature.GetStatus?id=0
curl -X POST -d '{"id":1,"method":"Temperature.GetStatus","params":{"id":0}}' http://${SHELLY}/rpc
mos --port ${PORT} call Temperature.GetStatus '{"id":0}'
Response
- Temperature.GetStatus HTTP GET Response
- Temperature.GetStatus Curl Response
- Temperature.GetStatus Mos Response
{
"id": 0,
"tC": 24.4,
"tF": 75.9
}
{
"id": 1,
"src": "shellyplusht-441793cc9d30",
"params": {
"id": 0,
"tC": 24.4,
"tF": 75.9
}
}
{
"id": 0,
"tC": 24.4,
"tF": 75.9
}