Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Enclosure plugin Outputs as configurable actions #1123

Closed
haplm opened this issue Oct 24, 2020 · 4 comments · Fixed by #1438
Closed

Add Enclosure plugin Outputs as configurable actions #1123

haplm opened this issue Oct 24, 2020 · 4 comments · Fixed by #1438
Labels
enhancement New feature or request
Projects

Comments

@haplm
Copy link

haplm commented Oct 24, 2020

Is your feature request related to a problem? Please describe.
I would like to turn LED on my enclosure ON and OFF with OctoDash. However, I'm not using Neopixel, but 12V LEDs controlled by a relay attached to one of the RPi GPIO pins. That pin is configured in Enclosure plugin as output (http://octopi.local/plugin/enclosure/outputs) like this:
[{"index_id": 1, "label": "LED"}]

Describe the solution you'd like
Include Enclosure outputs as predefine actions (https://github.com/UnchartedBull/OctoDash/wiki/Custom-Actions#predefined-actions)

Thanks!

@haplm haplm added the enhancement New feature or request label Oct 24, 2020
@UnchartedBull UnchartedBull added this to To do in v3 Release via automation Oct 26, 2020
@UnchartedBull UnchartedBull moved this from To do to In progress in v3 Release Oct 26, 2020
@jbuszkie
Copy link

Is there a way to do this (work around) until V3 comes out?

@UnchartedBull
Copy link
Owner

I don't know of any. I'm not that familiar with Enclosure Plugin. Best guess would be to check whether you can define custom GCodes and just send those from OctoDash.

@Zapfmeister
Copy link

Zapfmeister commented Feb 16, 2021

Enclosure seems to provide an API to trigger outputs:
https://github.com/vitormhenrique/OctoPrint-Enclosure/wiki/API-Control

You can request all current gpio status with

http://**{URL}**/plugin/enclosure/getOutputStatus?apikey=**{APIKEY}**

Regular GPIO

http://**{URL}**/plugin/enclosure/setIO?status=**{STATUS}**&index_id=**{OUTPUT_ID}**&apikey=**{APIKEY}**

OUTPUT_ID is the automatic generated number id from octoprint-enclosure setting
STATUS is can be true to turn it on and false to turn the output off

It would be great to have a switch available for this. I to actually have a relay connected to my gpios, which switch the power to the printer and led on/off.

@UnchartedBull
Copy link
Owner

I actually wrote that API for the enclosure plugin (mainly to retrieve the temperatures). Should be fairly easy to achieve, it will just be a dumb toggle though, since the custom actions aren't able to handle states.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
No open projects
v3 Release
  
Done
Development

Successfully merging a pull request may close this issue.

4 participants