Here is a picture of my docker run with a configuration that works with my two working Octoprint servers:-
ok, Iām not great with github. Iāve been downloading the repository from your link which seems to point to the multi-octoprint branch. Should I be doing something else?
As long as you have cloned the repo and changed to the multiple_octoprint branch you should be fine.
what should the structure be for my custom_components directory. Is there a python file I need to update in the deps folder or anything?
I havenāt set up my second octoprint instance, but once I get that done Iām happy to test this for you.
Can I clone these changes into the custom_components or do i need to clone the full repo? Iām running in docker, which makes things a little trickier.
looks like you can by doing it like this: https://developers.home-assistant.io/docs/en/creating_component_loading.html
i have two prints running right now, iāll experiment with this when theyāre done since i can just grab your changes instead of the whole repo.
Thanks!
yes, you can. But itās not working for me so Iām asking to see what the structure should be so that I can see where I installed it wrong.
Works a treat as a custom component on 76.2. Thanks to all these involved.
Will this be included as standard in a future release of Home Assistant?
Now I hope we can achieve more features on the Octoprint component. Things like pause/resume, display layer or height, etcā¦
For now, to get additional info into the HA, Iāve used the rest sensor and the octoprint API. Once I figure out how to contribute to the component, Iād be happy to merge in my changes.
I just wrote my own in AppDaemon.
so iām running my instances of octoprint behind the built in haproxy in octopi, which each printer at host.domain.net/printername. When i try this with your component I get the following errorā¦
2018-10-10 14:20:57 ERROR (MainThread) [custom_components.octoprint] Error setting up OctoPrint Prusa i3 MK3 API: Reply for http://host.domain.net/api/version was not OK: <html>
Which leads me to believe somewhere the actual path is getting chopped off, and itās only looking at the host portion.
Mind sharing?
My PR for adding support for multiple octoprint printers has been merged and should be in the next version (after 0.80.0).
Here is a preview of the documentation so you can take a look at the configuration changes: Octoprint Component Documentation
Canāt get this to work.
Using 0.80.3 version.
Getting expected a dictionary. got ordereddict
Any idea?
It hasnāt been released yet. Wait for 0.81.0.
now that itās merged in and available, i canāt get it to workā¦
my config looks like this: https://github.com/noisufnoc/home-assistant-config/blob/master/configuration.yaml#L115
I get the entities in HA, but none of them are accurate, temp/job percentage/etc all are zero.
I think I know why, you have a path inside your config key that only supports a host.
The API client expects a hostname/IP only so the url it internally builds would be:
And obviously that is invalid.
The component doesnāt support custom paths, so a workaround would be, if possible, to hit directly the octoprint instances on their separate ports.
If not, I could add a āpathā config option, this should be a very small fix.
For some reason, I was under the impression that octoprint didnāt support custom path. It might not be the case anymore or I was just confused.
thanks for the reply.
so, for running multiple instances of octoprint to control multiple printers with a single pi, the typical approach is to modify the provided haproxy and use seperate paths. Iāve found that many things, your code included, arenāt expecting a path and donāt tend to handle it well. It might just be easier in the long run, for me, to update haproxy (or move to nginx) and use subdomains instead.
so either way, i guess. if you dont have many complaints about the edge case like mine, than i can just fix myself (which will actually fix a couple other broken octoprint integrations in my house)ā¦or implement the path
I do agree that in your case, having octoprint instances on separate subdomains would be best.
Iāll fix the component so that it supports custom paths now that I confirmed that it is supported by octoprint.