OctoPrint Persistent Notification - Invalid Config when 3D Printer is not turned on

@w1ll1am23 - Did you see this merged PR? Is this what we are waiting for?

Looks like it! I’ll try to check it out sometime this week.

1 Like

Is the problem just when the OctoPrint server is down or when the printer connected to OctoPrint is in a disconnected state? I haven’t really tested this heavily.

Both cause a problem, not sure if they both cause the same error or not.

I suspect that waiting for the platform will then only fix the issue of octoprint being offline.

If OP is not running when you start HA, you get a few errors. If it is connected, initalizes under HA and then you turn the printer off, you get error spam.

For now, I have just left the printer on but wonder about whether this is going to shorten the printer life or not. It would be great if there was a dynamic way to stop polling it, like a service that you could turn on or off.

Turns out I didn’t need that PlatformNotReady PR lol :smile: just needed to dig in and think about it.

This, I believe should address everyones requests!

Can someone test this out https://github.com/home-assistant/home-assistant/pull/8343

I’ll give it a shot. Just downloaded the three of them. Soon as I get caught up on messages and mod duties, I’ll test it out.

1 Like

Seems to be working fine - I got a single message on the setup failure and that seems to be it. Wink tests seem to be good as well.

Nice work, my friend! Much thanks!

1 Like

Great, so when do we get it :slight_smile: LOL

1 Like

PR is open so it should get merged in and be in the next release. I think 48 was just released so two weeks

1 Like

I can wait. Just being impatient. LOL

Don’t be impatient. Install it like I did. Easy peasy.

1 Like

I started to, but saw a message saying I had to have write access or something to pull it down…

I’ve decided to document this procedure a little bit because it works for any beta code that doesn’t need a library or other update. I was thinking that maybe if we have this to post to refer to, we can get more beta testers involved and volunteering. That’s helps the devs, the users… everyone benefits.

#How to test out beta code releases that have no other update requirements:

  1. Create some temp folders on your desktop. Have one main folder and then two under that and label those - one labeled sensor and one labeled binary_sensor. Why did we go through the trouble of creating those folders? Well, in this thread, all three files are named octoprint.py so you can’t save them all in one place. (The same may go for whatever thread referred you here!)

  2. Go to the code and make sure to get each one; in many cases a component file and a sensor or binary_sensor file may be necessary. (Like Pokemon, ya gotta get them all) and click on View on each one.

  3. In view mode on each one, there will be a button labeled RAW on the top right hand side. Right click on that button and save the file to the appropriate folder you created on your desktop. Component goes in the main folder, binary sensor and sensor each in their appropriate folder.

  4. Move these over to your HA server in a folder off the root called custom_components. If it doesn’t exist, create it and give it 0755 permissions. In that folder, create two folders, one marked binary_sensor and one marked sensor. Give them the same perms.

  5. Now, copy over the files you downloaded into the matching folders. Components go into the custom_components directory, and the others go into… well, you get the idea.

  6. Set the perms on the files you moved over to 0755 and then restart HA. HA will look into the custom_components directory when it initializes and if it sees a file there, it will load that instead of whatever is in the release installation.

2 Likes

Awesome, worked great. ( the instructions and the patch ). Thanks I wish I could “Like” things multiple times. :slight_smile:

1 Like

Problem, I turned my printer back on, and it’s not recognized. But I guess that’s because it doesn’t automatically connect with Octoprint when the printer turns on. So I guess it’s more of an octoprint issue than a HA issue. On the other hand, my little python script that looks at the power on the outlet, knows it’s powered on. :slight_smile:

Couple things I would add.

  1. Maybe a log example showing the users how to verify that the components actually loaded form the custom_compoents folder. I think there is a line that says something like “loading octoprint from custom_compoents folder”

  2. This will work if there are external library updates as well. For example if you test out the new wink.py that uses the new Oauth flow that pulls the newest version of python-wink from pypi. Once you remove the custom_component it will downgrade or upgrade to whatever version of python-wink your version of HA uses.

1 Like

I’m going to be on the road in a bit but I will work on getting this more accurate and then maybe post it to Share Your Projects once you and @turboc have given it a final once over.

I didn’t know about the external lib bit - that’s great! I know there are some conditions this won’t work though, like when one of the core files is touched. But I can’t remember which ones, I remember there was an update I stayed away from because I would have to edit a core file that would be updated in the release… like requirements.py or something. Any ideas about that?

Yeah, it would be great if there was a service you could turn activate to get HA to reload a component.

1 Like