hass-flashforge-adventurer-3 icon indicating copy to clipboard operation
hass-flashforge-adventurer-3 copied to clipboard

Flashforge Adventurer 4, 5M, 5M Pro support

Open f00d4tehg0dz opened this issue 1 year ago • 48 comments
trafficstars

  • Added support for Adventurer 4, 5M and 5M Pro
  • Added selector system for configuration to choose your Flashforge Added regex for additional Adventurer 4 attributes
  • Added support for Flashforge Finder. Same regex as Adventurer 3

-- Need Testing --

  • Flashforge Adventurer 5M
  • Flashforge Adventurer 4

Screenshots

configuration-card

card

nozzle-attributes

progress-attributes

state-attributes

f00d4tehg0dz avatar Mar 24 '24 04:03 f00d4tehg0dz

How do i install this update? 🙏🏾

gelimelech avatar Mar 24 '24 10:03 gelimelech

How do i install this update? 🙏🏾

The normal method won't be available as @modrzew needs to review, ask for changes if necessary and approve the PR, and merge.

For now you can simple download the .zip here:

  • https://github.com/f00d4tehg0dz/hass-flashforge-adventurer-3/archive/refs/tags/v1.0.5.zip
  • Extract the flashforge_adventurer_3 folder (which is inside the custom_components folder)
  • Copy the folder to your Home Assistant HACS custom_components directory. That could look like /config/home-assistant/custom_components/flashforge_adventurer_3
  • Restart Home Assistant
  • Add Integration
  • Add Flashforge Adventurer 3
  • Input your 3D Printers IP and select the model you have
  • Add the respective cards to your Home Assistant Dashboard

My card YAML for reference. I'm using the mushroom-entity-card template however.

type: vertical-stack
cards:
  - show_state: false
    show_name: false
    camera_view: auto
    type: picture-entity
    entity: camera.flashforge_adventurer_5m_pro_camera
    camera_image: camera.flashforge_adventurer_5m_pro_camera
    name: Camera
    hold_action:
      action: more-info
  - type: gauge
    entity: sensor.flashforge_adventurer_5m_pro_progress
    name: Progress
  - type: custom:mushroom-entity-card
    entity: sensor.flashforge_adventurer_5m_pro_state
    name: State
  - type: entities
    entities:
      - entity: sensor.flashforge_adventurer_5m_pro_nozzle_temperature
        secondary_info: none
        name: Nozzle
    show_header_toggle: false

f00d4tehg0dz avatar Mar 24 '24 17:03 f00d4tehg0dz

How do i install this update? 🙏🏾

How do i install this update? 🙏🏾

The normal method won't be available as @modrzew needs to review, ask for changes if necessary and approve the PR, and merge.

For now you can simple download the .zip here:

* https://github.com/f00d4tehg0dz/hass-flashforge-adventurer-3/archive/refs/heads/feature/flashforge-adventurer-5m-pro.zip

* Extract the `flashforge_adventurer_3` folder (which is inside the `custom_components` folder)

* Copy the folder to your Home Assistant HACS `custom_components` directory. That could look like /config/home-assistant/custom_components/flashforge_adventurer_3

* Restart Home Assistant

* Add Integration

* Add Flashforge Adventurer 3

* Input your 3D Printers IP and select the model you have

* Add the respective cards to your Home Assistant Dashboard

My card YAML for reference. I'm using the mushroom-entity-card template however.

type: vertical-stack
cards:
  - show_state: false
    show_name: false
    camera_view: auto
    type: picture-entity
    entity: camera.flashforge_adventurer_5m_pro_camera
    camera_image: camera.flashforge_adventurer_5m_pro_camera
    name: Camera
    hold_action:
      action: more-info
  - type: gauge
    entity: sensor.flashforge_adventurer_5m_pro_progress
    name: Progress
  - type: custom:mushroom-entity-card
    entity: sensor.flashforge_adventurer_5m_pro_state
    name: State
  - type: entities
    entities:
      - entity: sensor.flashforge_adventurer_5m_pro_nozzle_temperature
        secondary_info: none
        name: Nozzle
    show_header_toggle: false

Thank you very much! it wotks 😁

