Adding my own buttons to the Control tab (system commands, not gcode)

I was hoping plugin "Custom Control Editor" would be what I was looking for But it did not work the way I thought it would. Instead I have found "System Command Editor", that does what I need partially.

So I am looking for a way to put a button on the control tab to execute a system command. I have that working in the "System" drop down menu but that's an inconvenient location for my needs. Is there some way to either have a copy of my customized "System" commands on the control tab or can I add a button to the control tab somehow manual ?

In the config.yaml the System Buttons show up ad follows:

system:
  actions:
  - action: Turn on the LED Light
    command: /usr/bin/wget -q -O /dev/null http://A.B.C.D/set.cmd?user=user+pass=pass+cmd=setpower+p61=1
    name: LED On
  - action: Turn off the LED light
    command: /usr/bin/wget -q -O /dev/null http://A.B.C.D/set.cmd?user=user+pass=pass+cmd=setpower+p61=0
    name: LED Off

So I would like to add the buttons "LED On" and "LED Off" with the system command called to the control tab. This is controlling a simple Network controlled power switch to switch the LED flood light above the printer on and off.

Hardware: R-Pi 3B, Revison: 2a02082
OctoPrint 1.3.9
OctoPi 0.15.1

1 Like

I know that the System pull-down menu at the top is what foosel would probably suggest but I like to put my buttons on the Control tab and then to style them so that they're on the same line.

I use the Gcode System Commands plugin to first create a pair of pseudo Gcode commands for things like you're doing above. For example, I might issue 900 and 901 to turn OFF/ON something.

Next, I'll manually edit the ~/.octoprint/config.yaml file's controls section using those new OCTO900 and OCTO901 commands, as created.

Finally, I'll use the Themeify plugin so that the buttons style as inline blocks. See form.custom_control in this thread.

2 Likes

That's just perfect, the OCTO codes work like a charme !! Got me what I wanted for now. I have not yet looked into the Themeify plugin to customise the buttons but I have them in the Control tab now.

Thanks a lot OutsourcedGuru !
Regards
Jan P.

1 Like

Just to add to this, the OCTO gcodes are really nice to use. I have added some stuff to Gcode Scripts to the section "After print job completes"

G4 S240
OCTO90

That waits for 240 seconds and then switches off my LED light. All kind of nice things are possible here. I love it.

Jan P.

could you make 2 commands to turn on and off the webcams hooked up via a ribbon cable

Hey guys,

Thanks a lot for this perfect solution!
After a few tries, i reconigzed, that i should use OCTO900, instead of G901 as GCODE.

Regards,
Matteo