Feature Request: Shell Script Toggle & outputs via API Call #362

Open
opened 2020-10-26 01:41:09 +00:00 by trv-in-3d · 0 comments
trv-in-3d commented 2020-10-26 01:41:09 +00:00 (Migrated from github.com)

I have a 4 relay hat on my pi and have 8 outputs configured using shell script (eg:
Relay 1 on: ic2set -y 1 0x10 0x01 0xff
Relay 1 off: ic2set -y 1 0x10 0x01 0x00
Relay 2 on: ....

)

I can't seem to get the API web calls to trigger these outputs.
http://{ip}/plugin/enclosure/setIO?apikey={mykey}&index_id=1&status=TRUE

returns a {"success":true} json, but the process isn't actually triggered.

Feature requests:

  1. A way to define both the ON and OFF for shell scripts for a single ID so that I would only have to define 4 outputs that could be toggled. For example:
    Label: Relay 1 {required}
    ID: 1 {required}
    Script ON/TRUE: {required} - works like current implementation. - UI has a "execute script" button
    Script OFF/FALSE: {optional} - if defined, UI would have ON/OFF buttons for this output instead of an "execute Script" button.

  2. A way to be able to call these shell script outputs via the API. Now the STATUS=TRUE/FALSE would make sense for shell scripts.

I have a 4 relay hat on my pi and have 8 outputs configured using shell script (eg: _Relay 1 on: ic2set -y 1 0x10 0x01 0xff Relay 1 off: ic2set -y 1 0x10 0x01 0x00 Relay 2 on: ...._ ) I can't seem to get the API web calls to trigger these outputs. _http://{ip}/plugin/enclosure/setIO?apikey={mykey}&index_id=1&status=TRUE_ returns a {"success":true} json, but the process isn't actually triggered. Feature requests: 1) A way to define both the ON and OFF for shell scripts for a single ID so that I would only have to define 4 outputs that could be toggled. For example: **Label:** _Relay 1_ {required} **ID:** _1_ {required} **Script ON/TRUE:** {required} - works like current implementation. - UI has a "execute script" button **Script OFF/FALSE:** {optional} - if defined, UI would have ON/OFF buttons for this output instead of an "execute Script" button. 2) A way to be able to call these shell script outputs via the API. Now the STATUS=TRUE/FALSE would make sense for shell scripts.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Gandalf/OctoPrint-Enclosure#362