-
Notifications
You must be signed in to change notification settings - Fork 0
API Reference
All responses are returned in JSON format.
- Status Request:
http://[device-ip]/relays - Switch Command:
http://[device-ip]/relays?switch=1,0,1,1
The number of values behind the switch parameter must correspond to the number of relays. The value 1 switches the relay on, 0 switches it off.
- Toggle Command:
http://[device-ip]/relays?toggle=1,0,1,1
The number of values behind the parameter switch must correspond to the number of relays. The value 1 causes the relay to toggle, 0 leaves its state unchanged.
Examples:
- total of 4 relays, relay 2 will be toggled:
http://[device-ip]/relays?toggle=0,1,0,0 - total of 3 relays, relay 1&3 will be switched on:
http://[device-ip]/relays?switch=1,0,1
You can toggle the relay state by sending the following JSON object to: http://[device-ip]/json
Switch relay 0 on: {"PowerManager":{"relay":0,"on":true}}
Switch relay 3 and 4 off: {"PowerManager":[{"relay":2,"on":false},{"relay":3,"on":false}]}
-
wled/deviceMAC/relay/0/commandon|off|toggle -
wled/deviceMAC/relay/1/commandon|off|toggle
When a relay is switched, a message is published:
-
wled/deviceMAC/relay/0on|off
This page is generated from the usermod's in-tree readme (usermods/PowerManager/readme.md) by sync_wiki.py - edit there, not here.