Using Custom Control Plugin - User inputs?

I am trying to create a button that sends the printhead to the XY job start and allow the user to enter the coordinates. Here are the settings I have tried:

Name: Go to Start X
Commands: G0 X{{ x }}

User Inputs - checked
Name: x
Parameter: x
Default: - left blank

What am I not understanding?

I think should be Command: G0 X%(x)s based on the default custom control documentation. Not sure what the plugin does to potentially convert that info.

Hello jeilliii,

I seemed to have deleted the post about creating a reporting button of XYZ coordinates. I did read your reply before deleting. I put M114 in the Terminal and it reported this:

Recv: X:0.00 Y:0.00 Z:0.00 E:0.00 Count X:0 Y:0 Z:0

This is what I was using that did not work.

"X:([-+]?[0-9.]+) Y:([-+]?[0-9.]+) Z:([-+]?[0-9.]+) E:([-+]?[0-9.]+)"
"Position: X={0}, Y={1}, Z={2}, E={3}"

I tried removing the " " on just the Regex and then on Template. Still not working.

However, it does report in the Terminal, both ways.

It just does not report next to the button. That is what it is supposed to do, report XYZ coordinates just to the right of the button? Am I correct?

Any thoughts...

-   children:
    -   command: M114
        default: ''
        name: Get Position
        regex: X:([-+]?[0-9.]+) Y:([-+]?[0-9.]+) Z:([-+]?[0-9.]+) E:([-+]?[0-9.]+)
        template: 'Position: X={0}, Y={1}, Z={2}, E={3}'
    layout: horizontal
    name: Position
    type: section

Press the button and get this...


It worked! What was missing was the single quotes at beginning and end of template text. Thank you very much.

I love this plugin...did you create it?

No this is not my plugin, and technically you don't even need a plugin to be able to do this. The functionality is built into OctoPrint, as documented here. I don't use the plugin myself as there have been reports of the customizations getting wiped out, so I recommend once you get it set up the way you like it you might want to disable the plugin. The buttons you add will still be available.