External integration - IPP (printers)

:printer: IPP Printers — finally know if there’s ink left, without opening the cover

Hi everyone!

You know the moment: you start printing on a Sunday evening, and then… white stripes. No more cyan. Of course.

So I coded a small external integration for Gladys: IPP Printers. It monitors your network printers and reports ink/toner levels directly in Gladys.

What it does

  • A sensor per cartridge (black, cyan, magenta, yellow… or just the toner if you’re team laser), in %, with history. You can therefore plot the consumption curve and watch your ink disappear over the months :chart_decreasing:
  • The printer status in text: idle, printing, or stopped (media-empty) when you’ve forgotten to refill the paper again.
  • Automatic discovery: if your printer supports AirPrint (so pretty much all those sold since ~2012), it is found automatically on the network. Nothing to configure.
  • 100 % local: no account, no cloud, no API key. It talks directly to the printer in IPP, the standard protocol behind AirPrint.

The cool part

Since the levels are reported as normal sensors, you can create scenes with them. For example:

If the black toner goes below 10 % → send a message « remember to order a cartridge »

Which, I admit, is already much more useful than the little orange light on the printer that has been blinking for three weeks.

Compatibility

Any network printer compatible with AirPrint / IPP Everywhere: HP, Epson, Canon, Brother, Lexmark, Samsung… Tested at home on a Samsung C460 Series, which nicely reports its four toners.

:warning: Honest caveat: some printers simply do not report their levels via IPP. This is a limitation of their firmware, not the integration — in this case you will only have the status. There is a « Test a printer » button in the settings to check in 2 seconds what yours is willing to say, even before adding the device.

Installation

The integration is available in the store. You install it, and normally your printer appears automatically in the Discovery tab. If mDNS doesn’t work for you (VLAN, different subnet…), you can also manually enter the IP in the settings.

The code is here: GitHub - guim31/gladys-ipp: Gladys external integration to fetch printers informations · GitHub

You’re motivated to make lots of integrations for us

Yeah :slight_smile: let me know if it’s too much for you!! haha

On the contrary, it’s rare for things to move so much in the middle of summer. It’s positive.

I just tested this integration on an HP Smart Tank Plus 655: discovery was instant, ink levels are correctly reported but the printer status is not, it always shows « idle »
Thanks @guim31

Thanks for the feedback, I’ll check it out!

Re @Chris75 thanks a lot for the feedback, it helped me find a real bug!

I was checking the status at the same rate as the ink levels, i.e. every 15 minutes by default — in other words, a 30-second print always slipped through the cracks.

This is normally fixed in 1.0.1, you can force the update.

Meanwhile, the « Test a printer » button in the settings shows you in real time
what your printer reports at time T — handy for checking.

Well, I upgraded to V1.0.1, and I only have two states displayed: « idle » and « idle (media-empty) ».
So « printing » is missing: how often is the information sent back?

Holy crap, it’s like being on the HA store with all these new integrations :rofl:

A big thank you @guim31, my HP Color Laserjet MFP E57540 was discovered in less than 1s!



I’ll let you guess which home automation systems I’ve set up in parallel :wink:

Re @Chris75! Good news: your « idle (media-empty) » proves the update works — the status is now changing. And your question is perfectly timed: the info was being collected every 60 seconds… while a page print takes 15-20 seconds. In other words, most prints were slipping between two collections.

I just published a 1.0.2 (forces the update if you want to test) that fixes this: the status is now sampled every 15 seconds and published as soon as it changes. Any print lasting at least 15 seconds will be seen. Only an extremely short print could still slip between two collections — a protocol limitation, the printer doesn’t « push » its statuses, you have to fetch them.

Small detail by the way: your printer signals « out of paper » by staying « idle » (instead of switching to « stopped ») — that’s HP’s way of doing things, and it’s great: you can already trigger a scene on that if you want to be notified when the tray is empty :slightly_smiling_face:

Thanks for the integration :slight_smile:

On my end, on an HP OfficeJet 8010 printer, I’m missing the black cartridge:

[2026-08-05T21:08:33.205Z] [INFO] [printer-device] Poll ext:ext-guim31-gladys-ipp:printer:ceeeac82-b679-4926-b131-466fcfb437e4: idle, magenta cartridge=50%, cyan cartridge=50%, yellow cartridge=50%, black cartridge=?%

Any idea how to get it to arrive? :sweat_smile:

Amazon ? :disguised_face:

Official HP logo :wink:

Thanks for the feedback. Your black cartridge is correctly reported by the printer, but its level appears as “unknown” via IPP — a classic with OfficeJet printers: HP reports color levels as percentages (rounded to the nearest quarter, hence your three 50%) but not black.

The integration omits the value rather than displaying a false percentage.

I just published version 1.0.3 that makes this visible: after updating, click the “Test a printer” button with your IP and paste the result here — it will display exactly what your printer responds for black (something like “black cartridge: unknown (-2)”). If confirmed, the value simply doesn’t exist on the IPP side for this model; I’m looking into the feasibility of retrieving it from the HP web interface of the printer in a future version.

Thanks, I just tested it and here is the feedback with version 1.0.3:

Printer OK: HP OfficeJet 8010 series — status « idle » — magenta cartridge: 50%, cyan cartridge: 50%, yellow cartridge: 50%, black cartridge: unknown (-2)

Nice integration, thanks it works well on my printer.

Just a feedback, (even if it doesn’t bother me) it would be better to have some translation
currently if I add it to my dashboard I have

  • magenta cartridge
  • cyan cartridge
  • yellow cartridge
  • black cartridge

(we can rename the feature in the dashboard but it’s a little extra I would say :slight_smile: )

And yes I do have more color in my printer ^^’

Thanks, diagnosis confirmed! Your printer responds with “unknown” for black via IPP while giving the colors — a (curious) habit of HP firmware, the integration can’t invent the value.

BUT there’s a lead: HPs expose their real levels on their embedded web interface. Can you help me check it in 30 seconds? Open this address in your browser (replacing with your printer’s IP):

http://192.168.XX.XX/DevMgmt/ConsumableConfigDyn.xml

If an XML page displays, paste here the block concerning the black cartridge (look for “Black” or “K” in it — don’t worry, there’s nothing sensitive, it’s just the cartridge levels and references). With that, I’ll be able to add a specific HP fallback read in a next version, and your black will come back up like the others :ok_hand:

I’m not at home right now but I’ll test this tonight without any problems :slight_smile:

I tried to install this application, but it can’t find my printer. I tried several ways, IP, hostname… nothing works. I showed my log to Copilot, and it gave me this response.
On your Epson ET‑2815:

  • IPP is enabled (mDNS + HTTP 500 confirm it)

  • But the IPP service is not working correctly, which explains the errors in Gladys.

This issue is common on Epson EcoTank printers:
Their IPP server is minimalist and sometimes unstable.
it suggests bypassing the issue with CUPS.
Do you know it?
Is it a good idea?

I’ll send you the file content by email :wink:

Thanks