Custom Control Editor support jinga2?

Does anyone know if the Custom Control Editor commands support jinga2?

I want to put a condition that checks to see if the extruder is heated and only runs the custom load and unload commands if the extruder temperature is at least 210C. I don't want to put the temperature in the commands list as that can change depending on the filament and I might be doing things manually so I though of this to at least check to see if it is above 210C before running them.

I tried it and it doesn't appear to be working. I put a jinga2 condition in, set the extruder temp to 205C, waited for it to get to 205C, and then clicked on the custom control and it still ran the commands when I clicked the unload filament button that I configured.

I have a Wanhao Duplicator 9 with only 1 extruder. I set up the commands like this.

Unload Filament


{% if last_temperature[0]['actual'] >= 210 %}
G92 E0; reset position of extruder
G1 E12 F80 ;Extrude 10mm of filament to avoid blob
G92 E0 ; reset position of extruder
G1 E-100 F2000 ; Retract 700 mm quickly
G92 E0 ; reset position of the extruder
M117 Remove filament now ; display message on LCD
{% endif %}

It does:

I don't know if the last_temperature template variable is available, but if it is you probably have to use[0].

Thanks for the input on this. I tried[0]['actual'] and it still ran the commands at 205C. I am surprised it would run the commands even if the template were not available because if last_temperature doesn't exist, wouldn't the expression fail somehow or make the if condition false? Unless jinga2 only works as a script and not 'commands' and it ignores those lines.

Looking closer at the documentation, It mentions that that templates are available for the 'script' but that same note is not in the 'commands' section. I wonder if that is the reason it isn't working (not supported as 'commands') or if the note is supposed to be in the 'commands' section too and I just don't understand how to make it work yet.

Under the 'scripts' section but not the 'commands' section...

Values of input parameters will be available in the template context under the parameter variable (e.g. an input parameter speed will be available in the script template as parameter.speed ). On top of that all other variables defined in the GCODE template context will be available.