How to fetch Enclosure Temperature using REST API

Using the excellent enclosure plugin, I've added a temperature sensor for my enclosure and It is displaying in the header.

I've put together a little wireless printer monitor using https://github.com/Qrome/printer-monitor.

What I'd like to do is to enhance the printer monitor code so that it would display the enclosure temperature as well as the tool and bed temperatures.

Ideally, I'd like to be able to add it to the results coming back from /api/printer.

I'm just wondering if there's a way to enhance the api, or if there's a way to create a plugin to do that.

Thanks in advance for steering me in the right direction.

Hmmm, Looking at the Enclosure plugin looks like it has an 'api' of it's own. Maybe the right route would be to look into enhancing that....

Off to clone it and look at the code...

And the more I dig into this, it looks like what I want is the blueprint plug in.

Time to get my dev environment seutp.

I'm waiting for Octoprint to store and graph more variables :slight_smile:

Well, Followed the tutorial and stole some code from the enclosure plugin and made my own plugin to grab the enclosure temperature then modified the code for the printer monitor to display it with the bed and tool temps. Easy peasy, and now I know enough to be dangerous with plugins and api calls, lol.

Google Photos

@Brent_Dowell
This is exactly what I've been looking for.
If you are willing, I'd love to have a copy of both your Plugin and modified Printer Monitor Code. Or is it already available?

@Brent_Dowell care to share the code?

@Brent_Dowell

ditto re share code.

Hi @pedroxe, @towlerg,

short question: What kind of source code do you expect/need? What do you want to achieve?
The ESP Microcontroller-Code is located in the mentioned git-repository.

I'd like the modified version by Brent_Dowell

"Well, Followed the tutorial and stole some code from the enclosure plugin and made my own plugin to grab the enclosure temperature then modified the code for the printer monitor to display it with the bed and tool temps."