WaresWichall / hass-anycubic_cloud

Anycubic Cloud component for Home Assistant
GNU General Public License v3.0
13 stars 2 forks source link

Resin printer support #10

Open AurelioB opened 3 months ago

AurelioB commented 3 months ago

I've got an M7 Pro. I managed to setup the integration with my anycubic account but unfortunately it crashes when dealing with my printer (and I guess with any resin printer) probably because it's got no nozzle. This is the error I'm getting:

'NoneType' object has no attribute 'curr_nozzle_temp'

I understand that resin printers are very different to FDM printers, but maybe they could also be simpler to support (less stuff to check)

I'd be glad to help debug this if needed

EDIT: Here's the full error:

2024-08-13 23:56:14.966 ERROR (MainThread) [custom_components.anycubic_cloud] Unexpected error fetching anycubic_cloud data Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 354, in _async_refresh self.data = await self._async_update_data() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/anycubic_cloud/coordinator.py", line 369, in _async_update_data data_dict = self._build_coordinator_data() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/anycubic_cloud/coordinator.py", line 359, in _build_coordinator_data data_dict['printers'][printer_id] = self._build_printer_dict(printer) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/anycubic_cloud/coordinator.py", line 210, in _build_printer_dict "curr_nozzle_temp": printer.parameter.curr_nozzle_temp, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AttributeError: 'NoneType' object has no attribute 'curr_nozzle_temp' 2024-08-13 23:56:36.833 ERROR (MainThread) [custom_components.anycubic_cloud] Unexpected error fetching anycubic_cloud data Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 354, in _async_refresh self.data = await self._async_update_data() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/anycubic_cloud/coordinator.py", line 369, in _async_update_data data_dict = self._build_coordinator_data() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/anycubic_cloud/coordinator.py", line 359, in _build_coordinator_data data_dict['printers'][printer_id] = self._build_printer_dict(printer) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/anycubic_cloud/coordinator.py", line 210, in _build_printer_dict "curr_nozzle_temp": printer.parameter.curr_nozzle_temp, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AttributeError: 'NoneType' object has no attribute 'curr_nozzle_temp'

WaresWichall commented 3 months ago

Aha I was waiting for the first resin user to come along :D

Yeah there will be loads of errors for sure, but you say you managed to add the config to home assistant?

If so you should be able to download the diagnostics for the integration and then if you can send me that I can work through stuff. Will also need to work out the resin MQTT data too but step 1 first :)

Are you on the anycubic discord? That's the easiest way to send me logs in PMs I think

adamoutler commented 3 months ago

Hello, I made the original Anycubic Wifi domain for the m5s. I'm very glad to see support for the Anycubic Cloud and not just wifi anymore! This is great and allows me to get notifications when my printer is done. Thank you!

There are some problems I've encountered that I want to report.

Current prerelease version displays sensors which do not exist on the Mono M5S resin printer image image

File support does not work with m5s resin image

Logs here: https://hackedyour.info/EhWduy775flNkCee

See here for more constructive feedback. https://community.home-assistant.io/t/anycubic-cloud-component-frontend-card/742295/27?u=adamoutler

adamoutler commented 2 months ago

Mqtt-related message https://hackedyour.info/D8bPGY8dTrX3NOa4

WaresWichall commented 2 months ago

I've just released 0.0.13 with initial resin printer support :)

I need to do more work to add resin print settings to the Print Settings modal still.

I also will need from one of you a home assistant log for the duration of a print with the Debug Mode enabled in the anycubic cloud integration, you'll also need to change the MQTT connection mode to at least printer online - or always on. And lastly you'll need the following in your home assistant configuration.yaml to get the full logging of the component:

logger:
  logs:
    custom_components.anycubic_cloud: debug

Restart home assistant afterwards and then start a print with a fairly fresh log - it will be best to DM me your log not post it here and feel free to remove anything not anycubic related from it