Duet3D Logo Duet3D
    • Tags
    • Documentation
    • Order
    • Register
    • Login

    Home Assistant Integration

    Scheduled Pinned Locked Moved
    Third-party software
    14
    47
    5.2k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • nikschaundefined
      nikscha @MintyTrebor
      last edited by

      @MintyTrebor Thanks, I'll check it out!

      I just found out that there is also a Home Assistant Integration for Prusa:
      https://www.home-assistant.io/integrations/prusalink/

      ca99f286-ee3c-4822-8b29-27c26b793383-image.png

      .

      The octoprint integration looks great too:

      d94bd3fc-b536-4d65-a67f-90e6fd026daa-image.png
      f5e02e1c-4e81-44f7-a7cd-458b1aee2c29-image.png
      dd4ee61f-56fe-4ed4-ac28-a3c52a401070-image.png

      Stay in school

      1 Reply Last reply Reply Quote 0
      • oliofundefined
        oliof
        last edited by oliof

        spelunking the commits for the upcoming v3.5 release it looks like RRF will grow native MQTT support soon. EDIT: Probably not on all boards, I haven't had time to read this PR completely.

        <>RatRig V-Minion Fly Super5Pro RRF<> V-Core 3.1 IDEX k*****r <> RatRig V-Minion SKR 2 Marlin<>

        Baenwortundefined nikschaundefined 2 Replies Last reply Reply Quote 3
        • Baenwortundefined
          Baenwort @oliof
          last edited by

          I'm hoping to use Home Assistant to turn on a HEPA filter that is powered off a HA plug strip. This way depending on the filament configuration it either turns on automatically at the start of a print and off once a certain time after completion or turns on after print completion and runs for a timer.

          HA can control the fan and timer and just needs duet to tell it the print reached a milestone (set on the duet side when start or end of print macro is triggered per filament.

          I've also got MotionEye cameras that feed into HA and if I could start or stop a print from HA I would have those buttons on the page with the camera views.

          Last reason I'd like HA integration is I have touchscreena around the house that control things in HA and if duet had integration I could just walk up to one of those and change tabs with the existing build instead of having to larch something else or modify the build.

          1 Reply Last reply Reply Quote 0
          • nikschaundefined
            nikscha @oliof
            last edited by

            @oliof Uhh that would be a nice start!
            I'm hoping that prusas release of their "PrusaLink" integration for Home Assistant will cause RRF to get one too

            Stay in school

            1 Reply Last reply Reply Quote 0
            • pkosundefined
              pkos
              last edited by pkos

              While waiting, you can easily use this:
              https://github.com/iz3man/duet3d/blob/main/duet3d.yaml

              Just add the lines to your configuration.yaml, modify for your printer and restart HA.

              Voron 2.4 (Duet 3 6HC + 3HC standalone), Voron SW (Duet 3 mini 5+ standalone), Voron Trident (Duet 3 mini 5+ standalone), Voron 0.1

              Proschi3Dundefined izemanundefined 2 Replies Last reply Reply Quote 2
              • Proschi3Dundefined
                Proschi3D @pkos
                last edited by

                @pkos Nice πŸ‘

                Love my Duet 3 Mini.
                https://www.instagram.com/proschi3d
                https://youtube.com/@proschi3d
                https://www.proschi3d.de

                1 Reply Last reply Reply Quote 0
                • nikschaundefined
                  nikscha
                  last edited by nikscha

                  @pkos Thanks! But I don't think this is compatible with RRF 3 anymore πŸ˜•
                  @izeman (hoping this is the right user ^^)

                  Stay in school

                  pkosundefined 1 Reply Last reply Reply Quote 0
                  • pkosundefined
                    pkos @nikscha
                    last edited by

                    @nikscha It works πŸ™‚ I've been using it for ages now, although I don't have a very elaborate layout. I mostly have HA watch hotend temp and once it's been at 45C for 2 minutes after a print - it switches the printer off.

                    My code is as follows:

                      - platform: rest
                        name: Voron_24 Status
                        resource: http://<ip_here>/rr_status?type=3
                        value_template: "{{ value_json.status }}"
                        json_attributes:
                          - temps
                          - fractionPrinted
                        force_update: true
                    
                      - platform: template
                        sensors:
                          voron_24_head_temp_current:
                            value_template: "{{ states.sensor.voron_24_status.attributes.temps.current[1] }}"
                            friendly_name: Hotend Temp
                          voron_24_bed_temp_current:
                            value_template: "{{ states.sensor.voron_24_status.attributes.temps.current[0] }}"
                            friendly_name: Hotbed Temp
                          voron_24_print_percentage:
                            value_template: "{{ states.sensor.voron_24_status.attributes.fractionPrinted }}%"
                            friendly_name: Print progress 
                    

                    And this is how I put display it in Lovelace.

                    964cc527-896b-446d-bb7d-ba148869390b-image.png

                    The important bits here (if you know this, forgive me, if not - maybe it will help) - is to keep the naming consistent. HA will convert the name from the first sensor into an entity_id.
                    So in my case, here it reads Voron_24 Status. HA will take it, convert it internally to voron_24_status and this is what you use below in the actual sensors.

                    And since I am waaaaaay too lazy ( πŸ˜‰ ) I am going to wait for MQTT to come along before solving issues like not zeroing out of entries when the printer is off πŸ™‚

                    See if that will work and if you get stuck, ping me and I'll be happy to help.

                    Voron 2.4 (Duet 3 6HC + 3HC standalone), Voron SW (Duet 3 mini 5+ standalone), Voron Trident (Duet 3 mini 5+ standalone), Voron 0.1

                    1 Reply Last reply Reply Quote 0
                    • repier37undefined
                      repier37
                      last edited by

                      @nikscha I could not make it work either using RRF3.
                      I ended up modifying another integration to make it work with RRF 3.
                      You can find it on my repo :
                      https://github.com/repier37/hass-Duet3D
                      Basically I just added authentication to the integration I forked to be able to retrieve data.
                      It is still using the rr_status command that is planned to be removed in RRF3.5 if I recall correctly, but it should work with earlier version. It should not be too hard to move to rr_model as it should only be changing json parsing.

                      paulg4hundefined Reineundefined 2 Replies Last reply Reply Quote 1
                      • paulg4hundefined
                        paulg4h @repier37
                        last edited by

                        @repier37

                        Many thank's for your work!

                        Hopefully we can expect a update do see the RRF 3.5 working too.

                        1 Reply Last reply Reply Quote 0
                        • Reineundefined
                          Reine @repier37
                          last edited by

                          @repier37 just installed your plugin but it doesn't seam to connect to my printer (6HC/v3.4.5 with SBC).

                          If I send a manual http request it seams like I get access without a password.
                          http://10.0.0.68/machine/connect?password=

                          Any ideas what I might have done wrong? All sensors are setup, but values do not change.

                            duet3d_printer:
                              host: !secret duet3d_host
                              name: !secret duet3d_name
                              password: !secret duet3d_password
                              number_of_tools: 1
                              bed: true
                              sensors:
                                monitored_conditions:
                                  - 'Current State'
                                  - 'Temperatures'
                                  - 'Job Percentage'
                                  - 'Time Elapsed'
                                  - 'Time Remaining'
                                  - 'Position'
                          
                          Reineundefined 1 Reply Last reply Reply Quote 0
                          • Reineundefined
                            Reine @Reine
                            last edited by Reine

                            02581343-2f00-4986-ad1b-0e73c218f094-image.png

                            Seams like rr_status has been deprecated in v3.4.5, http://10.0.0.68/machine/Status works though so for this to work with the current version of RRF some work needs to be done on this integration. unfortunately I'm not a Python dev.

                            Btw, is there a websocket or webhooks that can be used or can we only rely on polling updates?

                            Lyr3xundefined 1 Reply Last reply Reply Quote 0
                            • Lyr3xundefined
                              Lyr3x @Reine
                              last edited by Lyr3x

                              Hey folks,
                              i picked this topic up yesterday and refactored the integration to make it work again with the new /machine/status endpoint.
                              https://github.com/Lyr3x/hass-Duet3D

                              Not happy yet with the position entity and the fact that there is no proper config flow and entities are not attached to a device. I will work on that in the next days. Might take some time as I need to dig into that to understand how custom components are built and what the spaghetti code in the integration is doing πŸ˜„
                              I removed the job percentage yesterday temporarily to get this out of my way, because there is not such attribute, but I already spotted that it can be easily calculated with the file size. Contributions are welcomed!

                              I also removed the password property, as this is not needed for the endpoint. Furthermore, I might need to set up a proper session when the integration has maybe a service to send G/M codes as well. We'll see.

                              Hope that it is of some help for you as well πŸ™‚

                              nikschaundefined 1 Reply Last reply Reply Quote 2
                              • izemanundefined
                                izeman @pkos
                                last edited by

                                @pkos said in Home Assistant Integration:

                                While waiting, you can easily use this:
                                https://github.com/iz3man/duet3d/blob/main/duet3d.yaml

                                Just add the lines to your configuration.yaml, modify for your printer and restart HA.

                                LOL. Looking for a way to get MQTT running on Duet-Wifi board, find this thread, and then a link to MY github πŸ˜‰

                                Btw: This is still using perfectly fine with the latest betafirmware

                                f1141c7f-8cff-4f36-a8dd-d4c1d8f7f48b-image.png

                                And I found this github for MQTT integration which gives basically the same info - but haven't tested yet, as I'm waiting for native MQTT support before I start ripping everything apart again.

                                https://github.com/keyz182/DuetMQTT

                                Marshalldogundefined Lyr3xundefined 2 Replies Last reply Reply Quote 2
                                • nikschaundefined
                                  nikscha @Lyr3x
                                  last edited by

                                  @Lyr3x good work, wow! I'll check it out in the next few days!

                                  Stay in school

                                  1 Reply Last reply Reply Quote 0
                                  • Marshalldogundefined
                                    Marshalldog @izeman
                                    last edited by

                                    @izeman Looks Awesome
                                    how did you get the controls for PLA and that switch into HASS?

                                    1 Reply Last reply Reply Quote 0
                                    • Lyr3xundefined
                                      Lyr3x @izeman
                                      last edited by Lyr3x

                                      @izeman this is only working if you are not using SBC mode if I am not mistaken.

                                      I worked on updating the integration to work asynchronous without blocking requests, which is working fine now (still need to merge).
                                      There is quite some rework necessary to get config and options flow running, but I finally understood how the flows should be implemented. Can’t give a timeline yet though.

                                      Configuration via configuration.yaml is working fine including time elapsed and remaining. I also added the progress sensor back and calculating the progress via total layers and printed layers.

                                      nikschaundefined 1 Reply Last reply Reply Quote 0
                                      • nikschaundefined
                                        nikscha @Lyr3x
                                        last edited by

                                        @Lyr3x I'm gettting an error when setting up the integration, could you help me out?
                                        40394090-72d2-45c2-97a6-710b8684861c-image.png

                                        I have two printers, one running Duet Wifi 2 without SBC (RRF 3.4.5), and one running a Duet 3 Mini5+ WITH SBC (RRF 3.5.0beta3).
                                        However both gave the same error as above. Navigating to 'printerip'/maschine/status also returns the json, so I doubt the issue is related to the printers? What else can I try? It might be noteworty that I run HASS on Docker?

                                        Stay in school

                                        nikschaundefined 1 Reply Last reply Reply Quote 0
                                        • nikschaundefined
                                          nikscha @nikscha
                                          last edited by

                                          @nikscha
                                          Here's the HASS log:

                                          Logger: aiohttp.server
                                          Source: data_entry_flow.py:387
                                          First occurred: 15:43:51 (17 occurrences)
                                          Last logged: 16:20:39
                                          
                                          Error handling request
                                          Traceback (most recent call last):
                                            File "/usr/local/lib/python3.10/site-packages/aiohttp/web_protocol.py", line 435, in _handle_request
                                              resp = await request_handler(request)
                                            File "/usr/local/lib/python3.10/site-packages/aiohttp/web_app.py", line 504, in _handle
                                              resp = await handler(request)
                                            File "/usr/local/lib/python3.10/site-packages/aiohttp/web_middlewares.py", line 117, in impl
                                              return await handler(request)
                                            File "/usr/src/homeassistant/homeassistant/components/http/security_filter.py", line 60, in security_filter_middleware
                                              return await handler(request)
                                            File "/usr/src/homeassistant/homeassistant/components/http/forwarded.py", line 100, in forwarded_middleware
                                              return await handler(request)
                                            File "/usr/src/homeassistant/homeassistant/components/http/request_context.py", line 28, in request_context_middleware
                                              return await handler(request)
                                            File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 81, in ban_middleware
                                              return await handler(request)
                                            File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 236, in auth_middleware
                                              return await handler(request)
                                            File "/usr/src/homeassistant/homeassistant/components/http/view.py", line 136, in handle
                                              result = await result
                                            File "/usr/src/homeassistant/homeassistant/components/config/config_entries.py", line 180, in post
                                              return await super().post(request, flow_id)
                                            File "/usr/src/homeassistant/homeassistant/components/http/data_validator.py", line 73, in wrapper
                                              result = await method(view, request, data, *args, **kwargs)
                                            File "/usr/src/homeassistant/homeassistant/helpers/data_entry_flow.py", line 110, in post
                                              result = await self._flow_mgr.async_configure(flow_id, data)
                                            File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 286, in async_configure
                                              result = await self._async_handle_step(
                                            File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 387, in _async_handle_step
                                              if not isinstance(result["type"], FlowResultType):
                                          TypeError: 'NoneType' object is not subscriptable
                                          

                                          Stay in school

                                          Lyr3xundefined 1 Reply Last reply Reply Quote 0
                                          • Lyr3xundefined
                                            Lyr3x @nikscha
                                            last edited by

                                            @nikscha as Said before the config flow is not working. You need to configure it via the configuration.yaml at the moment

                                            nikschaundefined 1 Reply Last reply Reply Quote 0
                                            • First post
                                              Last post
                                            Unless otherwise noted, all forum content is licensed under CC-BY-SA