Octoprint API – Showing Print Progress on Twitch Stream

While I was streaming on twitch.tv/atommouse, I kept finding myself updating the chat with the print progress. I thought there could be a better way, so I did some research and found there is an Octoprint API that allows you to query information such as File Name and Print Percentage.

You can copy it from my github at https://github.com/adamrouse/Octoprint-Percent-Complete

Just Replace [PiIPAddress] with your Pi’s IP address and [APIKEY] with the OctoPrint API key accessed from the Settings > Features > API page.

 

notepad_uXWiZWsNUy

Custom CSS Code needed for display in OBS:

#percentinfo {

font-family: “Trebuchet MS”, Arial, Helvetica, sans-serif;

border-collapse: collapse;

width: 100%;

}

#percentinfo td, #percentinfo th {

border: 1px solid #ddd;

padding: 2px;

}

#percentinfo tr:nth-child(even){background-color: #f2f2f2;}

#percentinfo th {

padding-top: 10px;

padding-bottom: 10px;

text-align: center;

background-color: #4CAF50;

color: white;

}

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s