[APP][Pro] Moonraker for 3D printer running klipper

Hi,

Could you please test the following in any internet browser for me ?

Replace the printer ip and the 7125 port with your values.

http://printerip:7125/printer/objects/query?print_stats&extruder=target,temperature&heater_bed=target,temperature

and

http://printerip:7125/printer/objects/query?print_stats&extruder=target,temperature&heater_bed=target,temperature&temperature_sensor

and

http://printerip:7125/printer/objects/query?print_stats&extruder=target,temperature&heater_bed=target,temperature&temperature_sensor=chamber_temp

Thank you in advance :slight_smile:

Pls find the answer to your queries as below:

http://printerip:7125 /printer/objects/query?print_stats&extruder=target,temperature&heater_bed=target,temperature

{“result”: {“eventtime”: 7590.281844166, “status”: {“print_stats”: {“filename”: “”, “total_duration”: 0.0, “print_duration”: 0.0, “filament_used”: 0.0, “state”: “standby”, “message”: “”, “info”: {“total_layer”: null, “current_layer”: null}, “power_loss”: 0, “z_pos”: 6.0}, “extruder”: {“target”: 0.0, “temperature”: 30.7}, “heater_bed”: {“target”: 0.0, “temperature”: 29.4}}}}

http://printerip:7125 /printer/objects/query?print_stats&extruder=target,temperature&heater_bed=target,temperature&temperature_sensor

{“result”: {“eventtime”: 7648.227234166, “status”: {“print_stats”: {“filename”: “”, “total_duration”: 0.0, “print_duration”: 0.0, “filament_used”: 0.0, “state”: “standby”, “message”: “”, “info”: {“total_layer”: null, “current_layer”: null}, “power_loss”: 0, “z_pos”: 6.0}, “extruder”: {“target”: 0.0, “temperature”: 30.71}, “heater_bed”: {“target”: 0.0, “temperature”: 29.4}, “temperature_sensor”: {}}}}

http://printerip:7125 /printer/objects/query?print_stats&extruder=target,temperature&heater_bed=target,temperature&temperature_sensor=chamber_temp

{“result”: {“eventtime”: 7664.032165166, “status”: {“print_stats”: {“filename”: “”, “total_duration”: 0.0, “print_duration”: 0.0, “filament_used”: 0.0, “state”: “standby”, “message”: “”, “info”: {“total_layer”: null, “current_layer”: null}, “power_loss”: 0, “z_pos”: 6.0}, “extruder”: {“target”: 0.0, “temperature”: 30.73}, “heater_bed”: {“target”: 0.0, “temperature”: 29.39}, “temperature_sensor”: {“chamber_temp”: null}}}}

However, i believe that the correct query that you are looking for is actually this:

http://printerip:7125 /printer/objects/query?print_stats&extruder=target,temperature&heater_bed=target,temperature&temperature_sensor+chamber_temp=temperature

which returns this:

{“result”: {“eventtime”: 7743.802509832, “status”: {“print_stats”: {“filename”: “”, “total_duration”: 0.0, “print_duration”: 0.0, “filament_used”: 0.0, “state”: “standby”, “message”: “”, “info”: {“total_layer”: null, “current_layer”: null}, “power_loss”: 0, “z_pos”: 6.0}, “extruder”: {“target”: 0.0, “temperature”: 30.73}, “heater_bed”: {“target”: 0.0, “temperature”: 29.42}, “temperature_sensor chamber_temp”: {“temperature”: 29.04}}}}

Great!! Thank you.
I will implement that asap

:+1:

Hi all,

Latest patch should have fix the chamber temperature option as weel as the pairing process in the homey app. Feel free to share feedback if something is wrong.

I’m happy to report that the latest version works fine. The new icons for the chamber and bed temp looks pretty cool too!

Another feedback: the layer and it’s completion time seems to be not updating, while the rest of the fields are updating correctly.

would you mind sharing the output of this get request when a print in on going ?

http://printerip:7125/printer/objects/query?print_stats

The returned json should give the current layer and target one. This used to work. Your latest answer had null and null as i guess you prepared the printer but didn’t have any print on going.

This could mean that moonraker doesn’t have acces to thoses data anymore.

You can also try http://printerip:7125/server/files/metadata?filename=xxx

With xxx being the filename from the previous query.

That would help a lot. I will be home in few days so i would be able to test that on my own printers if you don’t have the time :slight_smile:

I checked the print_stats again and you are right that the layers reported are indeed null:

{“result”: {“eventtime”: 2254.171708499, “status”: {“print_stats”: {“filename”: “motor bowden tube stabiliser_0.2mm_PETG_Generic Klipper Printer_22m25s.gcode”, “total_duration”: 159.69761000000017, “print_duration”: 16.823972666999907, “filament_used”: 32.98481999999999, “state”: “printing”, “message”: “”, “info”: {“total_layer”: null, “current_layer”: null}, “power_loss”: 0, “z_pos”: 0.359625}}}}

I did a little digging on the net and it seems like it’s a problem with moonraker: Moonraker widget layers · gethomepage/homepage · Discussion #3072 · GitHub

So I added the corresponding gcode to my slicer and now it seems to work fine!!

In case anyone wondering what needs to be added in your slicer

Layer Count

To have Slicer layer counts, you have to add these two G-codes in your custom G-codes in your slicer:

Start G-code (before your start G-code):

SET_PRINT_STATS_INFO TOTAL_LAYER=[total_layer_count]

End G-code (at the last line):

; total layers count = [total_layer_count]

After layer change G-code:

SET_PRINT_STATS_INFO CURRENT_LAYER={layer_num + 1}

I have 2 more feature request:

  • can you allow flows based on the temperature changes, in particular, the chamber temperature (so that i can control an external heater)
  • are you able to add insights for the temperature (so that i can graph the temperatures)

Thanks!

Hi,
I fixed the existing triggers and added one on the chamber temperature.
In addition to that, there should be insight trends on the bed, chamber & tool temp as well as trends for the previous layer number with the layer duration (i suggest then to lower the update period from 30 to maybe 10 seconds).

New 1.2.3 is being evaluated by homey team and should be available soon.

Feel free to share some feedback :slight_smile:

1 Like

Thanks for the updated version!! Are you able to include the logics for “above temp” and “below temp” instead of just “temp change”? What I am doing as a workaround in the meantime is to store the temp into a variable to trigger the desired logic. But the ability to use above or below temp would allow the logic to be used more conveniently without having to store the variable on all temp changes.

The temperature is shared with the trigger so you should simply have to link a logic AND to the trigger as shown below

Thanks!! I will give that a try!

DrFatalis, can i trouble u to add an additional feature regarding the chamber temp? While the chamber temp itself does not have a target temp, the temp is actually controlled via a chamber fan, which turns on when the target fan is reached (so that it cools the chamber down).

I would like to use this same target temp to control my external heater (so that i don’t need to manually define it within the homey flows). The fluidd interface for the target chamber temp looks like this:

The parameter for the chamber target temp is “temperature_fan chamber_fan”. The moonraker query looks like this:

http://192.168.1.40:7125/printer/objects/query?temperature_fan+chamber_fan
{“result”: {“eventtime”: 1278.615322499, “status”: {“temperature_fan chamber_fan”: {“speed”: 0.0, “rpm”: null, “temperature”: 33.9, “target”: 50.0}}}}

Thank you so much for your help and sorry to trouble you!

Hi,
This should be accessible in the next release. The target value will be accessible from the trigger the same way it is with the temperature value.

When “Chamber temperature changed” AND “Logic Temperature flag >= Target flag” THEN do something

1 Like