Custom Component - HP Printer

Hello @bar,

i have a LaserJet M1212NF MFP but the integration give 2 printers, one is “off”, the other is “disconnected”, but the http server of the printer is ok on the adress 192.168.1.61 and the printer is online.

I try http://192.168.1.61/DevMgmt/ConsumableConfigDyn.xml

but i get :

Erreur d’analyse XML : erreur de syntaxe
Emplacement : http://192.168.1.61/DevMgmt/ProductStatusDyn.xml
Numéro de ligne 1, Colonne 1 :
404 Not Found
^

any idea?

All information are ok in the http server page of the printer but it will be cool to have them in HA :wink:

Thanks!

It seems that your printer cannot be supported by that component (it uses different API)

Please provide debug files so I’ll be able to reproduce and fix it

Thanks

Please check if you are getting result from:
http://ip/DevMgmt/ConsumableConfigDyn.xml

Replace “ip” with the real ip of the printer

is this what you wanted?

2020-02-27 06:52:10 DEBUG (MainThread) [custom_components.hpprinter.HPPrinterAPI] Updating ConsumableConfigDyn from 192.168.1.2
2020-02-27 06:52:10 DEBUG (MainThread) [custom_components.hpprinter.HPPrinterAPI] Retrieving ConsumableConfigDyn from 192.168.1.2
2020-02-27 06:52:10 DEBUG (MainThread) [custom_components.hpprinter.HPPrinterAPI] Updating ProductConfigDyn from 192.168.1.2
2020-02-27 06:52:10 DEBUG (MainThread) [custom_components.hpprinter.HPPrinterAPI] Retrieving ProductConfigDyn from 192.168.1.2
2020-02-27 06:52:10 DEBUG (MainThread) [custom_components.hpprinter.HPPrinterAPI] Updating ProductConfigDyn from 192.168.1.2
2020-02-27 06:52:10 DEBUG (MainThread) [custom_components.hpprinter.HPPrinterAPI] Retrieving ProductConfigDyn from 192.168.1.2
2020-02-27 06:52:10 DEBUG (MainThread) [custom_components.hpprinter.HPPrinterAPI] Updating ProductStatusDyn from 192.168.1.2
2020-02-27 06:52:10 DEBUG (MainThread) [custom_components.hpprinter.HPPrinterAPI] Retrieving ProductStatusDyn from 192.168.1.2
2020-02-27 06:52:10 DEBUG (MainThread) [custom_components.hpprinter.HPPrinterAPI] Updating ProductStatusDyn from 192.168.1.2
2020-02-27 06:52:10 DEBUG (MainThread) [custom_components.hpprinter.HPPrinterAPI] Retrieving ProductStatusDyn from 192.168.1.2
2020-02-27 06:52:10 WARNING (MainThread) [custom_components.hpprinter.HPDeviceData] Head type Imagedrum color mapping for OPC not available
2020-02-27 06:52:10 INFO (MainThread) [custom_components.hpprinter.home_assistant] async_update_entry: <homeassistant.config_entries.ConfigEntry object at 0x7fc9180fc210>
2020-02-27 06:52:10 INFO (MainThread) [custom_components.hpprinter.home_assistant] Loading domain sensor
2020-02-27 06:52:10 INFO (MainThread) [custom_components.hpprinter.home_assistant] Loading domain binary_sensor
2020-02-27 06:52:13 DEBUG (MainThread) [custom_components.hpprinter.sensor] Starting async_setup_entry sensor
2020-02-27 06:52:13 DEBUG (MainThread) [custom_components.hpprinter.sensor] Setup sensor: HP LaserJet M175nw Status | HP Printer-sensor-HP LaserJet M175nw Status
2020-02-27 06:52:13 DEBUG (MainThread) [custom_components.hpprinter.sensor] Setup sensor: HP LaserJet M175nw Printer | HP Printer-sensor-HP LaserJet M175nw Printer
2020-02-27 06:52:13 DEBUG (MainThread) [custom_components.hpprinter.sensor] Setup sensor: HP LaserJet M175nw Scanner | HP Printer-sensor-HP LaserJet M175nw Scanner
2020-02-27 06:52:13 DEBUG (MainThread) [custom_components.hpprinter.sensor] Setup sensor: HP LaserJet M175nw Toner Black | HP Printer-sensor-HP LaserJet M175nw Toner Black
2020-02-27 06:52:13 DEBUG (MainThread) [custom_components.hpprinter.sensor] Setup sensor: HP LaserJet M175nw Toner Cyan | HP Printer-sensor-HP LaserJet M175nw Toner Cyan
2020-02-27 06:52:13 DEBUG (MainThread) [custom_components.hpprinter.sensor] Setup sensor: HP LaserJet M175nw Toner Magenta | HP Printer-sensor-HP LaserJet M175nw Toner Magenta
2020-02-27 06:52:13 DEBUG (MainThread) [custom_components.hpprinter.sensor] Setup sensor: HP LaserJet M175nw Toner Yellow | HP Printer-sensor-HP LaserJet M175nw Toner Yellow
2020-02-27 06:52:13 DEBUG (MainThread) [custom_components.hpprinter.sensor] Setup sensor: HP LaserJet M175nw Imagedrum N/A | HP Printer-sensor-HP LaserJet M175nw Imagedrum N/A
2020-02-27 06:52:13 DEBUG (MainThread) [custom_components.hpprinter.sensor] Setup sensor: HP LaserJet M175nw Imagedrum OPC | HP Printer-sensor-HP LaserJet M175nw Imagedrum OPC
2020-02-27 06:52:13 DEBUG (MainThread) [custom_components.hpprinter.binary_sensor] Starting async_setup_entry binary_sensor
2020-02-27 06:52:13 DEBUG (MainThread) [custom_components.hpprinter.binary_sensor] Setup binary_sensor: HP LaserJet M175nw Status | HP Printer-binary_sensor-HP LaserJet M175nw Status
2020-02-27 06:52:13 WARNING (MainThread) [custom_components.hpprinter.HPDeviceData] Head type Imagedrum color mapping for OPC not available
2020-02-27 06:52:16 WARNING (MainThread) [homeassistant.components.device_tracker] Updating device list from legacy took longer than the scheduled scan interval 0:00:12
2020-02-27 06:52:19 WARNING (MainThread) [homeassistant.components.light] Updating osramlightify light took longer than the scheduled update interval 0:00:30
2020-02-27 06:52:19 WARNING (MainThread) [homeassistant.components.sensor] Updating mail_and_packages sensor took longer than the scheduled update interval 0:00:30
2020-02-27 06:52:19 INFO (MainThread) [custom_components.hpprinter.home_assistant] Updating 2020-02-27 11:52:19.301488+00:00
2020-02-27 06:52:19 DEBUG (MainThread) [custom_components.hpprinter.HPPrinterAPI] Updating ProductUsageDyn from 192.168.1.2
2020-02-27 06:52:19 DEBUG (MainThread) [custom_components.hpprinter.HPPrinterAPI] Retrieving ProductUsageDyn from 192.168.1.2
2020-02-27 06:52:19 DEBUG (MainThread) [custom_components.hpprinter.HPPrinterAPI] Updating ConsumableConfigDyn from 192.168.1.2
2020-02-27 06:52:19 DEBUG (MainThread) [custom_components.hpprinter.HPPrinterAPI] Retrieving ConsumableConfigDyn from 192.168.1.2
2020-02-27 06:52:19 DEBUG (MainThread) [custom_components.hpprinter.HPPrinterAPI] Updating ProductConfigDyn from 192.168.1.2
2020-02-27 06:52:19 DEBUG (MainThread) [custom_components.hpprinter.HPPrinterAPI] Retrieving ProductConfigDyn from 192.168.1.2
2020-02-27 06:52:19 DEBUG (MainThread) [custom_components.hpprinter.HPPrinterAPI] Updating ProductStatusDyn from 192.168.1.2
2020-02-27 06:52:19 DEBUG (MainThread) [custom_components.hpprinter.HPPrinterAPI] Retrieving ProductStatusDyn from 192.168.1.2
2020-02-27 06:52:20 WARNING (MainThread) [custom_components.hpprinter.HPDeviceData] Head type Imagedrum color mapping for OPC not available
2020-02-27 06:52:20 DEBUG (MainThread) [custom_components.hpprinter.sensor] sensor update_data: HP LaserJet M175nw Toner Black | HP Printer-sensor-HP LaserJet M175nw Toner Black
2020-02-27 06:52:20 DEBUG (MainThread) [custom_components.hpprinter.sensor] sensor update_data: HP LaserJet M175nw Toner Yellow | HP Printer-sensor-HP LaserJet M175nw Toner Yellow
2020-02-27 06:52:20 DEBUG (MainThread) [custom_components.hpprinter.sensor] sensor update_data: HP LaserJet M175nw Scanner | HP Printer-sensor-HP LaserJet M175nw Scanner
2020-02-27 06:52:20 DEBUG (MainThread) [custom_components.hpprinter.sensor] sensor update_data: HP LaserJet M175nw Imagedrum N/A | HP Printer-sensor-HP LaserJet M175nw Imagedrum N/A
2020-02-27 06:52:20 DEBUG (MainThread) [custom_components.hpprinter.sensor] sensor update_data: HP LaserJet M175nw Toner Cyan | HP Printer-sensor-HP LaserJet M175nw Toner Cyan
2020-02-27 06:52:20 DEBUG (MainThread) [custom_components.hpprinter.sensor] sensor update_data: HP LaserJet M175nw Printer | HP Printer-sensor-HP LaserJet M175nw Printer
2020-02-27 06:52:20 DEBUG (MainThread) [custom_components.hpprinter.sensor] sensor update_data: HP LaserJet M175nw Status | HP Printer-sensor-HP LaserJet M175nw Status
2020-02-27 06:52:20 DEBUG (MainThread) [custom_components.hpprinter.sensor] sensor update_data: HP LaserJet M175nw Imagedrum OPC | HP Printer-sensor-HP LaserJet M175nw Imagedrum OPC
2020-02-27 06:52:20 DEBUG (MainThread) [custom_components.hpprinter.sensor] sensor update_data: HP LaserJet M175nw Toner Magenta | HP Printer-sensor-HP LaserJet M175nw Toner Magenta
2020-02-27 06:52:20 DEBUG (MainThread) [custom_components.hpprinter.binary_sensor] binary_sensor update_data: HP LaserJet M175nw Status | HP Printer-binary_sensor-HP LaserJet M175nw Status

