marcolivierarsenault / moonraker-home-assistant

Home Assistant integration for Moonraker, Klipper and Mainsail
https://moonraker-home-assistant.readthedocs.io
MIT License
256 stars 27 forks source link

Total Layer always 0 with Prusaslicer #397

Closed JollyRgrs closed 2 months ago

JollyRgrs commented 2 months ago

HA Setup HA Core: 2024.8.3 HA Supervisor: 2024.08.0 HAOS: 13.1 HACS Moonraker add-on: 1.3.3

Printer Setup Klipper: v0.12.0-286-g81de9a86 Mainsail: v2.12.0 Moonraker: v0.9.2-6-gf735c041

The senssor for Total Layers is 0 from Prusaslicer. It is not 0 from Cura, it shows a proper number. It would be nice to have documentation as to what is being looked for so I can use custom gcode to fill in. Prusaslicer does have a "total_layer_count" and I added the following to my start gcode:

;LAYER_COUNT:{total_layer_count}
;LAYER:0

Properly, the total layer count for my last print was filled in as "98", but the sensor in HA is still showing 0.

All other sensors seem to populate, just the total layer is 0.

What does the gcode need in order for the Total Layer sensor to be populated correctly?

marcolivierarsenault commented 2 months ago

Hey usually it's a metadata issue.

Can you shoot a copy of your log as you print a job. With the error (no layer) https://moonraker-home-assistant.readthedocs.io/en/stable/support/logs.html#go-full-debug-log

marcolivierarsenault commented 2 months ago

Look similar to #321

JollyRgrs commented 2 months ago

Checking the logs, I saw 'info': {'total_layer': None, 'current_layer': None} over and over again. So after looking at the logs (which just send "none" for the values) which did look similar to #321, it prompted me to dig deeper into klipper.

https://moonraker.readthedocs.io/en/latest/printer_objects/#print_stats specifically the part about info:

info: This is a dict containing information about the print provided by the slicer. Currently this is limited to the total_layer and current_layer values. Note that these values are set by the SET_PRINT_STATS_INFO gcode command. It is necessary to configure the slicer to include this command in the print. SET_PRINT_STATS_INFO TOTAL_LAYER=total_layer_count should be called in the slicer's "start gcode" to initalize the total layer count. SET_PRINT_STATS_INFO CURRENT_LAYER=current_layer should be called in the slicer's "on layer change" gcode. The user must substitute the total_layer_count and current_layer with the appropriate "placeholder syntax" for the slicer.

So with that, I added this in Prusaslicer printer settings. The only difference there might be in any other slicers is how they handle the variables (in Prusaslicer it is putting them in curly braces), but the SET_PRINT_STATS_INFO TOTAL_LAYER= and SET_PRINT_STATS_INFO CURRENT_LAYER= parts would be universal for any slicer that doesn't send that information.

Start G-code

SET_PRINT_STATS_INFO TOTAL_LAYER={total_layer_count}
SET_PRINT_STATS_INFO CURRENT_LAYER=0

After layer change G-code

SET_PRINT_STATS_INFO CURRENT_LAYER={layer_num}

Now my logs show correct information.

info': {'total_layer': 29, 'current_layer': 2}}

Only problem, my "Total Layer" sensor is still showing 0 (also not sure why my "current layer" sensor always seemed to read correctly even given the "none" status in the logs).

marcolivierarsenault commented 2 months ago

Hey can you send me a copy of the logs with the info': {'total_layer': 29, 'current_layer': 2}}

I am surprise you still have 0 with this log

JollyRgrs commented 2 months ago

@marcolivierarsenault I have the logs and don't mind sharing them with you. However, I am not comfortable posting the entire log on here. I've wiped out what I can think of (names, Lat/Lon etc.) but there may be something I missed. Can I provide certain portions of it? anything with moonraker on the line and what else? or I could send it to you direct somewhere.

Also, last night I removed the configuration for my printer, restarted HA, then added the printer back on (but I did used the same name it had before). not sure if there would be any residual leftovers from that or not.

Here's the loading of it

