Flood
The Flood component handles the monitoring of device's flood sensors. Flood components are identified with flood:<id>
in objects containing multiple component payloads.
The Flood component uses Flood
as RPC namespace and implements the minimal component interface:
Flood.GetConfig
to obtain the component's configurationFlood.SetConfig
to update the component's configurationFlood.GetStatus
to obtain the component's status
Methods
Flood.SetConfig
Property | Type | Description |
---|---|---|
| number | Id of the Flood component instance |
| object | Configuration that the method takes |
Find more about the config properties in config section
Flood.GetConfig
Property | Type | Description |
---|---|---|
| number | Id of the Flood component instance |
Find the Flood.GetConfig response properties in config section
Flood.GetStatus
The status of the Flood component represents the alarm and mute state of the associated flood sensor. To obtain the status of the Flood component its id
must be specified.
Properties:
Property | Type | Description |
---|---|---|
| number | Id of the Flood component instance |
Find more about the status response properties in status section
Configuration
The configuration of the Flood component allows to adjust the Flood alarm_mode
. To Get/Set the configuration of the Flood component its id
must be specified.
Properties:
Property | Type | Description |
---|---|---|
| number | Id of the Flood component instance |
| string or null | Name of the Flood instance. |
| string or null | Configuration of sound made on alarm. Accepted values are |
| number | Time waited before reporting flood status. For this period status must be steady. Accepted values are between |
Status
The status of the Flood component represents the alarm and mute state of the associated flood sensor. To obtain the status of the Flood component its id
must be specified.
Properties:
Property | Type | Description |
---|---|---|
| number | Id of the Flood component instance |
| boolean | Alarm state |
| boolean | Mute state |
| array of type string | Error conditions occurred. May contain |
Webhook Events
There are two events related to the Flood component that can trigger webhooks:
flood.alarm
- produced when flood alarm is triggeredflood.alarm_off
- produced when flood alarm goes offflood.cable_unplugged
- produced when cable for flood detection is unplugged
Examples
Flood.SetConfig example
- Flood.SetConfig HTTP GET Request
- Flood.SetConfig Curl Request
- Flood.SetConfig Mos Request
http://192.168.33.1/rpc/Flood.SetConfig?id=0&config={"name":"Flood0"}
curl -X POST -d '{"id":1,"method":"Flood.SetConfig","params":{"id":0,"config":{"name":"Flood0"}}}' http://${SHELLY}/rpc
mos --port ${PORT} call Flood.SetConfig '{"id":0,"config":{"name":"Flood0"}}'
Response
- Flood.GetStatus HTTP GET Response
- Flood.GetStatus Curl Response
- Flood.GetStatus Mos Response
{
"restart_required": false
}
{
"id": 1,
"src": "shellyplusht-441793cc9d30",
"params": {
"restart_required": false
}
}
{
"restart_required": false
}
Flood.GetConfig example
- Flood.GetConfig HTTP GET Request
- Flood.GetConfig Curl Request
- Flood.GetConfig Mos Request
http://192.168.33.1/rpc/Flood.GetConfig?id=0
curl -X POST -d '{"id":1,"method":"Flood.GetConfig","params":{"id":0}}' http://${SHELLY}/rpc
mos --port ${PORT} call Flood.GetConfig '{"id":0}'
Response
- Flood.GetConfig HTTP GET Response
- Flood.GetConfig Curl Response
- Flood.GetConfig Mos Response
{
"id": 0,
"name": null,
"alarm_mode": "normal"
}
{
"id": 1,
"src": "shellyplusht-441793cc9d30",
"params": {
"id": 0,
"name": null,
"alarm_mode": "normal"
}
}
{
"id": 0,
"name": null,
"alarm_mode": "normal"
}
Flood.GetStatus example
- Flood.GetStatus HTTP GET Request
- Flood.GetStatus Curl Request
- Flood.GetStatus Mos Request
http://192.168.33.1/rpc/Flood.GetStatus?id=0
curl -X POST -d '{"id":1,"method":"Flood.GetStatus","params":{"id":0}}' http://${SHELLY}/rpc
mos --port ${PORT} call Flood.GetStatus '{"id":0}'
Response
- Flood.GetStatus HTTP GET Response
- Flood.GetStatus Curl Response
- Flood.GetStatus Mos Response
{
"id": 0,
"alarm": true,
"mute": false
}
{
"id": 1,
"src": "shellyplusht-441793cc9d30",
"params": {
"id": 0,
"alarm": true,
"mute": false
}
}
{
"id": 0,
"alarm": true,
"mute": false
}