Found this old post that gave me a hint.
So sending the following
M106 P4
M408 S0 R1
to Duet via the Panel Due port gives me the data I want. Response to the M408 is
{"status":"I","heaters":[21.5,21.1],"active":[0.0,0.0],"standby":[0.0,0.0],"hstat":[0,2],"pos":[0.000,0.000,0.000],"machine":[0.000,0.000,0.000],"sfactor":100.00,"efactor":[100.00],"babystep":0.000,"tool":0,"probe":"525","fanPercent":[0.0,0,0,0,24,100,100,-1,-1,-1,-1,-1,-1],"fanRPM":[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],"homed":[0,0,0],"msgBox.mode":-1,"seq":20,"resp":"Fan 4 (Enclosure Fans), speed: 100%, min: 40%, max: 100%, blip: 0.10, temperature: 26.0:65.0C, sensors: 2 3, current speed: 40%:\n"}
with the message text in the "resp" field at the end of the JSON response. Just need to extract & parse to get the value I want (40%).
The reason I'm doing all this is to put a simple 20x4 LCD on the front of my Duet enclosure showing some basic info. Especially the hotend fan speed as the fan I now have on the Titan Aero is so quiet I can't tell if it is running or not (Noctua 40x20mm). The stock Titan fan sounds like a jet taking off in comparison. 🙂
I want to also develop some kind of SMS or email messaging out of the connected RPi to warn of certain conditions or let me know when the print has finished (I'm usually sat in another room watching the telly).