-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Total Layer always 0 with Prusaslicer #397
Comments
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) |
Look similar to #321 |
Checking the logs, I saw https://moonraker.readthedocs.io/en/latest/printer_objects/#print_stats
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 Start G-code
After layer change G-code
Now my logs show correct information.
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). |
Hey can you send me a copy of the logs with the I am surprise you still have 0 with this log |
@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
Here is a sample of the custom_components.moonraker lines during a print
|
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 |
ok very interesting, so, As of now, we look for this info in the GCode metadata This is an example. In a field called Now, you don't have this in your GCode, but you do have it in the |
Right now we look for layer count (For the total layer) For current layer we first check if you have the info in your stats
if not we do the calculation based on height |
this was a print I did last night, it still did not show a total layer count in HA. 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
|
from your logs:
some other printer spit also |
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 |
yeah, fully agree, I am starting to think that |
are you able to test the new code |
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 |
perfect, will ship and this will be part of next Release |
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:
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?
The text was updated successfully, but these errors were encountered: