OctoPrint-Telegram icon indicating copy to clipboard operation
OctoPrint-Telegram copied to clipboard

[Feature Request] Enclosure plugin integration

Open vitormhenrique opened this issue 7 years ago • 8 comments

Hello,

I'm the author of the octoprint-enclosure plugin. Some users have requested be to integrate my plugin with yours, so far I had no idea on how to implement such a thing, but Gina (one of the authors of octoprint) helped out and showed me the light at the end of the tunnel.

First, explaining what my plugin does: it is meat to be used on raspberry pi to control it's IO, using as input or outputs. You can control lights, fans, external heaters, add RGB led strips. Inputs (like buttons, or smoke sensors) can be used to control outputs, you can add external temperature sensors for measure and control the temperature of the enclosure, etc....

Everything documented here: https://github.com/vitormhenrique/OctoPrint-Enclosure

So few users asked me for the ability to have some of that functionality using the Telegram plugin. Instead of forking and merging and maintaining both of the plugins, Gina gave me a much better solution. Telegram can create a custom hook, to provide additional commands or extend status reports.

So you could create hooks asking for the pin setups, pin status, setting pin status etc, and I could implement those hooks on my plugin. That would make it possible for someone to basically use the octoprint-enclosure plugin using the telegram app.

You can see the original request here: https://github.com/vitormhenrique/OctoPrint-Enclosure/issues/48

Best regards

vitormhenrique avatar Jul 13 '17 15:07 vitormhenrique

I do think about hooks for a long time. But it will be a lot work to implement them correctly. I can't promise wether or when i will do this. But it will be a great feature. Thanks for your inquiry.

derpicknicker1 avatar Jan 04 '18 15:01 derpicknicker1

Hello, any progress in that integration?

kaju666 avatar Feb 01 '18 06:02 kaju666

Hello, any progress? I use both, your telegram plugin and enclosure, would be great to see both working together. I would help but my programming skills are flat. :-(

xinuxnt avatar Oct 10 '19 19:10 xinuxnt

I guess this is a good time to raise those skills then...

As I don't have an enclosure, I have no need for such addition, thus.... 😄 Maybe someone else is willing to pick this task, but my advice is to challenge yourself on the holy path of programming 😉

rlogiacco avatar Oct 11 '19 00:10 rlogiacco

Hi guys,

I follow up this feature. Should be really useful to manage remotely the integrations from Octoprint-Enclosure.

I tried to look the source code, but in a first look it's seems not simple to write this update. There is a short guide or example to help for this issue?

rbonghi avatar Nov 18 '19 15:11 rbonghi

Hello,

Just an idea, would it be possible to make it work through control commands? Maybe it would be easier than implement hooks in telegram plugin?

skandinaff avatar Nov 02 '20 08:11 skandinaff

Hello. this feature would be incredible. How it can be made? Maybe i can help.

bluecraank avatar Dec 17 '20 12:12 bluecraank

Hey there, I wanted to switch on my Lights(inside the Enclosure-plugin) via Telegram-plugin in, too. And now I had found a solution, which works for me. My aim was to prepare my Printer for the next status-Picture and turn on the light.

My solution was in first place the /gcode-Command inside the telegram-bot, to send the specific Enclosure-GCODE like: /gcode_ENC O1 S1
this will switch on the first Output in the Enclosure-Plugin.

After some testing and searching i found this Post for automatic Pre-Snapshot activation and a little Timeout: https://github.com/fabianonline/OctoPrint-Telegram/issues/358#issuecomment-1002769653

and so i also added a pre- and Post-routine for /status-Command: Pre-Image-Action: as System-Command curl -X PATCH -H 'Content-Type: application/json' -H "X-Api-Key: xxxx-YOURAPI-KEY-xxxx" -i 'http://localhost/plugin/enclosure/outputs/1' --data '{ "status":true }' && sleep 2

Post-Image-Action: as GCODE-Command: /gcode_ENC O1 S0

Why did i use System-Command for the Pre-Action? --> With this i could use this "sleep"-function and it won't interrupt my print

Hope this helps markus

TheBolzer avatar Apr 22 '23 13:04 TheBolzer