2024-08-28 01:30:00.351 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration moonraker which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2024-08-28 01:30:51.033 DEBUG (ImportExecutor_0) [custom_components.moonraker] loading moonraker init
2024-08-28 01:30:51.047 DEBUG (MainThread) [custom_components.moonraker.config_flow] loading moonraker confFlowHandler
2024-08-28 01:30:51.047 DEBUG (MainThread) [custom_components.moonraker.config_flow] Showing moonraker conf
2024-08-28 01:31:12.552 INFO (MainThread) [homeassistant.setup] Setting up moonraker
2024-08-28 01:31:12.564 DEBUG (MainThread) [custom_components.moonraker] {'state': 'ready', 'state_message': 'Printer is ready', 'hostname': 'HPTOUCH', 'klipper_path': '/home/jollyrgrs/klipper', 'python_path': '/home/jollyrgrs/klippy-env/bin/python', 'process_id': 1775, 'user_id': 1000, 'group_id': 1000, 'log_file': '/home/jollyrgrs/printer_data/logs/klippy.log', 'config_file': '/home/jollyrgrs/printer_data/config/printer.cfg', 'software_version': 'v0.12.0-286-g81de9a861-dirty', 'cpu_info': '4 core Intel(R) Core(TM) i5-4570S CPU @ 2.90GHz'}
2024-08-28 01:31:12.564 DEBUG (MainThread) [custom_components.moonraker] fetching data, uuid: 85ab2d6a-28a7-4a30-b5e1-735fbf40f3a3, from: printer.objects.query
2024-08-28 01:31:12.564 DEBUG (MainThread) [custom_components.moonraker] fetching, uuid: 85ab2d6a-28a7-4a30-b5e1-735fbf40f3a3, object: {'objects': {'print_stats': ['state', 'message', 'filename', 'total_duration', 'print_duration', 'filament_used', 'info'], 'display_status': ['message', 'progress'], 'toolhead': ['position'], 'system_stats': ['sysload', 'memavail']}}
2024-08-28 01:31:12.624 DEBUG (MainThread) [custom_components.moonraker] Query Result, uuid: 85ab2d6a-28a7-4a30-b5e1-735fbf40f3a3: {'eventtime': 66137.655821989, 'status': {'print_stats': {'state': 'cancelled', 'message': '', 'filename': 'Phone Arm Mount_1h30m_0.28mm_195C_PLA_ENDER3.gcode', 'total_duration': 436.8638608980109, 'print_duration': 395.9660051630053, 'filament_used': 256.15954999992846, 'info': {'total_layer': 132, 'current_layer': 6}}, 'display_status': {'message': None, 'progress': 0.0}, 'toolhead': {'position': [35.0, 227.0, 150.2681724137931, 6171.288570000214]}, 'system_stats': {'sysload': 0.8369140625, 'memavail': 13734704}}}
2024-08-28 01:31:12.624 DEBUG (MainThread) [custom_components.moonraker] fetching data, uuid: 5751a4af-e66e-47f0-8d5e-7341aa7328d1, from: printer.info
2024-08-28 01:31:12.625 DEBUG (MainThread) [custom_components.moonraker] fetching, uuid: 5751a4af-e66e-47f0-8d5e-7341aa7328d1, object: None
2024-08-28 01:31:12.627 DEBUG (MainThread) [custom_components.moonraker] Query Result, uuid: 5751a4af-e66e-47f0-8d5e-7341aa7328d1: {'state': 'ready', 'state_message': 'Printer is ready', 'hostname': 'HPTOUCH', 'klipper_path': '/home/jollyrgrs/klipper', 'python_path': '/home/jollyrgrs/klippy-env/bin/python', 'process_id': 1775, 'user_id': 1000, 'group_id': 1000, 'log_file': '/home/jollyrgrs/printer_data/logs/klippy.log', 'config_file': '/home/jollyrgrs/printer_data/config/printer.cfg', 'software_version': 'v0.12.0-286-g81de9a861-dirty', 'cpu_info': '4 core Intel(R) Core(TM) i5-4570S CPU @ 2.90GHz'}
2024-08-28 01:31:12.627 DEBUG (MainThread) [custom_components.moonraker] fetching data, uuid: 87e80b97-ad82-4164-ac32-346df7268b1a, from: printer.objects.query
2024-08-28 01:31:12.627 DEBUG (MainThread) [custom_components.moonraker] fetching, uuid: 87e80b97-ad82-4164-ac32-346df7268b1a, object: {'objects': {'print_stats': ['state', 'message', 'filename', 'total_duration', 'print_duration', 'filament_used', 'info'], 'display_status': ['message', 'progress'], 'toolhead': ['position'], 'system_stats': ['sysload', 'memavail']}}
2024-08-28 01:31:12.875 DEBUG (MainThread) [custom_components.moonraker] Query Result, uuid: 87e80b97-ad82-4164-ac32-346df7268b1a: {'eventtime': 66137.906862117, 'status': {'print_stats': {'state': 'cancelled', 'message': '', 'filename': 'Phone Arm Mount_1h30m_0.28mm_195C_PLA_ENDER3.gcode', 'total_duration': 436.8638608980109, 'print_duration': 395.9660051630053, 'filament_used': 256.15954999992846, 'info': {'total_layer': 132, 'current_layer': 6}}, 'display_status': {'message': None, 'progress': 0.0}, 'toolhead': {'position': [35.0, 227.0, 150.2681724137931, 6171.288570000214]}, 'system_stats': {'sysload': 0.8369140625, 'memavail': 13734704}}}
2024-08-28 01:31:12.875 DEBUG (MainThread) [custom_components.moonraker] fetching data, uuid: e472f3e1-d2b7-4f23-80d1-e1b86140250b, from: server.files.metadata
2024-08-28 01:31:12.875 DEBUG (MainThread) [custom_components.moonraker] fetching, uuid: e472f3e1-d2b7-4f23-80d1-e1b86140250b, object: {'filename': 'Phone Arm Mount_1h30m_0.28mm_195C_PLA_ENDER3.gcode'}
2024-08-28 01:31:12.877 DEBUG (MainThread) [custom_components.moonraker] Query Result, uuid: e472f3e1-d2b7-4f23-80d1-e1b86140250b: {'size': 2464502, 'modified': 1724822149.3122466, 'uuid': '773edbce-c4a7-4821-918d-089148bef9e7', 'slicer': 'PrusaSlicer', 'slicer_version': '2.8.0+win64', 'gcode_start_byte': 35048, 'gcode_end_byte': 2450358, 'object_height': 36.96, 'estimated_time': 5424, 'nozzle_diameter': 0.4, 'layer_height': 0.28, 'first_layer_height': 0.28, 'first_layer_extr_temp': 200.0, 'first_layer_bed_temp': 60.0, 'chamber_temp': 0.0, 'filament_name': 'Hatchbox PLA (Black)', 'filament_type': 'PLA', 'filament_total': 4929.35, 'filament_weight_total': 14.82, 'thumbnails': [{'width': 300, 'height': 300, 'size': 24308, 'relative_path': '.thumbs/Phone Arm Mount_1h30m_0.28mm_195C_PLA_ENDER3-300x300.png'}, {'width': 32, 'height': 32, 'size': 671, 'relative_path': '.thumbs/Phone Arm Mount_1h30m_0.28mm_195C_PLA_ENDER3-32x32.png'}], 'print_start_time': 1724822588.9371552, 'job_id': '000301', 'filename': 'Phone Arm Mount_1h30m_0.28mm_195C_PLA_ENDER3.gcode'}
2024-08-28 01:31:12.877 DEBUG (MainThread) [custom_components.moonraker] Finished fetching moonraker data in 0.313 seconds (success: True)
2024-08-28 01:31:12.894 INFO (MainThread) [homeassistant.components.sensor] Setting up moonraker.sensor
2024-08-28 01:31:12.897 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new sensor.moonraker entity: sensor.ender3_printer_state
2024-08-28 01:31:12.898 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new sensor.moonraker entity: sensor.ender3_printer_message
2024-08-28 01:31:12.899 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new sensor.moonraker entity: sensor.ender3_current_print_state
2024-08-28 01:31:12.902 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new sensor.moonraker entity: sensor.ender3_current_print_message
2024-08-28 01:31:12.903 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new sensor.moonraker entity: sensor.ender3_current_display_message
2024-08-28 01:31:12.904 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new sensor.moonraker entity: sensor.ender3_filename
2024-08-28 01:31:12.905 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new sensor.moonraker entity: sensor.ender3_print_projected_total_duration
2024-08-28 01:31:12.906 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new sensor.moonraker entity: sensor.ender3_print_time_left
2024-08-28 01:31:12.908 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new sensor.moonraker entity: sensor.ender3_print_eta
2024-08-28 01:31:12.910 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new sensor.moonraker entity: sensor.ender3_slicer_print_duration_estimate
2024-08-28 01:31:12.910 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new sensor.moonraker entity: sensor.ender3_slicer_print_time_left_estimate
2024-08-28 01:31:12.912 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new sensor.moonraker entity: sensor.ender3_print_duration
2024-08-28 01:31:12.912 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new sensor.moonraker entity: sensor.ender3_filament_used
2024-08-28 01:31:12.913 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new sensor.moonraker entity: sensor.ender3_progress
2024-08-28 01:31:12.916 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new sensor.moonraker entity: sensor.ender3_total_layer
2024-08-28 01:31:12.917 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new sensor.moonraker entity: sensor.ender3_current_layer
2024-08-28 01:31:12.918 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new sensor.moonraker entity: sensor.ender3_toolhead_position_x
2024-08-28 01:31:12.919 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new sensor.moonraker entity: sensor.ender3_toolhead_position_y
2024-08-28 01:31:12.920 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new sensor.moonraker entity: sensor.ender3_toolhead_position_z
2024-08-28 01:31:12.921 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new sensor.moonraker entity: sensor.ender3_object_height
2024-08-28 01:31:12.924 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new sensor.moonraker entity: sensor.ender3_system_load
2024-08-28 01:31:12.924 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new sensor.moonraker entity: sensor.ender3_memory_used
2024-08-28 01:31:12.925 DEBUG (MainThread) [custom_components.moonraker] fetching data, uuid: 1364fa68-af51-4497-9b78-0844fc61aa3e, from: printer.objects.list
2024-08-28 01:31:12.925 DEBUG (MainThread) [custom_components.moonraker] fetching, uuid: 1364fa68-af51-4497-9b78-0844fc61aa3e, object: None
2024-08-28 01:31:12.926 INFO (MainThread) [homeassistant.components.camera] Setting up moonraker.camera
2024-08-28 01:31:12.926 DEBUG (MainThread) [custom_components.moonraker] fetching data, uuid: d92efb29-a158-403d-9ad4-18190819885b, from: server.webcams.list
2024-08-28 01:31:12.926 DEBUG (MainThread) [custom_components.moonraker] fetching, uuid: d92efb29-a158-403d-9ad4-18190819885b, object: None
2024-08-28 01:31:12.927 INFO (MainThread) [homeassistant.components.button] Setting up moonraker.button
2024-08-28 01:31:12.927 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new button.moonraker entity: button.ender3_emergency_stop
2024-08-28 01:31:12.928 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new button.moonraker entity: button.ender3_pause_print
2024-08-28 01:31:12.930 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new button.moonraker entity: button.ender3_resume_print
2024-08-28 01:31:12.931 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new button.moonraker entity: button.ender3_cancel_print
2024-08-28 01:31:12.932 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new button.moonraker entity: button.ender3_server_restart
2024-08-28 01:31:12.933 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new button.moonraker entity: button.ender3_host_restart
2024-08-28 01:31:12.934 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new button.moonraker entity: button.ender3_firmware_restart
2024-08-28 01:31:12.935 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new button.moonraker entity: button.ender3_host_shutdown
2024-08-28 01:31:12.938 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new button.moonraker entity: button.ender3_machine_update_refresh
2024-08-28 01:31:12.939 DEBUG (MainThread) [custom_components.moonraker] fetching data, uuid: f5126a18-880d-436b-86b9-8ac51ce86481, from: printer.gcode.help
2024-08-28 01:31:12.939 DEBUG (MainThread) [custom_components.moonraker] fetching, uuid: f5126a18-880d-436b-86b9-8ac51ce86481, object: None
2024-08-28 01:31:12.940 INFO (MainThread) [homeassistant.components.binary_sensor] Setting up moonraker.binary_sensor
2024-08-28 01:31:12.940 DEBUG (MainThread) [custom_components.moonraker] fetching data, uuid: f8a8979e-9bd9-4010-bd07-008f450dab3c, from: printer.objects.list
2024-08-28 01:31:12.940 DEBUG (MainThread) [custom_components.moonraker] fetching, uuid: f8a8979e-9bd9-4010-bd07-008f450dab3c, object: None
2024-08-28 01:31:12.940 INFO (MainThread) [homeassistant.components.switch] Setting up moonraker.switch
2024-08-28 01:31:12.940 DEBUG (MainThread) [custom_components.moonraker] fetching data, uuid: f7cfc6bd-bc05-42f2-9542-759bd67ac087, from: machine.device_power.devices
2024-08-28 01:31:12.940 DEBUG (MainThread) [custom_components.moonraker] fetching, uuid: f7cfc6bd-bc05-42f2-9542-759bd67ac087, object: None
2024-08-28 01:31:12.941 INFO (MainThread) [homeassistant.components.number] Setting up moonraker.number
2024-08-28 01:31:12.941 DEBUG (MainThread) [custom_components.moonraker] fetching data, uuid: d4fd1b32-bba8-4042-b519-9ae17623f77a, from: printer.objects.list
2024-08-28 01:31:12.941 DEBUG (MainThread) [custom_components.moonraker] fetching, uuid: d4fd1b32-bba8-4042-b519-9ae17623f77a, object: None
2024-08-28 01:31:12.960 DEBUG (MainThread) [custom_components.moonraker] Query Result, uuid: d92efb29-a158-403d-9ad4-18190819885b: {'webcams': [{'name': 'Endercam', 'enabled': True, 'icon': 'mdiRadiatorDisabled', 'aspect_ratio': '4:3', 'target_fps': 5, 'target_fps_idle': 15, 'location': 'printer', 'service': 'mjpegstreamer-adaptive', 'stream_url': 'http://docker.mydomain.tld:8001/live.mjpg', 'snapshot_url': 'http://docker.mydomain.tld:8001/still.jpg', 'flip_horizontal': False, 'flip_vertical': False, 'rotation': 0, 'source': 'database', 'extra_data': {}, 'uid': '1c0d09dc-a817-4f81-9c81-ee5c127dd94a'}, {'name': 'NozzleCam', 'enabled': True, 'icon': 'mdiPrinter3dNozzle', 'aspect_ratio': '4:3', 'target_fps': 25, 'target_fps_idle': 15, 'location': 'printer', 'service': 'mjpegstreamer-adaptive', 'stream_url': '/webcam/?action=stream', 'snapshot_url': '/webcam/?action=snapshot', 'flip_horizontal': False, 'flip_vertical': False, 'rotation': 0, 'source': 'database', 'extra_data': {}, 'uid': 'ca41fd30-950f-4721-996f-9d9f5eb16241'}, {'name': 'built-in', 'enabled': False, 'icon': 'mdiWebcam', 'aspect_ratio': '4:3', 'target_fps': 15, 'target_fps_idle': 15, 'location': 'printer', 'service': 'mjpegstreamer-adaptive', 'stream_url': '/webcam2/?action=stream', 'snapshot_url': '/webcam2/?action=snapshot', 'flip_horizontal': False, 'flip_vertical': False, 'rotation': 0, 'source': 'database', 'extra_data': {}, 'uid': 'f966a8f9-5c2e-4531-9a79-b7a27919a72a'}]}
2024-08-28 01:31:12.960 INFO (MainThread) [custom_components.moonraker.camera] Connecting to camera: http://docker.mydomain.tld:8001/live.mjpg
2024-08-28 01:31:12.961 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new camera.moonraker entity: camera.ender3_endercam
2024-08-28 01:31:12.962 INFO (MainThread) [custom_components.moonraker.camera] Connecting to camera: http://hptouch.mydomain.tld:80/webcam/?action=stream
2024-08-28 01:31:12.962 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new camera.moonraker entity: camera.ender3_nozzlecam
2024-08-28 01:31:12.963 INFO (MainThread) [custom_components.moonraker.camera] Connecting to camera: http://hptouch.mydomain.tld:80/webcam2/?action=stream
2024-08-28 01:31:12.963 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new camera.moonraker entity: camera.ender3_built_in
2024-08-28 01:31:12.964 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new camera.moonraker entity: camera.ender3_thumbnail
2024-08-28 01:31:12.965 DEBUG (MainThread) [custom_components.moonraker] Query Result, uuid: 1364fa68-af51-4497-9b78-0844fc61aa3e: {'objects': ['gcode', 'webhooks', 'configfile', 'mcu', 'save_variables', 'gcode_macro HELLO_WORLD', 'gcode_move', 'print_stats', 'virtual_sdcard', 'pause_resume', 'display_status', 'gcode_macro CANCEL_PRINT', 'gcode_macro PAUSE', 'gcode_macro RESUME', 'gcode_macro SET_PAUSE_NEXT_LAYER', 'gcode_macro SET_PAUSE_AT_LAYER', 'gcode_macro SET_PRINT_STATS_INFO', 'gcode_macro _TOOLHEAD_PARK_PAUSE_CANCEL', 'gcode_macro _CLIENT_EXTRUDE', 'gcode_macro _CLIENT_RETRACT', 'gcode_macro print_start', 'gcode_macro print_stop', 'gcode_macro disable_steppers_X_Y_E', 'gcode_macro M900', 'gcode_macro _POWER_OFF_PRINTER', 'gcode_macro ACTIVATE_POWER_OFF', 'gcode_macro DEACTIVATE_POWER_OFF', 'gcode_macro DUMP_VARIABLES', 'gcode_macro PA_CAL', 'gcode_macro SMARTHOME', 'gcode_macro Position_Inspection', 'gcode_macro Position_Fil_Purge', 'gcode_macro Fil_Unload', 'gcode_macro Extra_Fil_Load', 'gcode_macro Fil_Load', 'gcode_macro E_Step_Calibration', 'gcode_macro M600', 'gcode_macro SWAP_RESUME', 'gcode_macro M300', 'gcode_macro MANUAL_BED_SCREW_CALIBRATION', 'gcode_macro PROBE_SCREW_TILT_CALCULATE', 'exclude_object', 'stepper_enable', 'tmc2209 stepper_x', 'tmc2209 stepper_y', 'tmc2209 stepper_z', 'tmc2209 extruder', 'heaters', 'heater_bed', 'fan', 'heater_fan heatbreak_cooling_fan', 'controller_fan my_controller_fan', 'bed_screws', 'screws_tilt_adjust', 'menu', 'output_pin beeper', 'probe', 'bltouch', 'bed_mesh', 'idle_timeout', 'motion_report', 'query_endstops', 'system_stats', 'manual_probe', 'toolhead', 'extruder']}
2024-08-28 01:31:12.965 DEBUG (MainThread) [custom_components.moonraker] fetching data, uuid: 41a80f36-dc91-4333-95eb-f98c8171e9a5, from: printer.objects.query
2024-08-28 01:31:12.965 DEBUG (MainThread) [custom_components.moonraker] fetching, uuid: 41a80f36-dc91-4333-95eb-f98c8171e9a5, object: {'objects': {'print_stats': ['state', 'message', 'filename', 'total_duration', 'print_duration', 'filament_used', 'info'], 'display_status': ['message', 'progress'], 'toolhead': ['position'], 'system_stats': ['sysload', 'memavail'], 'mcu': ['last_stats'], 'gcode_move': ['speed_factor'], 'heater_bed': ['temperature', 'target', 'power'], 'fan': ['speed'], 'heater_fan heatbreak_cooling_fan': ['speed'], 'controller_fan my_controller_fan': ['speed'], 'extruder': ['temperature', 'target', 'power']}}
2024-08-28 01:31:12.966 DEBUG (MainThread) [custom_components.moonraker] Query Result, uuid: f5126a18-880d-436b-86b9-8ac51ce86481: {'RESTART': 'Reload config file and restart host software', 'FIRMWARE_RESTART': 'Restart firmware, host, and reload config', 'STATUS': 'Report the printer status', 'HELP': 'Report the list of available extended G-Code commands', 'SAVE_CONFIG': 'Overwrite config file and restart', 'SAVE_VARIABLE': 'Save arbitrary variables to disk', 'RUN_SHELL_COMMAND': 'Run a linux shell command', 'HELLO_WORLD': 'G-Code macro', 'SET_GCODE_VARIABLE': 'Set the value of a G-Code macro variable', 'SET_GCODE_OFFSET': 'Set a virtual offset to g-code positions', 'SAVE_GCODE_STATE': 'Save G-Code coordinate state', 'RESTORE_GCODE_STATE': 'Restore a previously saved G-Code state', 'GET_POSITION': 'Return information on the current location of the toolhead', 'SET_PRINT_STATS_INFO': 'Overwrite, to get pause_next_layer and pause_at_layer feature', 'SDCARD_RESET_FILE': 'Clears a loaded SD File. Stops the print if necessary', 'SDCARD_PRINT_FILE': 'Loads a SD file and starts the print.  May include files in subdirectories.', 'PAUSE': 'Pause the actual running print', 'RESUME': 'Resume the actual running print', 'CLEAR_PAUSE': 'Clears the current paused state without resuming the print', 'CANCEL_PRINT': 'Cancel the actual running print', 'SET_DISPLAY_TEXT': 'Set or clear the display message', 'RESPOND': 'Echo the message prepended with a prefix', 'SET_PAUSE_NEXT_LAYER': 'Enable a pause if the next layer is reached', 'SET_PAUSE_AT_LAYER': 'Enable/disable a pause if a given layer number is reached', '_TOOLHEAD_PARK_PAUSE_CANCEL': 'Helper: park toolhead used in PAUSE and CANCEL_PRINT', '_CLIENT_EXTRUDE': 'Extrudes, if the extruder is hot enough', '_CLIENT_RETRACT': 'Retracts, if the extruder is hot enough', 'PRINT_START': 'Start a new print', 'PRINT_STOP': 'Stop a print', 'DISABLE_STEPPERS_X_Y_E': 'Disable all steppers but Z', 'M900': 'M900 Pressure Advance command for use in other macros', '_POWER_OFF_PRINTER': 'G-Code macro', 'UPDATE_DELAYED_GCODE': 'Update the duration of a delayed_gcode', 'ACTIVATE_POWER_OFF': 'G-Code macro', 'DEACTIVATE_POWER_OFF': 'G-Code macro', 'DUMP_VARIABLES': 'G-Code macro', 'PA_CAL': 'Tune Pressure Advance', 'SMARTHOME': 'G-Code macro', 'POSITION_INSPECTION': 'Move nozzle for easier inspection', 'POSITION_FIL_PURGE': 'Move nozzle for easy filament loading/purging', 'FIL_UNLOAD': 'Remove current filament from extruder', 'EXTRA_FIL_LOAD': 'Extra back and forth attemps to purge old filament. -5, +10', 'FIL_LOAD': 'Load new filament and purge old still in the nozzle', 'E_STEP_CALIBRATION': 'Calibrate E-steps, print 100mm at 50mm/s', 'M600': 'G-Code macro', 'SWAP_RESUME': 'G-Code macro', 'M300': 'G-Code macro', 'MANUAL_BED_SCREW_CALIBRATION': 'Manual bed screw calibration using the paper test', 'PROBE_SCREW_TILT_CALCULATE': 'Adjust bed screws using the probe at each screw position', 'EXCLUDE_OBJECT_START': 'Marks the beginning the current object as labeled', 'EXCLUDE_OBJECT_END': 'Marks the end the current object', 'EXCLUDE_OBJECT': 'Cancel moves inside a specified objects', 'EXCLUDE_OBJECT_DEFINE': 'Provides a summary of an object', 'SET_STEPPER_ENABLE': 'Enable/disable individual stepper by name', 'SET_TMC_FIELD': 'Set a register field of a TMC driver', 'INIT_TMC': 'Initialize TMC stepper driver registers', 'SET_TMC_CURRENT': 'Set the current of a TMC driver', 'DUMP_TMC': 'Read and display TMC stepper driver registers', 'TURN_OFF_HEATERS': 'Turn off all heaters', 'TEMPERATURE_WAIT': 'Wait for a temperature on a sensor', 'QUERY_ADC': 'Report the last value of an analog pin', 'PID_CALIBRATE': 'Run PID calibration test', 'SET_HEATER_TEMPERATURE': 'Sets a heater temperature', 'BED_SCREWS_ADJUST': 'Tool to help adjust bed leveling screws', 'SCREWS_TILT_CALCULATE': 'Tool to help adjust bed leveling screws by calculating the number of turns to level it.', 'SET_DISPLAY_GROUP': 'Set the active display group', 'SET_PIN': 'Set the value of an output pin', 'QUERY_PROBE': 'Return the status of the z-probe', 'PROBE': 'Probe Z-height at current XY position', 'PROBE_CALIBRATE': "Calibrate the probe's z_offset", 'PROBE_ACCURACY': 'Probe Z-height accuracy at current XY position', 'Z_OFFSET_APPLY_PROBE': "Adjust the probe's z_offset", 'BLTOUCH_DEBUG': 'Send a command to the bltouch for debugging', 'BLTOUCH_STORE': 'Store an output mode in the BLTouch EEPROM', 'BED_MESH_CALIBRATE': 'Perform Mesh Bed Leveling', 'BED_MESH_PROFILE': 'Bed Mesh Persistent Storage management', 'BED_MESH_OUTPUT': 'Retrieve interpolated grid of probed z-points', 'BED_MESH_MAP': 'Serialize mesh and output to terminal', 'BED_MESH_CLEAR': 'Clear the Mesh so no z-adjustment is made', 'BED_MESH_OFFSET': 'Add X/Y offsets to the mesh lookup', 'SET_IDLE_TIMEOUT': 'Set the idle timeout in seconds', 'STEPPER_BUZZ': 'Oscillate a given stepper to help id it', 'QUERY_ENDSTOPS': 'Report on the status of each endstop', 'SET_VELOCITY_LIMIT': 'Set printer velocity limits', 'MANUAL_PROBE': 'Start manual probe helper script', 'TUNING_TOWER': 'Tool to adjust a parameter at each Z height', 'SET_PRESSURE_ADVANCE': 'Set pressure advance parameters', 'SET_EXTRUDER_ROTATION_DISTANCE': 'Set extruder rotation distance', 'SYNC_EXTRUDER_MOTION': 'Set extruder stepper motion queue', 'ACTIVATE_EXTRUDER': 'Change the active extruder', 'CANCEL_PRINT_BASE': "Renamed builtin of 'CANCEL_PRINT'", 'PAUSE_BASE': "Renamed builtin of 'PAUSE'", 'RESUME_BASE': "Renamed builtin of 'RESUME'", 'SET_PRINT_STATS_INFO_BASE': "Renamed builtin of 'SET_PRINT_STATS_INFO'"}
2024-08-28 01:31:12.968 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new button.moonraker entity: button.ender3_macro_restart
2024-08-28 01:31:12.968 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new button.moonraker entity: button.ender3_macro_firmware_restart
2024-08-28 01:31:12.969 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new button.moonraker entity: button.ender3_macro_status
2024-08-28 01:31:12.969 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new button.moonraker entity: button.ender3_macro_help
2024-08-28 01:31:12.969 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new button.moonraker entity: button.ender3_macro_save_config
2024-08-28 01:31:12.970 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new button.moonraker entity: button.ender3_macro_save_variable
2024-08-28 01:31:12.970 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new button.moonraker entity: button.ender3_macro_run_shell_command
2024-08-28 01:31:12.971 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new button.moonraker entity: button.ender3_macro_hello_world
2024-08-28 01:31:12.972 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new button.moonraker entity: button.ender3_macro_set_gcode_variable
2024-08-28 01:31:12.976 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new button.moonraker entity: button.ender3_macro_set_gcode_offset
2024-08-28 01:31:12.976 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new button.moonraker entity: button.ender3_macro_save_gcode_state
2024-08-28 01:31:12.977 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new button.moonraker entity: button.ender3_macro_restore_gcode_state
2024-08-28 01:31:12.977 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new button.moonraker entity: button.ender3_macro_get_position
2024-08-28 01:31:12.977 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new button.moonraker entity: button.ender3_macro_set_print_stats_info
2024-08-28 01:31:12.978 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new button.moonraker entity: button.ender3_macro_sdcard_reset_file
2024-08-28 01:31:12.978 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new button.moonraker entity: button.ender3_macro_sdcard_print_file
2024-08-28 01:31:12.978 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new button.moonraker entity: button.ender3_macro_pause
2024-08-28 01:31:12.979 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new button.moonraker entity: button.ender3_macro_resume
2024-08-28 01:31:12.979 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new button.moonraker entity: button.ender3_macro_clear_pause
2024-08-28 01:31:12.980 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new button.moonraker entity: button.ender3_macro_cancel_print
2024-08-28 01:31:12.980 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new button.moonraker entity: button.ender3_macro_set_display_text
2024-08-28 01:31:12.980 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new button.moonraker entity: button.ender3_macro_respond
2024-08-28 01:31:12.982 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new button.moonraker entity: button.ender3_macro_set_pause_next_layer
2024-08-28 01:31:12.983 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new button.moonraker entity: button.ender3_macro_set_pause_at_layer
2024-08-28 01:31:12.983 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new button.moonraker entity: button.ender3_macro_toolhead_park_pause_cancel
2024-08-28 01:31:12.983 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new button.moonraker entity: button.ender3_macro_client_extrude
2024-08-28 01:31:12.984 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new button.moonraker entity: button.ender3_macro_client_retract
2024-08-28 01:31:12.984 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new button.moonraker entity: button.ender3_macro_print_start
2024-08-28 01:31:12.985 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new button.moonraker entity: button.ender3_macro_print_stop
2024-08-28 01:31:12.985 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new button.moonraker entity: button.ender3_macro_disable_steppers_x_y_e
2024-08-28 01:31:12.985 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new button.moonraker entity: button.ender3_macro_m900
2024-08-28 01:31:12.986 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new button.moonraker entity: button.ender3_macro_power_off_printer
2024-08-28 01:31:12.987 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new button.moonraker entity: button.ender3_macro_update_delayed_gcode
2024-08-28 01:31:12.987 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new button.moonraker entity: button.ender3_macro_activate_power_off
2024-08-28 01:31:12.988 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new button.moonraker entity: button.ender3_macro_deactivate_power_off
2024-08-28 01:31:12.989 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new button.moonraker entity: button.ender3_macro_dump_variables
2024-08-28 01:31:12.990 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new button.moonraker entity: button.ender3_macro_pa_cal
2024-08-28 01:31:12.990 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new button.moonraker entity: button.ender3_macro_smarthome
2024-08-28 01:31:12.991 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new button.moonraker entity: button.ender3_macro_position_inspection
2024-08-28 01:31:12.992 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new button.moonraker entity: button.ender3_macro_position_fil_purge
2024-08-28 01:31:12.992 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new button.moonraker entity: button.ender3_macro_fil_unload
2024-08-28 01:31:12.992 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new button.moonraker entity: button.ender3_macro_extra_fil_load
2024-08-28 01:31:12.994 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new button.moonraker entity: button.ender3_macro_fil_load
2024-08-28 01:31:12.995 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new button.moonraker entity: button.ender3_macro_e_step_calibration
2024-08-28 01:31:12.995 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new button.moonraker entity: button.ender3_macro_m600
2024-08-28 01:31:12.996 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new button.moonraker entity: button.ender3_macro_swap_resume
2024-08-28 01:31:12.997 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new button.moonraker entity: button.ender3_macro_m300
2024-08-28 01:31:12.997 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new button.moonraker entity: button.ender3_macro_manual_bed_screw_calibration
2024-08-28 01:31:12.998 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new button.moonraker entity: button.ender3_macro_probe_screw_tilt_calculate
2024-08-28 01:31:12.998 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new button.moonraker entity: button.ender3_macro_exclude_object_start
2024-08-28 01:31:12.999 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new button.moonraker entity: button.ender3_macro_exclude_object_end
2024-08-28 01:31:12.999 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new button.moonraker entity: button.ender3_macro_exclude_object
2024-08-28 01:31:12.999 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new button.moonraker entity: button.ender3_macro_exclude_object_define
2024-08-28 01:31:13.000 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new button.moonraker entity: button.ender3_macro_set_stepper_enable
2024-08-28 01:31:13.000 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new button.moonraker entity: button.ender3_macro_set_tmc_field
2024-08-28 01:31:13.001 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new button.moonraker entity: button.ender3_macro_init_tmc
2024-08-28 01:31:13.001 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new button.moonraker entity: button.ender3_macro_set_tmc_current
2024-08-28 01:31:13.001 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new button.moonraker entity: button.ender3_macro_dump_tmc
2024-08-28 01:31:13.002 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new button.moonraker entity: button.ender3_macro_turn_off_heaters
2024-08-28 01:31:13.002 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new button.moonraker entity: button.ender3_macro_temperature_wait
2024-08-28 01:31:13.003 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new button.moonraker entity: button.ender3_macro_query_adc
2024-08-28 01:31:13.003 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new button.moonraker entity: button.ender3_macro_pid_calibrate
2024-08-28 01:31:13.003 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new button.moonraker entity: button.ender3_macro_set_heater_temperature
2024-08-28 01:31:13.004 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new button.moonraker entity: button.ender3_macro_bed_screws_adjust
2024-08-28 01:31:13.004 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new button.moonraker entity: button.ender3_macro_screws_tilt_calculate
2024-08-28 01:31:13.006 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new button.moonraker entity: button.ender3_macro_set_display_group
2024-08-28 01:31:13.006 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new button.moonraker entity: button.ender3_macro_set_pin
2024-08-28 01:31:13.006 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new button.moonraker entity: button.ender3_macro_query_probe
2024-08-28 01:31:13.007 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new button.moonraker entity: button.ender3_macro_probe
2024-08-28 01:31:13.007 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new button.moonraker entity: button.ender3_macro_probe_calibrate
2024-08-28 01:31:13.008 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new button.moonraker entity: button.ender3_macro_probe_accuracy
2024-08-28 01:31:13.008 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new button.moonraker entity: button.ender3_macro_z_offset_apply_probe
2024-08-28 01:31:13.008 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new button.moonraker entity: button.ender3_macro_bltouch_debug
2024-08-28 01:31:13.009 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new button.moonraker entity: button.ender3_macro_bltouch_store
2024-08-28 01:31:13.009 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new button.moonraker entity: button.ender3_macro_bed_mesh_calibrate
2024-08-28 01:31:13.010 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new button.moonraker entity: button.ender3_macro_bed_mesh_profile
2024-08-28 01:31:13.010 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new button.moonraker entity: button.ender3_macro_bed_mesh_output
2024-08-28 01:31:13.010 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new button.moonraker entity: button.ender3_macro_bed_mesh_map
2024-08-28 01:31:13.012 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new button.moonraker entity: button.ender3_macro_bed_mesh_clear
2024-08-28 01:31:13.012 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new button.moonraker entity: button.ender3_macro_bed_mesh_offset
2024-08-28 01:31:13.013 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new button.moonraker entity: button.ender3_macro_set_idle_timeout
2024-08-28 01:31:13.013 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new button.moonraker entity: button.ender3_macro_stepper_buzz
2024-08-28 01:31:13.014 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new button.moonraker entity: button.ender3_macro_query_endstops
2024-08-28 01:31:13.014 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new button.moonraker entity: button.ender3_macro_set_velocity_limit
2024-08-28 01:31:13.014 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new button.moonraker entity: button.ender3_macro_manual_probe
2024-08-28 01:31:13.015 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new button.moonraker entity: button.ender3_macro_tuning_tower
2024-08-28 01:31:13.015 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new button.moonraker entity: button.ender3_macro_set_pressure_advance
2024-08-28 01:31:13.016 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new button.moonraker entity: button.ender3_macro_set_extruder_rotation_distance
2024-08-28 01:31:13.016 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new button.moonraker entity: button.ender3_macro_sync_extruder_motion
2024-08-28 01:31:13.016 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new button.moonraker entity: button.ender3_macro_activate_extruder
2024-08-28 01:31:13.017 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new button.moonraker entity: button.ender3_macro_cancel_print_base
2024-08-28 01:31:13.017 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new button.moonraker entity: button.ender3_macro_pause_base
2024-08-28 01:31:13.017 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new button.moonraker entity: button.ender3_macro_resume_base
2024-08-28 01:31:13.018 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new button.moonraker entity: button.ender3_macro_set_print_stats_info_base

