vitormhenrique / OctoPrint-Enclosure

OctoPrint Enclosure Plugin
GNU General Public License v3.0
396 stars 201 forks source link

[FEATURE REQUEST] TP-Link on/off with dht22 data #309

Open renorr3d opened 4 years ago

renorr3d commented 4 years ago

Hi, First thanks for your plugin ! I do have a request though, I don't know if its totally impossible or an easy fix so i'll try to describe the thing.

I use TP-LINK plugin to plug the heater I use to warm my enclosure. I also use enclosure plugin to gather data with dht22 sensor and to turn on/off fans I dont really want to connect my 1500w heater on a mosfet to the Pi like I have done for the fans. Is it possible to add a feature like a thermal runaway monitoring but with the data gathered by the dht22 through enclosure plugin ? This will turn off and on the heater to maintain a constant temperature in the enclosure. It would be perfect if I could set a maximum temp auto shutdown in case I forgot to shut it down. And an On/off range like 45-50 to automatically turn the heater on and off to stay in the range.

Don't know if I explained the thing very well.. Thanks for your return.

renorr3d commented 4 years ago

Hi there, I ve the Gcode command to turn on and off the tp link plug, thanks to jneilliii :

ON

curl --insecure --silent --header "Content-Type: application/json" --header "X-Api-Key: " --request POST --data-binary '{"command":"turnOn","ip":"192.168.0.130"}' "http://localhost:5000/api/plugin/tplinksmartplug"

OFF

curl --insecure --silent --header "Content-Type: application/json" --header "X-Api-Key: " --request POST --data-binary '{"command":"turnOff","ip":"192.168.0.130"}' "http://localhost:5000/api/plugin/tplinksmartplug"

I have made two Gcode output to turn On and Off but did not find a way to link thoses event to the temperature sensor. If someone have an idea.

Thanks