joseffallman / hass_flashforge

FlashForge 3D printer integration for Home Assistant
MIT License
5 stars 2 forks source link

Temp sensors do not show up for Adventurer 5M Pro #34

Closed scruffyOrc closed 4 months ago

scruffyOrc commented 4 months ago

System Health details

System Information

version core-2024.2.1
installation_type Home Assistant OS
dev false
hassio true
docker true
user root
virtualenv false
python_version 3.12.1
os_name Linux
os_version 6.1.63-haos-raspi
arch aarch64
timezone America/Los_Angeles
config_dir /config
Home Assistant Community Store GitHub API | ok -- | -- GitHub Content | ok GitHub Web | ok GitHub API Calls Remaining | 4823 Installed Version | 1.34.0 Stage | running Available Repositories | 1389 Downloaded Repositories | 22
Home Assistant Cloud logged_in | false -- | -- can_reach_cert_server | ok can_reach_cloud_auth | ok can_reach_cloud | ok
Home Assistant Supervisor host_os | Home Assistant OS 11.5 -- | -- update_channel | stable supervisor_version | supervisor-2024.01.1 agent_version | 1.6.0 docker_version | 24.0.7 disk_total | 28.6 GB disk_used | 14.4 GB healthy | true supported | true board | rpi4-64 supervisor_api | ok version_api | ok installed_addons | Terminal & SSH (9.9.0), Mosquitto broker (6.4.0), Zigbee2MQTT (1.35.3-1), Log Viewer (0.17.0), Cloudflared (5.1.3), File editor (5.8.0), Z-Wave JS UI (3.3.2), Z-Wave JS (0.4.4), ESPHome (2023.12.9), Home Panel (2.7.0), Studio Code Server (5.15.0), Docker Wyze Bridge (2.3.17), Node-RED (17.0.6)
keymaster zwave_integration | zwave_js -- | -- network_status | on
Dashboards dashboards | 2 -- | -- resources | 5 views | 19 mode | storage
Recorder oldest_recorder_run | January 31, 2024 at 7:51 PM -- | -- current_recorder_run | February 10, 2024 at 10:20 AM estimated_db_size | 278.73 MiB database_engine | sqlite database_version | 3.44.2
Sonoff version | 3.5.4 (a4a8c5f) -- | -- cloud_online | 0 / 2 local_online | 1 / 1

Checklist

Describe the issue

Not sure if this is really a bug or if this should be a feature request. Installed the integration and configured it. It correctly identifies my printer, as the Adventurer 5M Pro, and creates the entities for the Camera, Job Percentage and Status and they all show up and update correctly in Home Assistant!!! One of the features lists in for the integration is temp sensors however the integration didn't manage to find the entities. I can help debug this if you can give me some ideas on how to help grab additional data on what it's seeing when it's polling the printer for information.

Reproduction steps

Load and configure the integration, the two temp sensors do not show up.

Debug logs

024-02-10 10:58:40.513 DEBUG (MainThread) [custom_components.flashforge.data_update_coordinator] Finished fetching FlashForge-e0569b7ee80bcea3f58d40d85486fb74 data in 0.034 seconds (success: True)
2024-02-10 10:58:40.515 INFO (MainThread) [homeassistant.components.sensor] Setting up flashforge.sensor
2024-02-10 10:58:40.515 INFO (MainThread) [homeassistant.components.camera] Setting up flashforge.camera
2024-02-10 10:58:40.519 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new sensor.flashforge entity: sensor.adventurer_5m_pro_status
2024-02-10 10:58:40.521 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new sensor.flashforge entity: sensor.adventurer_5m_pro_job_percentage
2024-02-10 10:58:40.526 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new camera.flashforge entity: camera.adventurer_5m_pro_camera

Diagnostics dump

No response

joseffallman commented 4 months ago

Hi, glad you found this integration.

Interesting, then they'll have made some changes in how temperatures are reported. I made this integration to fit the Adventure 4. I do not own a M5 and can't debug it. But if you have the possibility to inspect the network protocol then perhaps i can add support for it. The best way would be if you record with wireshark when you have flashprint running and connected to the printer.

scruffyOrc commented 4 months ago

Ok, I'll fire up wireshark and let you know what I see.

On Mon, Feb 12, 2024 at 1:21 PM joseffallman @.***> wrote:

Hi, glad you found this integration.

Interesting, then they'll have made some changes in how temperatures are reported. I made this integration to fit the Adventure 4. I do not own a M5 and can't debug it. But if you have the possibility to inspect the network protocol then perhaps i can add support for it. The best way would be if you record with wireshark when you have flashprint running and connected to the printer.

— Reply to this email directly, view it on GitHub https://github.com/joseffallman/hass_flashforge/issues/34#issuecomment-1939604964, or unsubscribe https://github.com/notifications/unsubscribe-auth/AC3NPIKRFTCLTYYYJJ3BCEDYTKBVDAVCNFSM6AAAAABDC5VDVGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSMZZGYYDIOJWGQ . You are receiving this because you authored the thread.Message ID: @.***>

scruffyOrc commented 4 months ago

Here's the packet from wireshark packet with the M105 coming back:

0000 d8 d3 85 94 89 a7 88 a9 a7 97 d6 d0 08 00 45 00 ..............E. 0010 00 67 79 55 40 00 40 06 3b 9b c0 a8 02 1a c0 a8 .gyU@.@.;....... 0020 02 36 22 c3 ed 8a 4f 22 f9 5a 0c a4 81 51 50 18 .6"...O".Z...QP. 0030 0f a5 18 ce 00 00 43 4d 44 20 4d 31 30 35 20 52 ......CMD M105 R 0040 65 63 65 69 76 65 64 2e 0d 0a 54 30 3a 31 30 34 eceived...T0:104 0050 2e 35 2f 32 32 35 2e 30 20 54 31 3a 30 2e 30 2f .5/225.0 T1:0.0/ 0060 30 2e 30 20 42 3a 35 31 2e 33 2f 35 30 2e 30 0d 0.0 B:51.3/50.0. 0070 0a 6f 6b 0d 0a .ok..

Let me know if that's what you're looking for or if there's something else I can grab for you. I may poke around a bit in the code myself (I'm not a python person though...more C++, C#, Java so it would literally be poking in the code and probably not doing much good).

scruffyOrc commented 4 months ago

I only poked around ffpp, but, could it be because you are using decimal temps now and your regex are expecting integer temps?

        "Extruder Temp", None, "(T0)\s?:\s?(\d+)/(\d*)")  # noqa

Should be something like: "Extruder Temp", None, "(T0)\s?:\s?(\d.)?\d+$/(\d.)?\d+$")
You'd want something like that for the bed temps too...

I think it handles both decimal and non-decimal strings...

scruffyOrc commented 4 months ago

I just went into ffpp and created a pr with the regex changes in it. I ran some tests to make sure that it still sees non-decimal temps correctly, and should also now work for the newer firmware versions that do return decimal temps.

joseffallman commented 4 months ago

I'm really sorry but I have missed that you sent the wireshark response. Great, thanks. I'll will have a look and merge it during this weekend.

joseffallman commented 4 months ago

There is a new version, press the update button in HACS, and check it out!

Let me know if it's working and if so I'll close this issue.

scruffyOrc commented 4 months ago

That did it!! Thanks for getting it working!

joseffallman commented 4 months ago

Thank you 👍