Here is a sample of the custom_components.moonraker lines during a print

2024-08-28 14:19:57.418 DEBUG (MainThread) [custom_components.moonraker] fetching data, uuid: 2affbf06-70b8-481e-be9f-a65619d60a45, from: printer.objects.query
2024-08-28 14:19:57.419 DEBUG (MainThread) [custom_components.moonraker] fetching, uuid: 2affbf06-70b8-481e-be9f-a65619d60a45, object: {'objects': {'print_stats': ['state', 'message', 'filename', 'total_duration', 'print_duration', 'filament_used', 'info'], 'display_status': ['message', 'progress'], 'toolhead': ['position'], 'system_stats': ['sysload', 'memavail'], 'mcu': ['last_stats'], 'gcode_move': ['speed_factor'], 'heater_bed': ['temperature', 'target', 'power'], 'fan': ['speed'], 'heater_fan heatbreak_cooling_fan': ['speed'], 'controller_fan my_controller_fan': ['speed'], 'extruder': ['temperature', 'target', 'power'], 'output_pin beeper': ['value'], 'status': ['update_available'], 'q': ['u']}}
2024-08-28 14:19:57.471 DEBUG (MainThread) [custom_components.moonraker] Query Result, uuid: 2affbf06-70b8-481e-be9f-a65619d60a45: {'eventtime': 112262.562076099, 'status': {'print_stats': {'state': 'printing', 'message': '', 'filename': 'Phone Arm Mount_1h30m_0.28mm_195C_PLA_ENDER3.gcode', 'total_duration': 4733.621705942001, 'print_duration': 4594.673404404006, 'filament_used': 3713.701060000258, 'info': {'total_layer': 132, 'current_layer': 93}}, 'display_status': {'message': None, 'progress': 0.78}, 'toolhead': {'position': [104.328, 106.049, 26.32305988809125, 3713.701060000258]}, 'system_stats': {'sysload': 0.78125, 'memavail': 13496480}, 'mcu': {'last_stats': {'mcu_awake': 0.023, 'mcu_task_avg': 3.3e-05, 'mcu_task_stddev': 5.2e-05, 'bytes_write': 7727197, 'bytes_read': 2076570, 'bytes_retransmit': 9, 'bytes_invalid': 0, 'send_seq': 173537, 'receive_seq': 173537, 'retransmit_seq': 2, 'srtt': 0.0, 'rttvar': 0.0, 'rto': 0.025, 'ready_bytes': 11, 'upcoming_bytes': 0, 'freq': 63998631}}, 'gcode_move': {'speed_factor': 1.0}, 'heater_bed': {'temperature': 54.95, 'target': 55.0, 'power': 0.2198717244392645}, 'fan': {'speed': 0.93}, 'heater_fan heatbreak_cooling_fan': {'speed': 1.0}, 'controller_fan my_controller_fan': {'speed': 1.0}, 'extruder': {'temperature': 194.98, 'target': 195.0, 'power': 0.25161224379210956}, 'output_pin beeper': {'value': 0.0}, 'status': {'update_available': None}, 'q': {'u': None}}}
2024-08-28 14:19:57.471 DEBUG (MainThread) [custom_components.moonraker] fetching data, uuid: c5a71b6c-28d7-470c-a4ac-1f7c67dc393b, from: printer.info
2024-08-28 14:19:57.471 DEBUG (MainThread) [custom_components.moonraker] fetching, uuid: c5a71b6c-28d7-470c-a4ac-1f7c67dc393b, object: None
2024-08-28 14:19:57.473 DEBUG (MainThread) [custom_components.moonraker] Query Result, uuid: c5a71b6c-28d7-470c-a4ac-1f7c67dc393b: {'state': 'ready', 'state_message': 'Printer is ready', 'hostname': 'HPTOUCH', 'klipper_path': '/home/jollyrgrs/klipper', 'python_path': '/home/jollyrgrs/klippy-env/bin/python', 'process_id': 1775, 'user_id': 1000, 'group_id': 1000, 'log_file': '/home/jollyrgrs/printer_data/logs/klippy.log', 'config_file': '/home/jollyrgrs/printer_data/config/printer.cfg', 'software_version': 'v0.12.0-286-g81de9a861-dirty', 'cpu_info': '4 core Intel(R) Core(TM) i5-4570S CPU @ 2.90GHz'}
2024-08-28 14:19:57.473 DEBUG (MainThread) [custom_components.moonraker] fetching data, uuid: 5bacaee9-dc13-40ab-98f3-5f50c360ae51, from: printer.objects.query
2024-08-28 14:19:57.474 DEBUG (MainThread) [custom_components.moonraker] fetching, uuid: 5bacaee9-dc13-40ab-98f3-5f50c360ae51, object: {'objects': {'print_stats': ['state', 'message', 'filename', 'total_duration', 'print_duration', 'filament_used', 'info'], 'display_status': ['message', 'progress'], 'toolhead': ['position'], 'system_stats': ['sysload', 'memavail'], 'mcu': ['last_stats'], 'gcode_move': ['speed_factor'], 'heater_bed': ['temperature', 'target', 'power'], 'fan': ['speed'], 'heater_fan heatbreak_cooling_fan': ['speed'], 'controller_fan my_controller_fan': ['speed'], 'extruder': ['temperature', 'target', 'power'], 'output_pin beeper': ['value'], 'status': ['update_available'], 'q': ['u']}}
2024-08-28 14:19:57.722 DEBUG (MainThread) [custom_components.moonraker] Query Result, uuid: 5bacaee9-dc13-40ab-98f3-5f50c360ae51: {'eventtime': 112262.813086026, 'status': {'print_stats': {'state': 'printing', 'message': '', 'filename': 'Phone Arm Mount_1h30m_0.28mm_195C_PLA_ENDER3.gcode', 'total_duration': 4733.872715869002, 'print_duration': 4594.924414331006, 'filament_used': 3713.701060000258, 'info': {'total_layer': 132, 'current_layer': 93}}, 'display_status': {'message': None, 'progress': 0.78}, 'toolhead': {'position': [104.328, 106.049, 26.32305988809125, 3713.701060000258]}, 'system_stats': {'sysload': 0.78125, 'memavail': 13496480}, 'mcu': {'last_stats': {'mcu_awake': 0.023, 'mcu_task_avg': 3.3e-05, 'mcu_task_stddev': 5.2e-05, 'bytes_write': 7727197, 'bytes_read': 2076570, 'bytes_retransmit': 9, 'bytes_invalid': 0, 'send_seq': 173537, 'receive_seq': 173537, 'retransmit_seq': 2, 'srtt': 0.0, 'rttvar': 0.0, 'rto': 0.025, 'ready_bytes': 11, 'upcoming_bytes': 0, 'freq': 63998631}}, 'gcode_move': {'speed_factor': 1.0}, 'heater_bed': {'temperature': 54.95, 'target': 55.0, 'power': 0.2198717244392645}, 'fan': {'speed': 0.93}, 'heater_fan heatbreak_cooling_fan': {'speed': 1.0}, 'controller_fan my_controller_fan': {'speed': 1.0}, 'extruder': {'temperature': 195.01, 'target': 195.0, 'power': 0.35773889072878123}, 'output_pin beeper': {'value': 0.0}, 'status': {'update_available': None}, 'q': {'u': None}}}
2024-08-28 14:19:57.722 DEBUG (MainThread) [custom_components.moonraker] fetching data, uuid: d83efe4d-0924-43d1-8780-c5d5f4e15103, from: server.files.metadata
2024-08-28 14:19:57.722 DEBUG (MainThread) [custom_components.moonraker] fetching, uuid: d83efe4d-0924-43d1-8780-c5d5f4e15103, object: {'filename': 'Phone Arm Mount_1h30m_0.28mm_195C_PLA_ENDER3.gcode'}
2024-08-28 14:19:57.725 DEBUG (MainThread) [custom_components.moonraker] Query Result, uuid: d83efe4d-0924-43d1-8780-c5d5f4e15103: {'size': 2464502, 'modified': 1724822149.3122466, 'uuid': '773edbce-c4a7-4821-918d-089148bef9e7', 'slicer': 'PrusaSlicer', 'slicer_version': '2.8.0+win64', 'gcode_start_byte': 35048, 'gcode_end_byte': 2450358, 'object_height': 36.96, 'estimated_time': 5424, 'nozzle_diameter': 0.4, 'layer_height': 0.28, 'first_layer_height': 0.28, 'first_layer_extr_temp': 200.0, 'first_layer_bed_temp': 60.0, 'chamber_temp': 0.0, 'filament_name': 'Hatchbox PLA (Black)', 'filament_type': 'PLA', 'filament_total': 4929.35, 'filament_weight_total': 14.82, 'thumbnails': [{'width': 300, 'height': 300, 'size': 24308, 'relative_path': '.thumbs/Phone Arm Mount_1h30m_0.28mm_195C_PLA_ENDER3-300x300.png'}, {'width': 32, 'height': 32, 'size': 671, 'relative_path': '.thumbs/Phone Arm Mount_1h30m_0.28mm_195C_PLA_ENDER3-32x32.png'}], 'print_start_time': 1724864464.0206156, 'job_id': '000303', 'filename': 'Phone Arm Mount_1h30m_0.28mm_195C_PLA_ENDER3.gcode'}
2024-08-28 14:19:57.725 DEBUG (MainThread) [custom_components.moonraker] fetching data, uuid: 6757b730-4583-48a6-9259-3065a11726c9, from: machine.system_info
2024-08-28 14:19:57.725 DEBUG (MainThread) [custom_components.moonraker] fetching, uuid: 6757b730-4583-48a6-9259-3065a11726c9, object: None
2024-08-28 14:19:57.727 DEBUG (MainThread) [custom_components.moonraker] Query Result, uuid: 6757b730-4583-48a6-9259-3065a11726c9: {'system_info': {'python': {'version': [3, 11, 2, 'final', 0], 'version_string': '3.11.2 (main, May  2 2024, 11:59:08) [GCC 12.2.0]'}, 'cpu_info': {'cpu_count': 4, 'bits': '64bit', 'processor': 'x86_64', 'cpu_desc': 'Intel(R) Core(TM) i5-4570S CPU @ 2.90GHz', 'serial_number': '', 'hardware_desc': '', 'model': '', 'total_memory': 16264744, 'memory_units': 'kB'}, 'sd_info': {}, 'distribution': {'name': 'Debian GNU/Linux 12 (bookworm)', 'id': 'debian', 'version': '12', 'version_parts': {'major': '12', 'minor': '', 'build_number': ''}, 'like': '', 'codename': 'bookworm', 'release_info': {}, 'kernel_version': '6.1.0-23-amd64'}, 'virtualization': {'virt_type': 'none', 'virt_identifier': 'none'}, 'network': {'eno1': {'mac_address': 'c8:cb:b8:0b:18:da', 'ip_addresses': [{'family': 'ipv4', 'address': '10.0.0.197', 'is_link_local': False}, {'family': 'ipv6', 'address': 'fd0f:7a4:f200:9847:8929:a66b:8378:5d63', 'is_link_local': False}, {'family': 'ipv6', 'address': 'fd0f:7a4:f200:9847:5a3e:bb6c:fc0:2742', 'is_link_local': False}, {'family': 'ipv6', 'address': 'fd0f:7a4:f200:9847:cacb:b8ff:fe0b:18da', 'is_link_local': False}, {'family': 'ipv6', 'address': 'fe80::cacb:b8ff:fe0b:18da', 'is_link_local': True}]}}, 'canbus': {}, 'provider': 'systemd_dbus', 'available_services': ['klipper', 'moonraker', 'KlipperScreen', 'mobileraker', 'crowsnest'], 'service_state': {'klipper': {'active_state': 'active', 'sub_state': 'running'}, 'moonraker': {'active_state': 'active', 'sub_state': 'running'}, 'KlipperScreen': {'active_state': 'active', 'sub_state': 'running'}, 'mobileraker': {'active_state': 'active', 'sub_state': 'running'}, 'crowsnest': {'active_state': 'active', 'sub_state': 'running'}}, 'instance_ids': {'moonraker': 'moonraker', 'klipper': 'klipper'}}}
2024-08-28 14:19:57.727 DEBUG (MainThread) [custom_components.moonraker] fetching data, uuid: d62962f5-d6af-4798-9a7f-4a91d637c9d4, from: machine.device_power.devices
2024-08-28 14:19:57.727 DEBUG (MainThread) [custom_components.moonraker] fetching, uuid: d62962f5-d6af-4798-9a7f-4a91d637c9d4, object: None
2024-08-28 14:19:57.729 DEBUG (MainThread) [custom_components.moonraker] Query Result, uuid: d62962f5-d6af-4798-9a7f-4a91d637c9d4: {'devices': [{'device': 'printer', 'status': 'on', 'locked_while_printing': True, 'type': 'mqtt'}, {'device': 'printer_lamps', 'status': 'on', 'locked_while_printing': False, 'type': 'mqtt'}]}
2024-08-28 14:19:57.729 DEBUG (MainThread) [custom_components.moonraker] fetching data, uuid: 8f070605-9996-4fa5-aa14-a3f7ac656208, from: server.history.totals
2024-08-28 14:19:57.729 DEBUG (MainThread) [custom_components.moonraker] fetching, uuid: 8f070605-9996-4fa5-aa14-a3f7ac656208, object: None
2024-08-28 14:19:57.731 DEBUG (MainThread) [custom_components.moonraker] Query Result, uuid: 8f070605-9996-4fa5-aa14-a3f7ac656208: {'job_totals': {'total_jobs': 763.0, 'total_time': 4421634.462831152, 'total_print_time': 4296194.224251843, 'total_filament_used': 3632278.5250286926, 'longest_job': 117291.03342411199, 'longest_print': 117128.60009181898}, 'auxiliary_totals': []}
2024-08-28 14:19:57.731 DEBUG (MainThread) [custom_components.moonraker] fetching data, uuid: 238ff21d-ec14-4cb3-9926-8472b4870a3b, from: machine.update.status
2024-08-28 14:19:57.731 DEBUG (MainThread) [custom_components.moonraker] fetching, uuid: 238ff21d-ec14-4cb3-9926-8472b4870a3b, object: None
2024-08-28 14:19:57.733 DEBUG (MainThread) [custom_components.moonraker] Query Result, uuid: 238ff21d-ec14-4cb3-9926-8472b4870a3b: {'github_rate_limit': None, 'github_requests_remaining': None, 'github_limit_reset_time': None, 'version_info': {'system': {'package_count': 0, 'package_list': []}, 'moonraker': {'channel': 'dev', 'debug_enabled': False, 'channel_invalid': False, 'is_valid': True, 'configured_type': 'git_repo', 'info_tags': [], 'detected_type': 'git_repo', 'remote_alias': 'origin', 'branch': 'master', 'owner': 'Arksine', 'repo_name': 'moonraker', 'remote_url': 'https://github.com/Arksine/moonraker.git', 'recovery_url': 'https://github.com/Arksine/moonraker.git', 'version': 'v0.9.2-6', 'remote_version': 'v0.9.2-6', 'rollback_version': 'v0.8.0-327', 'current_hash': 'f735c0419444848b59342a98ad3532eef123ea46', 'remote_hash': 'f735c0419444848b59342a98ad3532eef123ea46', 'is_dirty': False, 'detached': False, 'commits_behind': [], 'commits_behind_count': 0, 'git_messages': [], 'full_version_string': 'v0.9.2-6-gf735c041', 'pristine': True, 'corrupt': False, 'warnings': [], 'anomalies': []}, 'klipper': {'channel': 'dev', 'debug_enabled': False, 'channel_invalid': False, 'is_valid': True, 'configured_type': 'git_repo', 'info_tags': [], 'detected_type': 'git_repo', 'remote_alias': 'origin', 'branch': 'master', 'owner': 'Klipper3d', 'repo_name': 'klipper', 'remote_url': 'https://github.com/Klipper3d/klipper', 'recovery_url': 'https://github.com/Klipper3d/klipper', 'version': 'v0.12.0-286', 'remote_version': 'v0.12.0-286', 'rollback_version': 'v0.12.0-171', 'current_hash': '81de9a8615df667ae2ea6d2b0f9204e7f3b09bcc', 'remote_hash': '81de9a8615df667ae2ea6d2b0f9204e7f3b09bcc', 'is_dirty': False, 'detached': False, 'commits_behind': [], 'commits_behind_count': 0, 'git_messages': [], 'full_version_string': 'v0.12.0-286-g81de9a86', 'pristine': False, 'corrupt': False, 'warnings': [], 'anomalies': ["Repo has untracked source files: ['klippy/extras/gcode_shell_command.py']"]}, 'mainsail-config': {'channel': 'dev', 'debug_enabled': False, 'channel_invalid': False, 'is_valid': True, 'configured_type': 'git_repo', 'info_tags': [], 'detected_type': 'git_repo', 'remote_alias': 'origin', 'branch': 'master', 'owner': 'mainsail-crew', 'repo_name': 'mainsail-config', 'remote_url': 'https://github.com/mainsail-crew/mainsail-config.git', 'recovery_url': 'https://github.com/mainsail-crew/mainsail-config.git', 'version': 'v1.2.1-0', 'remote_version': 'v1.2.1-0', 'rollback_version': 'v1.1.0-1', 'current_hash': 'e57810d51b5c634aadaca4db923bfcba269ae4b3', 'remote_hash': 'e57810d51b5c634aadaca4db923bfcba269ae4b3', 'is_dirty': False, 'detached': False, 'commits_behind': [], 'commits_behind_count': 0, 'git_messages': [], 'full_version_string': 'v1.2.1-0-ge57810d5', 'pristine': True, 'corrupt': False, 'warnings': [], 'anomalies': []}, 'mainsail': {'channel': 'stable', 'debug_enabled': False, 'channel_invalid': False, 'is_valid': True, 'configured_type': 'web', 'info_tags': [], 'name': 'mainsail', 'repo_name': 'mainsail', 'owner': 'mainsail-crew', 'version': 'v2.12.0', 'remote_version': 'v2.12.0', 'rollback_version': 'v2.10.0', 'last_error': '', 'warnings': [], 'anomalies': []}, 'crowsnest': {'channel': 'dev', 'debug_enabled': False, 'channel_invalid': False, 'is_valid': True, 'configured_type': 'git_repo', 'info_tags': [], 'detected_type': 'git_repo', 'remote_alias': 'origin', 'branch': 'master', 'owner': 'mainsail-crew', 'repo_name': 'crowsnest', 'remote_url': 'https://github.com/mainsail-crew/crowsnest.git', 'recovery_url': 'https://github.com/mainsail-crew/crowsnest.git', 'version': 'v4.1.9-1', 'remote_version': 'v4.1.9-1', 'rollback_version': 'v4.1.8-1', 'current_hash': 'd75a3aeb018384e59d03518754f6148c98894ed9', 'remote_hash': 'd75a3aeb018384e59d03518754f6148c98894ed9', 'is_dirty': False, 'detached': False, 'commits_behind': [], 'commits_behind_count': 0, 'git_messages': [], 'full_version_string': 'v4.1.9-1-gd75a3aeb', 'pristine': True, 'corrupt': False, 'warnings': [], 'anomalies': []}, 'mobileraker': {'channel': 'dev', 'debug_enabled': False, 'channel_invalid': False, 'is_valid': True, 'configured_type': 'git_repo', 'info_tags': [], 'detected_type': 'git_repo', 'remote_alias': 'origin', 'branch': 'main', 'owner': 'Clon1998', 'repo_name': 'mobileraker_companion', 'remote_url': 'https://github.com/Clon1998/mobileraker_companion.git', 'recovery_url': 'https://github.com/Clon1998/mobileraker_companion.git', 'version': 'v0.4.0-77', 'remote_version': 'v0.4.0-77', 'rollback_version': 'v0.4.0-57', 'current_hash': 'ff0d7d70145550796890b1240721d01b1cb561cf', 'remote_hash': 'ff0d7d70145550796890b1240721d01b1cb561cf', 'is_dirty': False, 'detached': False, 'commits_behind': [], 'commits_behind_count': 0, 'git_messages': [], 'full_version_string': 'v0.4.0-77-gff0d7d70', 'pristine': True, 'corrupt': False, 'warnings': [], 'anomalies': []}}, 'busy': False}
2024-08-28 14:19:57.734 DEBUG (MainThread) [custom_components.moonraker] fetching data, uuid: bf44cecd-69d9-40bf-acbb-fb82604d78fc, from: server.job_queue.status
2024-08-28 14:19:57.734 DEBUG (MainThread) [custom_components.moonraker] fetching, uuid: bf44cecd-69d9-40bf-acbb-fb82604d78fc, object: None
2024-08-28 14:19:57.735 DEBUG (MainThread) [custom_components.moonraker] Query Result, uuid: bf44cecd-69d9-40bf-acbb-fb82604d78fc: {'queued_jobs': [], 'queue_state': 'paused'}
2024-08-28 14:19:57.735 DEBUG (MainThread) [custom_components.moonraker] Finished fetching moonraker data in 0.317 seconds (success: True)
marcolivierarsenault commented 2 months ago

