Kodi Community Forum
OctoPrint addon dev help - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Development (https://forum.kodi.tv/forumdisplay.php?fid=32)
+--- Forum: Add-ons (https://forum.kodi.tv/forumdisplay.php?fid=26)
+--- Thread: OctoPrint addon dev help (/showthread.php?tid=339634)



OctoPrint addon dev help - Kaziya - 2019-01-22

Hey guys,

I'm hoping you can point me in the right direction to make this work.
I have a 3d printer, its in the basement so i monitor it remotely via a webcam stream/octoprint, i currently use the multicam addon to see the webcam stream.

what i want to do is make an octoprint addon that will display the webcam stream, and overlay print stats (time to completion etc)

I'm not a python dev and in over my head a little so some help would be greatly appreciated, i cant seem to find what i need from searching.

i think can hack up multicams existing code for the picture, and i can figure out how to retrieve the data and build the strings using json or something, but what call would i need to overlay the text on the picture?

thanks so much for the help!


RE: OctoPrint addon dev help - DarrenHill - 2019-01-22

Thread moved to add-on requests


RE: OctoPrint addon dev help - ronie - 2019-01-22

... and moving back to python dev :-)


i'm not familiar with the multicam addon, so i can't tell how to expand it.

what you would basically need is a script type addon which uses WindowsXML.
in your xml file, define a videowindow control and a label control.
your python file should start the playback of the stream and set the text of the label control.

you can use a few bits and pieces from this tutorial:
https://kodi.wiki/view/HOW-TO:Script_addon

links to the python functions you need to set the text of the label control:
- get the control:
https://codedocs.xyz/xbmc/xbmc/group__python__xbmcgui__window.html#ga7ff3e00a3195038d2a8d689835092d65
- set the label of the control:
https://codedocs.xyz/xbmc/xbmc/group__python__xbmcgui__control__label.html#ga6db218c242cf68ffa2c0970ca9bbe560


RE: OctoPrint addon dev help - Kaziya - 2019-02-04

Thanks for the help.

I got it working and done v1.0 Tongue

Can some one advise where to post it for others to find it and use it?


RE: OctoPrint addon dev help - ronie - 2019-02-04

you can start a release thread in the program addons section:
https://forum.kodi.tv/forumdisplay.php?fid=151

if you'd like it to be included in the kodi repo, here's the details on how to submit it:
https://kodi.wiki/view/Submitting_Add-ons


RE: OctoPrint addon dev help - robweber - 2019-02-04

@Kaziya  - tried to send a PM but you have them disabled. 

This sounds like a great idea, I use Octoprint too. Currently I use a .strm file to just display the camera but I like the idea of having a more functional addon. I'd be willing to test out what you have or help with the addon if you need it. 

https://github.com/robweber


RE: OctoPrint addon dev help - Kaziya - 2019-02-15

@robweber I'll need to check that.

I got it working great, would like to display the txt better among a few other ideas... But hey I'm very happy with what I've got so far.

You can find it here :
https://github.com/MaritimeMaker/Octoprint-Kodi


RE: OctoPrint addon dev help - Kaziya - 2019-02-15

Next ideas to add is the ability to monitor multiple printers and switch between them.
I figure default to load printer profile 1
On say tab key, switch to next printer.

When called externally, I plan to add some sort of printer=x, X being which printer profile. So default can be bypassed. (I click print then when preheated a script is called to run kodi addon so I can be watchin and ready to cancel a bad start)

I made a mini addon for PnP, I was thinking of adding a way to switch between mini display and full screen. Maybe in 1 addon by shortcut key. Call self mini=1 maybe..

Lots to learn, feel free to hack and mod it and add what ever features you think would be nice to have or make better code.