core icon indicating copy to clipboard operation
core copied to clipboard

PrusaLink doesn't work with Prusa MK4

Open andreas-bulling opened this issue 1 year ago • 6 comments

The problem

Some entities offered by the integration are not available with the latest MK4 printer:

image

What version of Home Assistant Core has the issue?

core-2024.1.0

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant OS

Integration causing the issue

PrusaLink

Link to integration documentation on our website

https://www.home-assistant.io/integrations/prusalink/

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

andreas-bulling avatar Jan 05 '24 12:01 andreas-bulling

Hey there @balloob, @skaronator, mind taking a look at this issue as it has been labeled with an integration (prusalink) you are listed as a code owner for? Thanks!

Code owner commands

Code owners of prusalink can trigger bot actions by commenting:

  • @home-assistant close Closes the issue.
  • @home-assistant rename Awesome new title Renames the issue.
  • @home-assistant reopen Reopen the issue.
  • @home-assistant unassign prusalink Removes the current integration label and assignees on the issue, add the integration domain after the command.
  • @home-assistant add-label needs-more-information Add a label (needs-more-information, problem in dependency, problem in custom component) to the issue.
  • @home-assistant remove-label needs-more-information Remove a label (needs-more-information, problem in dependency, problem in custom component) on the issue.

(message by CodeOwnersMention)


prusalink documentation prusalink source (message by IssueLinks)

home-assistant[bot] avatar Jan 05 '24 12:01 home-assistant[bot]

Hi,

what firmware version are you running on your MK4? Are there any errors in the log?

Skaronator avatar Jan 05 '24 12:01 Skaronator

I am running v5.1.0 since the latest firmware seems to have a bug that prevents the printer to successfully complete the y-axis calibration.

andreas-bulling avatar Jan 06 '24 16:01 andreas-bulling

Hi,

  1. Can you enable and provide debug logs
  2. Verify that you can reach the PrusaLink Web UI (Got o Settings -> Devices -> PrusaLink -> You Printer -> "Visit" button)? image
  3. Could you remove and re-add the PrusaLink integration in home assistant? Maybe that solves that issue.

Skaronator avatar Jan 09 '24 10:01 Skaronator

@home-assistant add-label needs-more-information

Skaronator avatar Jan 09 '24 10:01 Skaronator

Same issue (firmware 5.1.2), tried removing and then adding back, still nothing. Debug log seems to show no error at all (file attached). home-assistant_prusalink_2024-01-15T18-04-13.185Z.log

Liborsaf avatar Jan 15 '24 18:01 Liborsaf

Yeah, not much to see in the debug log beside that it successfully connected to your printer. Since I don't have a MK4 (only a XL) I cannot reproduce this issue. It would be great if you can provide the raw API response from your printer.

Curl is probably the easiest way to do that, you might have to run that command from your linux server/home assistant installation. Its usually pre-installed.

Adjust IP to your printer IP and enter the password/api-key when asked.

curl -s --digest -u maker 'http://192.168.0.5/api/v1/status'
curl -s --digest -u maker 'http://192.168.0.5/api/v1/job'
curl -s --digest -u maker 'http://192.168.0.5/api/printer'

Ideally, run these commands while the printer is printing.

Thanks

Skaronator avatar Jan 16 '24 14:01 Skaronator

Yeah, not much to see in the debug log beside that it successfully connected to your printer. Since I don't have a MK4 (only a XL) I cannot reproduce this issue. It would be great if you can provide the raw API response from your printer.

Curl is probably the easiest way to do that, you might have to run that command from your linux server/home assistant installation. Its usually pre-installed.

Adjust IP to your printer IP and enter the password/api-key when asked.

curl -s --digest -u maker 'http://192.168.0.5/api/v1/status'
curl -s --digest -u maker 'http://192.168.0.5/api/v1/job'
curl -s --digest -u maker 'http://192.168.0.5/api/printer'

Ideally, run these commands while the printer is printing.

Thanks

API seems to return the correct values just fine. I didn't yet started print, so job endpoint is empty, could send later if needed.

output.log

Liborsaf avatar Jan 16 '24 15:01 Liborsaf

Thanks. JSON data structure is identically to my Prusa XL. So that's not the issue causing this...

Skaronator avatar Jan 16 '24 15:01 Skaronator

I found out if I manually enable these entities, they starts to work. 🤔

But still don't know, why they are disabled by default 😅

image

Liborsaf avatar Jan 16 '24 15:01 Liborsaf

Some are disabled by default, probably to avoid cluttering the UI. They are disabled by default since the very first version of this integration 2 years ago.

https://github.com/home-assistant/core/blob/3ff74fe20fc725781edceeec72e983817caa27fc/homeassistant/components/prusalink/sensor.py#L70

Skaronator avatar Jan 16 '24 15:01 Skaronator

Some are disabled by default, probably to avoid cluttering the UI. They are disabled by default since the very first version of this integration 2 years ago.

https://github.com/home-assistant/core/blob/3ff74fe20fc725781edceeec72e983817caa27fc/homeassistant/components/prusalink/sensor.py#L70

Yes, I noticed that line, but shouldn't these entities be enabled by default if printer supports it?

Liborsaf avatar Jan 16 '24 15:01 Liborsaf

Developer documentation states:

Indicate if the entity should be enabled or disabled when first added to the entity registry. This includes fast-changing diagnostic entities or, assumingly less commonly used entities. For example, a sensor exposing RSSI or battery voltage should typically be set to False; to prevent unneeded (recorded) state changes or UI clutter by these entities.

https://developers.home-assistant.io/docs/core/entity/

Most disabled values are fast-changing ones, so that's why they are disabled.

Skaronator avatar Jan 16 '24 15:01 Skaronator

Developer documentation states:

Indicate if the entity should be enabled or disabled when first added to the entity registry. This includes fast-changing diagnostic entities or, assumingly less commonly used entities. For example, a sensor exposing RSSI or battery voltage should typically be set to False; to prevent unneeded (recorded) state changes or UI clutter by these entities.

https://developers.home-assistant.io/docs/core/entity/

Most disabled values are fast-changing ones, so that's why they are disabled.

Ahh, thanks for explanation! Don't know much about components development for home assistant 😄

Liborsaf avatar Jan 16 '24 15:01 Liborsaf

Closing it as working as expected 👍

balloob avatar Jan 18 '24 02:01 balloob