also not sure why my "current layer" sensor always seemed to read correctly even given the "none" status in the logs)

This is because we have multiple way of calculating it, including the value in metadata, but also the current Z height


In the latest log, the one around 2024-08-28 14:19:57 you still have no total layer in Home Assistant? What value do you get, 0 or Null?

marcolivierarsenault commented 2 months ago

ok very interesting, so,

As of now, we look for this info in the GCode metadata This is an example. In a field called layer_count https://github.com/marcolivierarsenault/moonraker-home-assistant/issues/283#issue-2145095679 image

Now, you don't have this in your GCode, but you do have it in the print stats, so I wonder if I can take both and display if available. Let me try to build a patch

JollyRgrs commented 2 months ago

also not sure why my "current layer" sensor always seemed to read correctly even given the "none" status in the logs)

This is because we have multiple way of calculating it, including the value in metadata, but also the current Z height

In the latest log, the one around 2024-08-28 14:19:57 you still have no total layer in Home Assistant? What value do you get, 0 or Null?

I get 0, not null or unknown, but just 0. (except as you can see when I printed something via Cura). image

Could you document what exactly is being looked for in the gcode? I could add that to my custom gcode inserts, I just don't know what to add. I thought that adding the info using the SET_PRINT_STATS_INFO would be what is needed (and even finding that was a bit of a tour across various documentations). If you could list out what it currently needs to look like, I can format my gcode to match. In the future, I would agree it would be nice to have it pull from either source (though, handling differences, I'm not sure which would be the source of truth).

