{"id":3051,"date":"2023-09-21T09:54:49","date_gmt":"2023-09-21T14:54:49","guid":{"rendered":"https:\/\/lab.rapternet.us\/?p=3051"},"modified":"2023-09-26T21:29:19","modified_gmt":"2023-09-27T02:29:19","slug":"adding-the-bambu-lab-x1c-to-home-assistant","status":"publish","type":"post","link":"https:\/\/lab.rapternet.us\/?p=3051","title":{"rendered":"Adding the Bambu Lab X1C to Home Assistant"},"content":{"rendered":"\n<p>Since setting up my pair of Bambu Labs X1 Carbons, I&#8217;ve been itching to get the data off the onboard computer and into home assistant. I don&#8217;t need Home Assistant to control the machine, but being able to monitor it and notify me of anything is absolutely something I want (and maybe turn on air filters when they&#8217;re running or other actions).<\/p>\n\n\n\n<!--more-->\n\n\n\n<p>I first started looking into integrating the printers with home assistant shortly after getting them, however it looked a bit complex for my knowledge of MQTT networks. Today however there is a convenient <a href=\"https:\/\/github.com\/greghesp\/ha-bambulab\" target=\"_blank\" rel=\"noreferrer noopener\">HACS package<\/a> that takes care of it with 3 simple inputs. Install the HACS package and we can get to setting it all up.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Setting up the Integration<\/h2>\n\n\n\n<p>Setting up the integration is simple and straight forward. The integration needs just 3 pieces of info from the printer, the pin, serial number, and IP address. The serial number and IP can be found via the app, but the pin can only be found on the printer itself going through the settings menu (the settings menu also has the IP and serial number too).<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Dashboards<\/h2>\n\n\n\n<p>I created a new dashboard for my printers and added some initial data to it. I used entity cards to add some basic information from each printer including time remaining, various temperatures, AMS humidity and print status. These I thought would be useful for monitoring the printers and making sure they were continuing their prints without issues.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"461\" height=\"1024\" src=\"https:\/\/lab.rapternet.us\/wp-content\/uploads\/2023\/07\/Screenshot_20230723-164937393-461x1024.jpg\" alt=\"\" class=\"wp-image-3107\" srcset=\"https:\/\/lab.rapternet.us\/wp-content\/uploads\/2023\/07\/Screenshot_20230723-164937393-461x1024.jpg 461w, https:\/\/lab.rapternet.us\/wp-content\/uploads\/2023\/07\/Screenshot_20230723-164937393-135x300.jpg 135w, https:\/\/lab.rapternet.us\/wp-content\/uploads\/2023\/07\/Screenshot_20230723-164937393-768x1707.jpg 768w, https:\/\/lab.rapternet.us\/wp-content\/uploads\/2023\/07\/Screenshot_20230723-164937393-691x1536.jpg 691w, https:\/\/lab.rapternet.us\/wp-content\/uploads\/2023\/07\/Screenshot_20230723-164937393-922x2048.jpg 922w, https:\/\/lab.rapternet.us\/wp-content\/uploads\/2023\/07\/Screenshot_20230723-164937393.jpg 1080w\" sizes=\"auto, (max-width: 461px) 100vw, 461px\" \/><figcaption class=\"wp-element-caption\">Basic data on the dashboard<\/figcaption><\/figure>\n\n\n\n<p>In the future, I&#8217;ll remake the dashboard with conditional cards to show the right data at the right time (or as close to it as I can logic out), as well as the debug information that is provided by the printers, but for now this covers my main use case.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Diagnostic Data<\/h2>\n\n\n\n<p>I did notice that diagnostics data is included in the MQTT data that the printers provide. This data includes all the same information as the screens for any problems, potential solutions, and links to the wiki pages on the problems as well. <\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"610\" height=\"1024\" src=\"https:\/\/lab.rapternet.us\/wp-content\/uploads\/2023\/07\/Screenshot_20230728-122115624_1-610x1024.jpg\" alt=\"\" class=\"wp-image-3156\" srcset=\"https:\/\/lab.rapternet.us\/wp-content\/uploads\/2023\/07\/Screenshot_20230728-122115624_1-610x1024.jpg 610w, https:\/\/lab.rapternet.us\/wp-content\/uploads\/2023\/07\/Screenshot_20230728-122115624_1-179x300.jpg 179w, https:\/\/lab.rapternet.us\/wp-content\/uploads\/2023\/07\/Screenshot_20230728-122115624_1-768x1290.jpg 768w, https:\/\/lab.rapternet.us\/wp-content\/uploads\/2023\/07\/Screenshot_20230728-122115624_1-914x1536.jpg 914w, https:\/\/lab.rapternet.us\/wp-content\/uploads\/2023\/07\/Screenshot_20230728-122115624_1.jpg 1080w\" sizes=\"auto, (max-width: 610px) 100vw, 610px\" \/><\/figure>\n\n\n\n<p>To add this data to a dashboard, you&#8217;ll need to add a template sensor or some scripting to pull the data. I haven&#8217;t done this yet but will certainly add it to my blog once I have.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Cameras<\/h2>\n\n\n\n<p>The integration even supports showing the cameras on your home attention dashboard. This requires one option to be enabled on the printer itself. This is the &#8220;LAN Mode Liveview&#8221; option in the general settings page. Once this is selected, the integration can begin to view the cameras live.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"2560\" height=\"1928\" src=\"https:\/\/lab.rapternet.us\/wp-content\/uploads\/2023\/09\/PXL_20230922_120145652.MP_-scaled.jpg\" alt=\"\" class=\"wp-image-3379\" srcset=\"https:\/\/lab.rapternet.us\/wp-content\/uploads\/2023\/09\/PXL_20230922_120145652.MP_-scaled.jpg 2560w, https:\/\/lab.rapternet.us\/wp-content\/uploads\/2023\/09\/PXL_20230922_120145652.MP_-300x226.jpg 300w, https:\/\/lab.rapternet.us\/wp-content\/uploads\/2023\/09\/PXL_20230922_120145652.MP_-1024x771.jpg 1024w, https:\/\/lab.rapternet.us\/wp-content\/uploads\/2023\/09\/PXL_20230922_120145652.MP_-768x578.jpg 768w, https:\/\/lab.rapternet.us\/wp-content\/uploads\/2023\/09\/PXL_20230922_120145652.MP_-1536x1157.jpg 1536w, https:\/\/lab.rapternet.us\/wp-content\/uploads\/2023\/09\/PXL_20230922_120145652.MP_-2048x1542.jpg 2048w\" sizes=\"auto, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" \/><figcaption class=\"wp-element-caption\">General Settings<\/figcaption><\/figure>\n\n\n\n<p>Though this can still be a bit flaky just like the app at times. As shown below, only one of my printers cameras is shown in the dashboard while the other one failed to load.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1080\" height=\"2400\" src=\"https:\/\/lab.rapternet.us\/wp-content\/uploads\/2023\/09\/Screenshot_20230922-071710.png\" alt=\"\" class=\"wp-image-3382\" srcset=\"https:\/\/lab.rapternet.us\/wp-content\/uploads\/2023\/09\/Screenshot_20230922-071710.png 1080w, https:\/\/lab.rapternet.us\/wp-content\/uploads\/2023\/09\/Screenshot_20230922-071710-135x300.png 135w, https:\/\/lab.rapternet.us\/wp-content\/uploads\/2023\/09\/Screenshot_20230922-071710-461x1024.png 461w, https:\/\/lab.rapternet.us\/wp-content\/uploads\/2023\/09\/Screenshot_20230922-071710-768x1707.png 768w, https:\/\/lab.rapternet.us\/wp-content\/uploads\/2023\/09\/Screenshot_20230922-071710-691x1536.png 691w, https:\/\/lab.rapternet.us\/wp-content\/uploads\/2023\/09\/Screenshot_20230922-071710-922x2048.png 922w\" sizes=\"auto, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" \/><figcaption class=\"wp-element-caption\">Camera Shown in Home Assistant<\/figcaption><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Automations<\/h2>\n\n\n\n<p>I wanted to make some automations for notifying myself when the print was complete. I also plan on adding notifications for other types of print errors as well in the future. Starting with the print finished notification though, was simple enough, the main hiccup I ran into was it triggering unnecessarily which introduced me to the not_from option.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"573\" height=\"1024\" src=\"https:\/\/lab.rapternet.us\/wp-content\/uploads\/2023\/07\/Screenshot_20230731-204704209_1-573x1024.jpg\" alt=\"\" class=\"wp-image-3214\" srcset=\"https:\/\/lab.rapternet.us\/wp-content\/uploads\/2023\/07\/Screenshot_20230731-204704209_1-573x1024.jpg 573w, https:\/\/lab.rapternet.us\/wp-content\/uploads\/2023\/07\/Screenshot_20230731-204704209_1-168x300.jpg 168w, https:\/\/lab.rapternet.us\/wp-content\/uploads\/2023\/07\/Screenshot_20230731-204704209_1-768x1372.jpg 768w, https:\/\/lab.rapternet.us\/wp-content\/uploads\/2023\/07\/Screenshot_20230731-204704209_1-860x1536.jpg 860w, https:\/\/lab.rapternet.us\/wp-content\/uploads\/2023\/07\/Screenshot_20230731-204704209_1.jpg 1080w\" sizes=\"auto, (max-width: 573px) 100vw, 573px\" \/><figcaption class=\"wp-element-caption\">Trigger conditions for my notification<\/figcaption><\/figure>\n\n\n\n<p>After triggering, the automation sends a simple notification via ntfy.sh to my phone. This has been working well and it&#8217;s triggered shortly after the print finishes.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Conclusion<\/h2>\n\n\n\n<p>I need to spend some time tuning my automations and dashboards further, but I&#8217;m still happy with the functionality that I&#8217;ve gained with the integration. I do wish the integration could provide the video feeds from the printers as well, however I know that&#8217;s limited by the proprietary stream that bambu is using, not the integration. I still hope that functionality comes around at some point in time. I have had some troubles with getting notifications from the bambu handy app, so I want to get this to a state where it can replace the app on the 90% use case, and that way I won&#8217;t need that extra app installed (though I don&#8217;t get me wrong, the app works fine other than the notifications and I don&#8217;t mind using it).<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Resources<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/github.com\/greghesp\/ha-bambulab\" target=\"_blank\" rel=\"noreferrer noopener\">HACS Bambu Lab Integration<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/github.com\/home-assistant\/addons\/blob\/master\/mosquitto\/DOCS.md\" target=\"_blank\" rel=\"noreferrer noopener\">MQTT Add-On<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Since setting up my pair of Bambu Labs X1 Carbons, I&#8217;ve been itching to get the data off the onboard computer and into home assistant. I don&#8217;t need Home Assistant to control the machine, but being able to monitor it and notify me of anything is absolutely something I want (and maybe turn on air &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/lab.rapternet.us\/?p=3051\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Adding the Bambu Lab X1C to Home Assistant&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4,56],"tags":[18,95,39,48,49],"class_list":["post-3051","post","type-post","status-publish","format-standard","hentry","category-how-to","category-making","tag-3d-printing","tag-bambu","tag-home-assistant","tag-mqtt","tag-smart-home"],"_links":{"self":[{"href":"https:\/\/lab.rapternet.us\/index.php?rest_route=\/wp\/v2\/posts\/3051","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lab.rapternet.us\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lab.rapternet.us\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lab.rapternet.us\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lab.rapternet.us\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3051"}],"version-history":[{"count":17,"href":"https:\/\/lab.rapternet.us\/index.php?rest_route=\/wp\/v2\/posts\/3051\/revisions"}],"predecessor-version":[{"id":3399,"href":"https:\/\/lab.rapternet.us\/index.php?rest_route=\/wp\/v2\/posts\/3051\/revisions\/3399"}],"wp:attachment":[{"href":"https:\/\/lab.rapternet.us\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3051"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lab.rapternet.us\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3051"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lab.rapternet.us\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3051"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}