gelimelech avatar Mar 24 '24 19:03 gelimelech

  • Added support for Adventurer 4, 5M and 5M Pro
  • Added selector system for configuration to choose your Flashforge Added regex for additional Adventurer 4 attributes
  • Added support for Flashforge Finder. Same regex as Adventurer 3

-- Need Testing --

  • Flashforge Adventurer 5M
  • Flashforge Adventurer 4

Running your code. Adventurer 5M pro. All seems fine. I had to figure out how to show the attributes in Lovelace though. But it works.

mistraller avatar Mar 30 '24 23:03 mistraller

@f00d4tehg0dz Saw these in logs. (Printer is powered off btw) Logger: homeassistant.helpers.integration_platform Bron: helpers/integration_platform.py:52 First occurred: 00:24:38 (9 gebeurtenissen) Laatst gelogd: 00:26:44

Unexpected error importing FlashForge_adventurer_3/logbook.py Unexpected error importing FlashForge_adventurer_3/system_health.py Unexpected error importing FlashForge_adventurer_3/cast.py Unexpected error importing FlashForge_adventurer_3/energy.py Unexpected error importing FlashForge_adventurer_3/hardware.py Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/integration_platform.py", line 52, in _get_platform return integration.get_platform(platform_name) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/loader.py", line 1010, in get_platform return self._load_platform(platform_name) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/loader.py", line 1025, in _load_platform cache[full_name] = self._import_platform(platform_name) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/loader.py", line 1058, in _import_platform return importlib.import_module(f"{self.pkg_path}.{platform_name}") ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/importlib/init.py", line 90, in import_module return _bootstrap._gcd_import(name[level:], package, level) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "", line 1387, in _gcd_import File "", line 1360, in _find_and_load File "", line 1324, in _find_and_load_unlocked ModuleNotFoundError: No module named 'custom_components.flashforge_adventurer_3.diagnostics'

mistraller avatar Mar 31 '24 22:03 mistraller

I tested it on my Flashforge Adventure 5 and it works without issue. 👍

Geoffery10 avatar Apr 13 '24 14:04 Geoffery10

Can you tell me which printers you've tested these changes on? Sadly I no longer have my Adventurer 3, so we'll need to work around that with testing 😅

Hey! No problem. Unfortunately, I don't have Adventurer 3 either. I have Flashforge Finder and Flashforge 5M Pro. I made an assumption that the Flashforge 5M would be the same as Flashforge 5M Pro. However, I'm happy to remove that model as it's not best practice to assume. Based on other comments, Adventurer 4 worked as well. I was debating making a specific exception for Flashforge Finder to disable the camera as that model never had one 😉

I will go through and revert some of the changes and adjust accordingly based on your comments. Thanks so much for replying back! ❤️

f00d4tehg0dz avatar Apr 18 '24 13:04 f00d4tehg0dz

As I don't have my Adventurer 3 anymore, it's hard for me to verify the changes anymore anyway. So maybe let's leave the 5M under the assumption that it works simialrly to 5M Pro, and in case something goes wrong we can always fix it later 🙂

modrzew avatar Apr 19 '24 12:04 modrzew

As I don't have my Adventurer 3 anymore, it's hard for me to verify the changes anymore anyway. So maybe let's leave the 5M under the assumption that it works simialrly to 5M Pro, and in case something goes wrong we can always fix it later 🙂

Main difference between 5m and 5mpro is camera. Did you test already with the new flashforge firmware? There are many complaints about camera on 5m pro after installing the new 2.6.5 firmware.

mistraller avatar Apr 19 '24 12:04 mistraller

As I don't have my Adventurer 3 anymore, it's hard for me to verify the changes anymore anyway. So maybe let's leave the 5M under the assumption that it works simialrly to 5M Pro, and in case something goes wrong we can always fix it later 🙂

Main difference between 5m and 5mpro is camera. Did you test already with the new flashforge firmware? There are many complaints about camera on 5m pro after installing the new 2.6.5 firmware.

No issues with the camera for 5M Pro. I just installed the new firmware and tested. Works just fine.

I plan on having all the changes submitted by EOW. I'll keep you all posted. Thanks!

f00d4tehg0dz avatar Apr 29 '24 01:04 f00d4tehg0dz

I have just received a 5M, not Pro, so I'd be happy to test and confirm it if needed. Looking forward to having this integration available.