I'm also wondering if this throws off my current layer/percent complete. Especially during the start of my script where I have it hold a few mm above the back of the plate while the nozzle warms up, it tells me I am at layer 8 and whatever % that is of the total is what it says my percent complete is (I'm guessing it does calculations based on max Z height and whatever the layer height is to determine how many layers there are for the estimation).

marcolivierarsenault commented 2 months ago

Right now we look for layer count (For the total layer)

image

For current layer we first check if you have the info in your stats

    if (
        "info" in data["status"]["print_stats"]
        and data["status"]["print_stats"]["info"] is not None
        and "current_layer" in data["status"]["print_stats"]["info"]
        and data["status"]["print_stats"]["info"]["current_layer"] is not None
    ):
        return data["status"]["print_stats"]["info"]["current_layer"]

if not we do the calculation based on height

JollyRgrs commented 2 months ago

this was a print I did last night, it still did not show a total layer count in HA.

image

I checked the gcode and that is the only place where it has LAYER_COUNT set in it.

However, there is one line towards the very bottom where it seems Prusaslicer sets all the slicer settings, including the "start gcode" and does contain the string "LAYER_COUNT", is this throwing it off? this is way down at like 92118 out of 92201 total lines in the gcode. Is it possible it is taking the last value of when it found "LAYER_COUNT:" and is getting {total_layer_count} as opposed to the actually populated value up on line 19? If that is the case, I would think a simple check to find the first value for LAYER_COUNT that is an INT and stop the search after that.

; start_gcode = SET_PRINT_STATS_INFO TOTAL_LAYER=[total_layer_count] CURRENT_LAYER=0\nprint_start BED_TEMP={first_layer_bed_temperature[0]} EXTRUDER_TEMP={first_layer_temperature[0]}\n;LAYER_COUNT:{total_layer_count}\n;LAYER:1\nSET_PRINT_STATS_INFO CURRENT_LAYER=1
marcolivierarsenault commented 2 months ago

from your logs:

2024-08-28 14:19:57.725 DEBUG (MainThread) [custom_components.moonraker] Query Result, uuid: d83efe4d-0924-43d1-8780-c5d5f4e15103: {'size': 2464502, 'modified': 1724822149.3122466, 'uuid': '773edbce-c4a7-4821-918d-089148bef9e7', 'slicer': 'PrusaSlicer', 'slicer_version': '2.8.0+win64', 'gcode_start_byte': 35048, 'gcode_end_byte': 2450358, 'object_height': 36.96, 'estimated_time': 5424, 'nozzle_diameter': 0.4, 'layer_height': 0.28, 'first_layer_height': 0.28, 'first_layer_extr_temp': 200.0, 'first_layer_bed_temp': 60.0, 'chamber_temp': 0.0, 'filament_name': 'Hatchbox PLA (Black)', 'filament_type': 'PLA', 'filament_total': 4929.35, 'filament_weight_total': 14.82, 'thumbnails': [{'width': 300, 'height': 300, 'size': 24308, 'relative_path': '.thumbs/Phone Arm Mount_1h30m_0.28mm_195C_PLA_ENDER3-300x300.png'}, {'width': 32, 'height': 32, 'size': 671, 'relative_path': '.thumbs/Phone Arm Mount_1h30m_0.28mm_195C_PLA_ENDER3-32x32.png'}], 'print_start_time': 1724864464.0206156, 'job_id': '000303', 'filename': 'Phone Arm Mount_1h30m_0.28mm_195C_PLA_ENDER3.gcode'}

some other printer spit also layer_count now I don't know why does not

JollyRgrs commented 2 months ago

It looks like in the response printer.info has the information needed. This seems to be consistent with what klipper is supposed to provide. It seems like you are pulling from server.files.metadata, I might suggest pulling from printer.info or at least supporting data residing there. This is what Klipper documentation mentions. I think the files.metadata very strongly relies on the individual slicer

marcolivierarsenault commented 2 months ago

yeah, fully agree, I am starting to think that printer.info should be first place we look server.files.metadata second We will look at making a patch in next few days/week

marcolivierarsenault commented 2 months ago

are you able to test the new code

marcolivierarsenault commented 2 months ago

If possible, can you try #398

Simply replace the sensor.py file in your Home Assistant setup

home_assistant_root/custom_components/moonraker/sensor.py

and replace it with https://raw.githubusercontent.com/marcolivierarsenault/moonraker-home-assistant/92ea80a6deae03dbeffeaa588f89c94378d17d75/custom_components/moonraker/sensor.py

JollyRgrs commented 2 months ago

I tried out the new sensor.py and great success! image Thanks for the quick turn around on that!

marcolivierarsenault commented 2 months ago

perfect, will ship and this will be part of next Release