Custom button, that fires an html command

So it went much faster than anticipated. Probably will require some tweaking to work with real WeMo devices, but without one available to me I have to assume my emulated version on the tasmota device is the same.

OctoPrint-WemoSwitch

Wohooo! Thanks for that much input. You're great!

I'll go for OutsourceGurus solution.
My central doesn't understand MQTT without plugins, and, yeah, it is that easy, without any authorization, as it is all within it's own network.

Thanks everyone!

Uh... my config.yaml is really short compared to the stuff from the docs.

http://docs.octoprint.org/en/master/features/custom_controls.html#sec-features-custom-controls
Says i should have (create?) a section "controlls", and show's a nice example. But all i see is about gcode commands send to the printer... so i don't see how i get a shellscript run from here.
Ether i'm missing something, or it is more easy than what i can think of... any ideas where to look?

Custom controls on the "Control" tab indeed can't fire shell scripts (at least now without writing a plugin that provides custom controls that does that through JS... but I digress). However, something like outlet switching actually sounds more like something that should go into the System Menu only available to admins anyhow, and that does allow adding shell scripts. Take a look at that section in the docs instead.

Or alternatively install the PSU Control plugin by @kantlivelong and have that take care of everything for you.

Thanks! I'l have a look at the system menu section.

So... short feedback: It works.
I just added the system: action: section at the end of my config.yaml, wrote some nice text, at "command" the curl command, saved, restarted octoprint, and... done.

Thanks everyone!

And for everyone with a similar quest:

system:
  actions:
    - name: Drucker an
      action: Drucker an
      command: curl "http://10.10.20.10/config/xmlapi/statechange.cgi?ise_id=15906&new_value=1"
    - name: Drucker aus
      action: Drucker aus
      command: curl "http://10.10.20.10/config/xmlapi/statechange.cgi?ise_id=15906&new_value=0"
      confirm: Drucker wirklcih ausschalten? Laeuft ein Druckjob? Ist er abgekuehlt? Echt jetzt?

1 Like

I love that confirmation message :joy:

1 Like

annnnd I love google translate.

I was getting to that. You then add the Gcode System Commands into the mix and magic happens.

Ah, right, that's of course an option too :sweat_smile:

Hi,
are there any news in connecting Octoprint with Homematic CCU2? I´m new in 3D-Printing and would like to know what kind of plugin I need on Homematic- and Octoprintside to connect them together (e.g. for Power of when ready or in case of a failure)

Best regards and many thanks in advance
Jochen

Hi Jochen,

there ain't any Plugin, neither on the octoprint nor the homematic side for connecting anything.
I'm using a HM-Plug that measures the used power ( HM-ES-PMSw1-Pl ), and switches the printer off half an our after the print is done. If you need help with the CCU2 program let me know.

On the octoprint side i use the tweak mentioned above to switch that plug on or off from the octoprint WEBGui.

That's all, but it works flawless and does all i want.

Regards,
Sven

Hi Sven,

O.K., that means I´ve to use the IP-Adress of my CCU2, that´s clear. But how do you know the id of the HM-Plug; is this the serial number?

http://10.10.20.10/config/xmlapi/statechange.cgi?ise_id=15906&new_value=1"

Best regards

Jochen

First of all you need the XML API Plugin for the CCU2:
https://www.homematic-inside.de/addons

Then you need to find the internal ID of that plug. Right now I'm at my mobile, didn't find the right link. Ether wait till tomorrow, or have a look for "ISEID" at the Homematic forum.

Hth,
Sven

Hi Sven,
since I´ve installed the "XML API Plugin for the CCU2" it works perfect :slight_smile: Thanks a lot.

Do you have some example codes when you use this inside octoprint? I think it would be great in cases like:

  • if Extruder_Temp > 280° orr
  • If Bed-Temp > xxx
  • …..

Do you have some good usecase when you use this? I´ve already used the smoke-warner inside Homematic to power-off the Printer when there is smoke detected :slight_smile:
Best regards and many thanks again
Jochen

Edit: Tested it with TemperatureFailsafe --> works perfect. If you have any additional ideas feel free … :slight_smile:
Many thanks and best regards
Jochen

Nah... as i said: I only have inserted the "Printer On/Printer Off" to the gui, so i can remotly switch on my printer via Octoprint GUI.
And half a hour after finishing a print job (measured by power consumtion of the printer) my CCU switches the printer off.
A half hour is enough to let it cool down, remove the print and start a new one if i want. Otherwise the printer and the lights in the enclosure gets switched off.

Thought about the smoke detector too. But never did it, i had 2 false alarms the past 3 years. And if the printer really starts a fire that the smoke detector starts, it's fucking to late to switch the printer off, nothing to gain here.

Temp Failsafe is a nice idea. But than again: I think it's more likely that the plugin gets a false temp rather then a thermal runaway of the printer. I try to keep things simple.

But great i could help you, you're welcome.

I might disagree with you there. Usually with fires caused by electronics and heating elements, there is smoke before there is fire. And if you've ever tried to start a campfire in the woods, you'll know that it takes a lot to keep a fire going. There will be smoke before the fire is in a self-sustaining mode.

So if you can remove the power then the fire won't get enough of a start to keep going.

Ok, you have a point there. Thanks!
As my printer is in an enclosure i'm still not sure if the smoke would get out before it's to late. But it neverless would be a good idea to implement that.

Put the detector into the enclosure then.

Thought about that. I'm not entirely sure if that is a good idea. Won't there be any false alarms going off while printing? Not that i ever had any smoke from my printings, but there sure a some kind of vapors from the melted plastic. Has anyone done that before?