timnolte avatar May 12 '24 00:05 timnolte

I have just received a 5M, not Pro, so I'd be happy to test and confirm it if needed. Looking forward to having this integration available.

I'd love for you to test. I just submitted changes in this PR. Feel free to grab the PR and test it out on your HA.

f00d4tehg0dz avatar May 24 '24 13:05 f00d4tehg0dz

Just a ping regarding the adventurer 4,

Progress bar doesn't update when printing stays on 0%. Camera works fine no issues there. state works fine changes between printing/idle.

Not sure if you can pull temperature status on the adventure 4 as that's not showing either.

samjones108 avatar May 24 '24 18:05 samjones108

Just a ping regarding the adventurer 4,

Progress bar doesn't update when printing stays on 0%. Camera works fine no issues there. state works fine changes between printing/idle.

Not sure if you can pull temperature status on the adventure 4 as that's not showing either.

Was it working before prior to this PR today?

f00d4tehg0dz avatar May 24 '24 19:05 f00d4tehg0dz

Unsure, Just found the addon today. the progress was working with the published version using the adventurer 3 settings but not on the above zip version.

samjones108 avatar May 24 '24 23:05 samjones108

Unsure, Just found the addon today. the progress was working with the published version using the adventurer 3 settings but not on the above zip version.

Got it. Thanks for clarifying. Let me see if I made a mistake that affected you somewhere.

f00d4tehg0dz avatar May 25 '24 12:05 f00d4tehg0dz

Unsure, Just found the addon today. the progress was working with the published version using the adventurer 3 settings but not on the above zip version.

Give this version a shot if you'd like. Progress bar should work now. Regarding the temperature not working, I'm not sure what I'm missing there. I went through @modrzew codebase and it appeared to be similar to mine.

https://github.com/f00d4tehg0dz/hass-flashforge-adventurer-3/archive/refs/tags/v1.0.5.zip

f00d4tehg0dz avatar May 26 '24 10:05 f00d4tehg0dz

@f00d4tehg0dz something seems off. I downloaded the 1.0.6 versions from here: https://github.com/f00d4tehg0dz/hass-flashforge-adventurer-3/archive/refs/tags/v1.0.6.zip but when I installed it and restarted HA I get no prompt for selecting my Adventurer model.

timnolte avatar May 28 '24 19:05 timnolte

@f00d4tehg0dz something seems off. I downloaded the 1.0.6 versions from here: https://github.com/f00d4tehg0dz/hass-flashforge-adventurer-3/archive/refs/tags/v1.0.6.zip but when I installed it and restarted HA I get no prompt for selecting my Adventurer model.

I'm going to try the v1.0.5.zip to see if it's any different.

timnolte avatar May 28 '24 19:05 timnolte

@f00d4tehg0dz something seems off. I downloaded the 1.0.6 versions from here: https://github.com/f00d4tehg0dz/hass-flashforge-adventurer-3/archive/refs/tags/v1.0.6.zip but when I installed it and restarted HA I get no prompt for selecting my Adventurer model.

I'm going to try the v1.0.5.zip to see if it's any different.

aww, dang, that's concerning... When I'm off work, I'll play around and try a fresh install and see.

Did you, by chance, restart HA entirely? Or a refresh? ( I realize you said restart, but just in case...)

f00d4tehg0dz avatar May 28 '24 19:05 f00d4tehg0dz

@f00d4tehg0dz something seems off. I downloaded the 1.0.6 versions from here: https://github.com/f00d4tehg0dz/hass-flashforge-adventurer-3/archive/refs/tags/v1.0.6.zip but when I installed it and restarted HA I get no prompt for selecting my Adventurer model.

I'm going to try the v1.0.5.zip to see if it's any different.

aww, dang, that's concerning... When I'm off work, I'll play around and try a fresh install and see.

Did you, by chance, restart HA entirely? Or a refresh? ( I realize you said restart, but just in case...)

So, I'm not sure what's going on, the v1.0.5.zip is also not working. Yes, I did a full HA restart. I never had the integration installed and I can see that it's not present before a restart but is afterwards. I'm going to try the zip archive of your branch instead of the tags. Oh, wait a minute. So yeah, your tags in your repo both v1.0.5 and v1.0.6 are of the same commit.

image

And looking at the source of that commit and you aren't actually tagging your commits.

