Just gave it a try.
Seems my second printer, HP Photosmart C4700 series, doesn’t support the DevMgmt/ProductUsageDyn.xml (get a 404) even though it has a web server.
Oh well Thanks for your work on this anyway!
Don’t know exactly, but in HP developer community there’s java integraion that need to reverse engineer it,
It works with authentication and access token and from that point you can access the information,
Since I don’t have that printer I cannot try doing that…
found the potential cause for that error,
the error caused by unmapped color acronym into colors which is being represented differently in the 2 endpoints the component collects the information from the printer (one is working with acronym while the other with full name),
In the previous version I added just the mappings I were familiar with and didn’t protect the code too much when unknown color is being processed.
the “fix” I applied was to handle it better and log with warnning message if there is unmapped color,
I guess you will see a warnning message know, if you do, please post the warnning message and I will map that color as well.
On top of the color, I added the head type to the message, the reason - OPC (Organic Photo Conductor) maybe falls on another head type and needed to be treated diffrently than ink / toner.
Message will look like: Head type {head_type} color mapping for {consumable_label_code} not available
Log Details (ERROR)
Mon Nov 18 2019 17:59:35 GMT+0100 (Mitteleuropäische Normalzeit)
Failed to update data (ProductUsageDyn) and parse it, Error: 'NoneType' object is not iterable, Line: 33
I have been following this topic, but am confused.
Can someone explain the steps to install this and what yaml files and such go where.
Thank you
carltonb
Got it up and working but am having some difficulty understanding how the following is used.
State: # of pages scanned
Attributes:
ADF - # of scanned documents from the ADF
Duplex - # of scanned documents from the ADF using duplex mode
Flatbed - # of scanned documents from the flatbed
Jams - # of scanned jammed
Mispick - # of scanned documents failed to take the document from the feeder
I still have the error in the log, despite updating the latest version
2019-11-27 19:23:07 ERROR (SyncWorker_5) [custom_components.hpprinter.HPPrinterData] Failed to retrieve data (ProductUsageDyn) from printer, Error: HTTPConnectionPool(host='192.168.1.121', port=80): Max retries exceeded with url: /DevMgmt/ProductUsageDyn.xml (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f1ded0e1450>: Failed to establish a new connection: [Errno 113] Host is unreachable')), Line: 70
2019-11-27 19:23:11 ERROR (SyncWorker_5) [custom_components.hpprinter.HPPrinterData] Failed to retrieve data (ConsumableConfigDyn) from printer, Error: HTTPConnectionPool(host='192.168.1.121', port=80): Max retries exceeded with url: /DevMgmt/ConsumableConfigDyn.xml (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f1deb7e78d0>: Failed to establish a new connection: [Errno 113] Host is unreachable')), Line: 70
2019-11-27 19:34:18 ERROR (SyncWorker_0) [custom_components.hpprinter.HPPrinterData] Failed to retrieve data (ProductUsageDyn) from printer, Error: HTTPConnectionPool(host='192.168.1.121', port=80): Max retries exceeded with url: /DevMgmt/ProductUsageDyn.xml (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f1deb6eec50>: Failed to establish a new connection: [Errno 113] Host is unreachable')), Line: 70
2019-11-27 19:34:21 ERROR (SyncWorker_0) [custom_components.hpprinter.HPPrinterData] Failed to retrieve data (ConsumableConfigDyn) from printer, Error: HTTPConnectionPool(host='192.168.1.121', port=80): Max retries exceeded with url: /DevMgmt/ConsumableConfigDyn.xml (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f1deb7a5d10>: Failed to establish a new connection: [Errno 113] Host is unreachable')), Line: 70
2019-11-27 20:34:19 ERROR (SyncWorker_0) [custom_components.hpprinter.HPPrinterData] Failed to retrieve data (ProductUsageDyn) from printer, Error: HTTPConnectionPool(host='192.168.1.121', port=80): Max retries exceeded with url: /DevMgmt/ProductUsageDyn.xml (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f1deb04e1d0>: Failed to establish a new connection: [Errno 113] Host is unreachable')), Line: 70
2019-11-27 20:34:22 ERROR (SyncWorker_0) [custom_components.hpprinter.HPPrinterData] Failed to retrieve data (ConsumableConfigDyn) from printer, Error: HTTPConnectionPool(host='192.168.1.121', port=80): Max retries exceeded with url: /DevMgmt/ConsumableConfigDyn.xml (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f1dedef4890>: Failed to establish a new connection: [Errno 113] Host is unreachable')), Line: 70
2019-11-27 20:44:59 ERROR (MainThread) [homeassistant.components.homeassistant] homeassistant/turn_on cannot be called without entity_id
2019-11-27 21:34:20 ERROR (SyncWorker_15) [custom_components.hpprinter.HPPrinterData] Failed to retrieve data (ProductUsageDyn) from printer, Error: HTTPConnectionPool(host='192.168.1.121', port=80): Max retries exceeded with url: /DevMgmt/ProductUsageDyn.xml (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f1deafb5a90>: Failed to establish a new connection: [Errno 113] Host is unreachable')), Line: 70
2019-11-27 21:34:23 ERROR (SyncWorker_15) [custom_components.hpprinter.HPPrinterData] Failed to retrieve data (ConsumableConfigDyn) from printer, Error: HTTPConnectionPool(host='192.168.1.121', port=80): Max retries exceeded with url: /DevMgmt/ConsumableConfigDyn.xml (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f1ded9d4990>: Failed to establish a new connection: [Errno 113] Host is unreachable')), Line: 70
I never never seen the attributes listed like this, so I was unsure what to do with this code. Do I have to place it in a yaml file or is this part of the json files included in the HACS setup.
So if I wanted some output lets say for my ADF how would I complete the following in pa part of the line of code.