REST API for XL tools?
I'm wading through what I think is the REST API spec and trying to figure out how to get information about the currently selected tool on a 5XL and nothing I'm hitting seems to have that detail. What would be even better would be a way to know which tools are selected for a given job and some way to work out what sort of filament is being used for each.
Anyone have any idea how one might get this done?
RE: REST API for XL tools?
I don't have XL but I think it may not be available via web API.
You have higher chances of getting it via syslog metrics under 'active_extruder' number.
See https://github.com/nvtkaszpir/3d-print/tree/main/prusa3d-metrics-list
See my GitHub and printables.com for some 3d stuff that you may like.
RE: REST API for XL tools?
I gotta be honest - I'm not quite sure what to do with that. When you say "syslog" I'm thinking of a remote logging facility - is that a thing with these printers?
RE:
Official docs says how to do it https://github.com/prusa3d/Prusa-Firmware-Buddy/blob/master/doc/metrics.md and yeah, it's not that easy.
In short it would require to set up syslog listening server.
The good news is that they provide docker-compose file which can set up listening syslog server within minutes.
Then you need to instruct the printer to send syslog messages to that server.
It consists of adding gcode commands to enable logging to remote host and what metrics to send - in for example start gcode section.
See my GitHub and printables.com for some 3d stuff that you may like.
RE:
Roger that - super cool that syslog export is built straight into the firmware! I have a syslog host here but I'm trying to get this all working in Home Assistant which doesn't have any way to surface that info in realtime. I'll keep hunting, thanks for the help!
edit: maybe have a hacky solution - syslog-ng supports export to MQTT which I can then pickup in HA. Going to take some hacking but workable maybe?
It'd be a lot easier if this info was available via REST 😀
RE:
Hm maybe syslog-ng bridge to mqtt could work, haven't tried. I would rather try to do some metrics system -> HA bridge via queries executed once per second or minute maybe, no need to flood HA with printer metrics every 100ms...
See my GitHub and printables.com for some 3d stuff that you may like.