image

timnolte avatar May 28 '24 19:05 timnolte

@f00d4tehg0dz something seems off. I downloaded the 1.0.6 versions from here: https://github.com/f00d4tehg0dz/hass-flashforge-adventurer-3/archive/refs/tags/v1.0.6.zip but when I installed it and restarted HA I get no prompt for selecting my Adventurer model.

So, I'm not sure what's going on, the v1.0.5.zip is also not working. Yes, I did a full HA restart. I never had the integration installed and I can see that it's not present before a restart but is afterwards. I'm going to try the zip archive of your branch instead of the tags. Oh, wait a minute. So yeah, your tags in your repo both v1.0.5 and v1.0.6 are of the same commit.

And looking at the source of that commit and you aren't actually tagging your commits.

Holy cow. You're right. https://github.com/f00d4tehg0dz/hass-flashforge-adventurer-3/releases/tag/v1.0.7 Now it's tagged correctly. Yikes. Thank you for catching this!

f00d4tehg0dz avatar May 28 '24 19:05 f00d4tehg0dz

Thinking about layers-to-print and layers done; is that not just the way how the progress is calculated? My AD5M shows it progress the same way; if the last layers are less work (and that is most of the time unless I'm printing a cube ;) ), the precentage will go much quicker.

mistraller avatar May 28 '24 21:05 mistraller

So I just happened to take a look at the state when my print job was finished and there are a bunch of attributes that are already available. If you want to display them you could easily create some custom sensors to display those values in a dedicated way.

Screenshot_20240528-181743.png

timnolte avatar May 28 '24 22:05 timnolte

Something that is interesting with those values is that the print job is complete at 100% but it says it printing layer 401 with all layers being 411. 🤔

timnolte avatar May 28 '24 22:05 timnolte

So I just happened to take a look at the state when my print job was finished and there are a bunch of attributes that are already available. If you want to display them you could easily create some custom sensors to display those values in a dedicated way.

Correct, that is intentional. You can use an Entity card to split out each attribute. I just took a screenshot of a current print. I originally had included one of the attributes as a sensor. However, during the PR review, it was requested to remove that sensor and leave all as attributes. image

f00d4tehg0dz avatar May 28 '24 23:05 f00d4tehg0dz

Something that is interesting with those values is that the print job is complete at 100% but it says it printing layer 401 with all layers being 411. 🤔

That is interesting. I'll do some debugging on that. I had increased the update interval to 30 seconds from 60 seconds. However, the layers shouldn't have been off that much...

f00d4tehg0dz avatar May 28 '24 23:05 f00d4tehg0dz

Something that is interesting with those values is that the print job is complete at 100% but it says it printing layer 401 with all layers being 411. 🤔

That is interesting. I'll do some debugging on that. I had increased the update interval to 30 seconds from 60 seconds. However, the layers shouldn't have been off that much...

So here is something equally strange. The total layers is showing as the same value as the current layer during printing.

Screenshot_20240529-191334.png

timnolte avatar May 29 '24 23:05 timnolte

Something that is interesting with those values is that the print job is complete at 100% but it says it printing layer 401 with all layers being 411. 🤔

That is interesting. I'll do some debugging on that. I had increased the update interval to 30 seconds from 60 seconds. However, the layers shouldn't have been off that much...

So here is something equally strange. The total layers is showing as the same value as the current layer during printing.

I may limit the total layer to Adventurer 4 and 5M Pro, as they appear to be working there. I highly doubt the 5M would be any different, though.

f00d4tehg0dz avatar May 30 '24 01:05 f00d4tehg0dz

Something that is interesting with those values is that the print job is complete at 100% but it says it printing layer 401 with all layers being 411. 🤔

That is interesting. I'll do some debugging on that. I had increased the update interval to 30 seconds from 60 seconds. However, the layers shouldn't have been off that much...

So here is something equally strange. The total layers is showing as the same value as the current layer during printing.

I may limit the total layer to Adventurer 4 and 5M Pro, as they appear to be working there. I highly doubt the 5M would be any different, though.

To a degree, other than the prebuilt enclosure and hardware (the camera and the air filtration system), I thought that the 5M Pro software was essentially the same as the 5M.

timnolte avatar May 30 '24 01:05 timnolte