I am working on my first openHAB binding to add HP Printer support for openHAB. I have designed it around the HP OfficeJet Pro printers.
The printers Embedded Web Server serves up a few xml files which contain some useful data like
- ink levels
- cumulative ink usage
- total pages printed
- current status
which is what this binding uses to fetch data.
Auto discovery is supported only for listed model! If your model is listed in the Binding it should detect it, if you have an unsupported OfficeJet it should show as such - any other models you’ll need to add the Thing manually.
Networked HP printers should be able to use this, if you have a printer that’s not listed then then use the
Unsupported HP Printer Thing and that should work for you or you may want to use a listed printer model close to yours.
You can download the Binding from here https://www.dropbox.com/s/tqxc57dgp74026o/org.openhab.binding.hpprinter-2.5.0-SNAPSHOT.jar?dl=0
If you don’t have the ability to use Paper UI to add the Thing or if your device isn’t auto-discovered then you can use the good ol’ way by creating a
.thing file along the following lines:
Thing hpprinter:deskjet2620:djprinter "Printer" @ "Office" [ ipAddress="192.168.1.1", refreshInterval="30", useSSL = true ]
The available settings are:
|Refresh (polling) Interval||refreshInterval||number|
The User Name and Password settings are required for using the Reboot printer option when the web interface has locked features behind a login.
The available thing IDs are:
|Printer Model||Thing ID|
|Unsupported HP Printer||generictype1|
|HP OfficeJet 4650||officejet4650|
|HP OfficeJet Pro 8600||officejetpro8600|
|HP OfficeJet Pro 8710||officejetpro8710|
|HP OfficeJet Pro 8730||officejetpro8730|
|HP DeskJet 2620||deskjet2620|
|HP ENVY Photo 6200||envyphoto6200|
|HP Color LaserJet MFP M277dw||colorlaserjetmfpm277dw|
The following is a list of channels and their data types for
|Cyan Colour Level||cyanLevel||Number|
|Magenta Colour Level||magentaLevel||Number|
|Yellow Colour Level||yellowLevel||Number|
|Black Colour Level||blackLevel||Number|
|Total Number of Pages Printed||totalCount||Number|
|Total Number of Colour Pages Printed||totalColorCount||Number|
|Total Number of Monochrome Pages Printed||totalMonochromeCount||Number|
rebootchannel is not yet supported.
colourLevelis used on Printers that have only a single colour cartridge instead of separate Cyan, Magenta and Yellow ones.
If you find that the information presented in the channels aren’t correct then post in this thread the following files from your printer at the following address:
as well as your printers model number. Some printers Embedded Web Servers won’t return the above links (they will 404) in that case, I’ll need you to browse to the page on your Embedded Web Server that has the Ink/Toner levels displayed on it save the web page to disk (In Chrome, go to the 3 vertical dots menu > More Tools > Save Webpage As…) and link the file here so that I can investigate adding support for your printer.
The WIP code is up at https://github.com/Cossey/openhab2-addons/tree/Add-HPPrinter.