When I’ve been testing new builds of my Binding I just drop it into the add-ons folder, overwriting the last version of the binding and then restart the openHAB Docker instance. Usually works well for me.
In your case if it shows stale Binding information then it’s probably an issue with the Cache needing to be cleared or needing to manually edit the jsondb (I don’t know if this is due to my Binding or openHAB, seems to possibly be a openHAB problem). The forums seem to have a few solutions that can be tried but in these cases I can’t really offer much support.
Added auto-discovery support
The Binding should now auto-discover the HP Printers that are listed, including unsupported OfficeJets. If your device was auto-detected then it uses this as part of the method for Offline/Online detection which may still need some testing.
Would you be able to add a channel, please?
Total number of prints?
The reason for it is that I have the HP Ink subscription and I like to monitor how many prints I have done this month so that I don’t go over the quota. Thanks
That’s next on my list, total prints and total bw/colour prints along with reboot, though Ill prioritise the total print count since it seems important.
Does this total print count reset every month or do they calculate based on last months value minus this months value?
Hi there!
Thank you very much for your binding, which I’d like to support!
I have an HP Color LaserJet MFP M277dw - some remarks to my first experiences:
The “Unsupported …” variant didn’t work for me: the (manually) created thing never went online.
However, I had sucess making it a fake “HP OfficeJet Pro 8600”: I was able to link items to the status and the ink level channels successfully, but there were problems with the reboot channel (couldn’t be added via PaperUI):
2019-01-10 01:06:07.405 [WARN ] [rest.core.internal.item.ItemResource] - Received HTTP PUT request at ‘items/HPOfficeJetPro8600_Control_Reboot’ with an invalid item type ‘Boolean’.
I’m attaching my 2 XML files and hope very much that you can incorporate them:
@heilbron Good to know that the LaserJet supports this, I will take a look at your files over the weekend and compare them to everyone elses to see what data is exposed. As mark said, that channel doesn’t yet work, although technically the code is in there all ready to go but I haven’t been able to figure out why it won’t add the channel when clicking in openHAB… however your log files warning message has just given me an idea on what I might need to do in code to “acknowledge” the channel being added.
@KidSquid Honestly, I don’t know what minimum version it would work with, I’ve only been building against the 2.5.0 snapshot repository and I have openHAB 2.4 here running in a Docker container that I’ve been testing it against, but I assume it should work with 2.3 as well… if others here in this forum have tested it on anything older than version 2.4 can you let us know please?
Thank you for the binding! Like others I have solved this via the HTTP binding, but a native binding is always nicer! I have downloaded the latest version to test, but it does not work for my printer:
HP OfficeJet 4650 All-in-One Printer series
This printer only supports the color and the black channel.
Here are my item definitions:
Number Inklevel_Color "Info CMY [%s]" {http="<[http://192.168.0.22/DevMgmt/ConsumableConfigDyn.xml:30000:XPATH(/*[name()='ccdyn:ConsumableConfigDyn']/*[name()='ccdyn:ConsumableInfo'][1]/*[name()='dd:ConsumablePercentageLevelRemaining']/text())]"}
Number Inklevel_Black "Info K [%s]" {http="<[http://192.168.0.22/DevMgmt/ConsumableConfigDyn.xml:30000:XPATH(/*[name()='ccdyn:ConsumableConfigDyn']/*[name()='ccdyn:ConsumableInfo'][2]/*[name()='dd:ConsumablePercentageLevelRemaining']/text())]"}
String Printer_Status "Printer State [%s]" {http="<[http://192.168.0.22/DevMgmt/ProductStatusDyn.xml:1800000:XPATH(/*[name()='psdyn:ProductStatusDyn']/*[name()='psdyn:Status'][2]/*[name()='pscat:StatusCategory']/text())]"}
I also tried to use the " Unsupported HP OfficeJet Pro Series" by adding it manually, but the latest binding seems to have an issue with that one. When saving I get the following error message and the thing is uninitialized:
2019-01-10 21:13:24.952 [WARN ] [ore.thing.internal.ThingRegistryImpl] - Cannot create thing. No binding found that supports creating a thing of type 'hpprinter:officejetpro'.
I also cannot just delete the thing after that, I have to force removal.
Maybe you can look into that as well
@Chrishab I noticed that you’ve included both a ConsumableConfigDyn.xml and ProductUsageDyn.xml file which both contain Ink Level information, although they are both have different ink level values.
Level
ProductUsageDyn
ConsumableConfigDyn
Colour
72
70
Black
67
70
It seems like maybe ConsumableConfigDyn.xml only has roundabout values vs ProductUsageDyn.xml which has the actual level. Are you aware of this?
Interesting! I always used the rounded values.
Meaning: I haven’t been aware of the actual values. Even better I guess since only one file needs to be considered…