I guess I need a little syntax help , here's what I'm doing
{REPLACE "M106 S89 P2" "SET_FAN_SPEED FAN=chamber_cooling_fan SPEED="[fan2_speed_percentage]}
this does the replace, but still leaves the line without a value like: SET_FAN_SPEED FAN=chamber_cooling_fan SPEED=
the fan is defined as T2 fan type as environmental (not extruder mounted) although I have tested both with the same result. The Marlin M106 SXX P2 does show the correct fan index (P2)
So I have a couple of questions
- Is it possible to do simple math e.g. [fan2_speed_percentage]/100 because Klipper expects 0-1 ie. .35 for 35%
- Syntax for the replace command to replace the M106 SXX P2 command with a literal string and the fan percentage. Depending on what I set the fan to in the software, the replace command will do an S value from 0-255 and I'd like to just search for any value and then provide that value to the Klipper equivalent in [fan2_speed_percentage] REGEX? or ??
- what is the syntax needed to get both the replacement string and the variable value?
This is not correct: {REPLACE "M106 S89 P2" "SET_FAN_SPEED FAN=chamber_cooling_fan SPEED="[fan2_speed_percentage]}