i did get result from the file. i did not get that earlier. bu still the integration does say it is offline.
when activating the integraqtion is it only the name/ ip i need to add there. or do i need to add http://

thanks for your reply…bad news…

In the readme file there are instruction of how to extract debug files, please post them

Thanks

If you didn’t get result from the url, the component cannot communicate with it…

@bar

What should I fill in the second row?

image

The IP address of the printer, no http or anything - just the numbers, e.g.

192.1.1.3

For those of you that have printers that do not expose configuration via shared .xml files, I created set of sensors to monitor status of HP laser printers via SNMP : HP Printer over SNMP
Not sure for what models it will work (I use CP1515n), but perhaps after small modification it can be rused.

I’m using the HP smart ink service and so it would be great to use the Print Counter value to ‘count-down’ the number of pages remaining for the plan I’m on (free 15 pages/month). I think I can manage this with the HA Counter entity but to save myself a lot of head scratching, has anyone already implemented this? It would be a great feature of the integration actually.

All,
I love what you are doing, and like to setup the same. However, using 0.107.7, I do not see “hpprinter” as an option in the UI to add as an integration. Plugging it straight into the configuration.yaml results in error (non existing integration).
Can you give me a headstart here ?
Tnx for pointing me in the right direction,
John

Did you restart the HA after copying the files and cleaned the cache in the Integrations page (sometimes it helps :slight_smile:) ?

thanks

@bar Thanks for your reply!
The problem I face is, I have started with a fresh 0.107.7 maiden installation. I have been digging into this forum and the github repository to absorb all there is I could find on this integration.
I would do a restart and browser cache cleanup after installing the files, but the billion dollar question is: which files to install where? The readme.md on github does not give me any clue…
Tnx for any advice, grtz
John

It’s available in HACS, are you using it?

Pfff, my bad … Never looked for it there…
Will get it going, and let you know how things are progressing!
Many thanks for fast response. Stay safe!

Grtz
John

Newbie here. Using HA, tried to pull from the Github but the addon doesn’t seems to appear. I went to Supervisor > Add-On Store > Add new repository br URL and pasted the previous link. Any idea of what I’m doing wrong?

Thanks in advance and great work!

This is a custom component not an addon, it’s available for installation via HACS, please look for HP Printer and install it

1 Like