Posts

Showing posts with the label octoprint

Troubleshooting a broken Octoprint Integration

Image
A situation came up - my Octoprint/printer page wasn't working like it should. Power could turn on and off - not a problem Sensors would show temperatures and status - not a problem Buttons that sent commands back to Octoprint no longer work - PROBLEM The electrical power for each printer is managed by a TP Powerlink, each plug is managed by a different entity. It does not use Node-Red, and buttons for the power worked for both printers. This was not helpful. The Octoprint integration shouldn't be touching the button flows. The sensors were live, so the HA integration was probably not the case. This is using Home Assistant Core 2022.5.3. With a recent release, the developers changed things up. For example, to check your configuration.yaml and restart your server - previously it was found at Settings>System. (As a caution, the "help" text for that option still indicates the reboot is found there.) Instead, it is found under Developer Tools>YAML - both the confi...

More Octoprint Integration Issues

Image
Sadly, I didn't take screenshots of the immediate issue. But fortunately the solution is simple once you find it.   Temperature Problems Temperature numbers from printer bed AND printer nozzle, for both printers were no longer registering any data. (Instead, they read -18 degrees, which is what the Farenheit-to-Celsius template sensor returns when it doesn't have any data.) It had been working several weeks ago, the last time I printed. It could have been a Home Assistant or Octoprint update, or some kind of data corruption. Regardless of the cause, it needed to be fixed. Start in Configuration Go to Configuration>Integrations>(Choose a printer)>(Select the entities).  In my screenshot, you'll notice 7 exclamation marks in red circles. This is normal, as the printer is not connected - it doesn't have any temperatures to report or printer states. When I was working on the problem, the 4 temperature rows - instead of an exclamation mark in a circle - there were e...

Fixing Octoprint Integration in Home Assistant

So, Home Assistant has an integration for Octoprint. Seems like it would be really solid - a great thing! Well, it is, unless you already have two printers set up in Home Assistant. I considered tearing it all out and rebuilding it. Delete it, and see what it comes back as. That probably would have been more sane. If you go this route, skip to Octoprint side fixes. Identify what needs to get changed The first step was that none of my sensors were correct. Fortunately, my input booleans (buttons for turning things on and off, retracting - those all go through MQTT topics in Node Red and were untouched.) Octoprint side fixes First, I went to two Octoprints and their Home Assistant Discovery plug-ins and changed the device name to be unique. (The names of the two printers showed up as "Octoprint", resulting in "Octoprint****_2" for some of the entities.) Next, you do NOT need to change anything in MQTT. These are untouched. Back in Home Assistant In the configuration.y...

Fixing Fahrenheit-to-Celsius as a one-off conversion template

As someone living in the United States, we use Fahrenheit for temperatures and imperial measurements for measuring things. (Including measuring ingredients by weight or volume, depending!) Which is why my HA uses Fahrenheit/imperial. But in 3D printing, I use Celsius. Sometime in August/September 2021, Home Assistant broke part of my process. It could be that my customization.yaml file's "C" designation broke, or that Home Assistant figured out what was going on and decided to "help" me by converting Celsius from the printer into Fahrenheit. Doesn't matter - end result: my Octoprint sensors were reporting Fahrenheit temps instead of my desired Celsius. First step: Create conversion template entities I added this to my configuration.yaml file: sensor:   - platform: template     sensors:       octoprint_micro_actual_bed_temp_c:         friendly_name: "Micro Bed (°C)"         ...

Making Things Pretty in Home Assistant without HACS

Image
[Nov. 3, 2021 edit: if you like Celsius for your printer feed, but use Imperial as your base measurement on HA, something broke the below process. I wrote a new post , adding some conversion templates to restore this feature. We now return you to the article...] So my title is a little misleading. If you want the dark-grey theme, and the little icons in the third set of rows...you need HACS. But otherwise it's just stock-HA white, which is totally fine.  Reading Home Assistant forums, browsing youtube videos - you hear the glory of HACS (Home Assistant Community Store). Home Assistant is free & open-source, done by volunteers, same with HACS. HACS comes with a disclaimer: it's risky. Don't use it unless you know a bit about Home Assistant. And then there's some common-sense directions on how to install it. I pulled myself in, because I wanted themes and Font Awesome icons. I really don't want to tackle adding HACS or fontawesome as a tutorial - HACS was easy e...

Home Assistant Controlling Octoprint through MQTT - Chapter 2

Image
What I didn't mention in the previous post, was the struggle to get it working. I'm not a programmer or a savant that can pick up anything. The next part is wiring up other buttons for different commands, and that means using more of the Octoprint API, as of this writing, here: https://docs.octoprint.org/en/master/api/ Current issues Ongoing problem #1: I mentioned how I got connect to work. Using the same pseudo-code, it should be super easy to execute {"command":"disconnect"}. It even pops up the same area as the command: connect did...but it doesn't disconnect. Ongoing problem #2: Extrude/Retract - this happens frequently when changing out filament, or in some cases...the print fails to start after homing on the corners. Before the homing occurred, it retracted. If I were to just start again, it would retract again! (The nozzle needs to be preheated, extruded, and then turned off.) Ongoing problem #3: Preheat to 230/turn off - as I just mentioned in #...

Home Assistant Controlling Octoprint through MQTT - Chapter 1

Image
I'm going to start listing software versions - sometimes I hit a wall, because of dated information. Home Assistant evolves continually...a year from now, this might have a different solution. Components and their versions: Home Assistant Core 2021.1.0 (HA) Operating System 5.9 (HA) Node Red 7.2.11 (HA) Mosquitto Broker 5.1 (HA) Octoprint 1.5.2 MQTT 0.8.7 (Octoprint plugin) MQTT-Subscribe 0.1.6 (Octoprint plugin) MQTT Explorer 0.3.5 (Linux, optional)  My goal is to create buttons in a Lovelace dashboard, to trigger actions for my two 3D printers. Actions like "connect/disconnect" to start a connection between Octoprint and the printer, "preheat nozzle" so I can have the nozzle go to 180 degrees Celsius to change filament, "Extrude" to extrude 10mm of filament, or "Retract" to retract 10mm of filament, and maybe a "heat bed" so I can heat up the bed to remove a print. I'll start with a "Connect" button for my Lulzbot ...

Setting up MQTT on HA and Octoprint

Image
  I'm going to start listing versions - sometimes I hit a wall, because of dated information. Home Assistant evolves continually...a year from now, this might have a different solution. Components and their versions: Home Assistant Core 2021.1.0 (HA) Operating System 5.9 (HA) Node Red 7.2.11 (HA) Mosquitto Broker 5.1 (HA - this is the MQTT Broker) Octoprint 1.5.2 MQTT 0.8.7 (Octoprint plugin) MQTT-Subscribe 0.1.6 (Octoprintg plugin) MQTT Explorer 0.3.5 (Linux, optional)  My goal is to create buttons in a Lovelace dashboard, to trigger actions for my two 3D printers. Actions like "connect/disconnect" to start a connection between Octoprint and the printer, "preheat nozzle" so I can have the nozzle go to 180 degrees Celsius to change filament, "Extrude" to extrude 10mm of filament, or "Retract" to retract 10mm of filament, and maybe a "heat bed" so I can heat up the bed to remove a print. I'm running Home Assistant on a...