Custom Component for printer ink levels

Yeah, that did the trick, I downloaded the ink2mqtt.sh via wget on the command-line.
Now I’m seeing good stuff in the log!
Thanks for the support!
Now, I’m trying to adapt the sh-file to my printer, a Canon MG 7500…

1 Like

great news. good luck!

Fully working now :slight_smile:
image

Great news!
If you want to, please share your ink2mqtt.sh script.
Alternatively submit a PR against my repo and ill add it as an example for your printer type.

i have a HP envy, also interested in this addon, since i am also running HassOS

bit if i scroll above, seems for HP, HPLIB needs to be installed? is this also included?

HPlib is not included in the ink2mqtt hassio addons dockerfile currently, but no reason it cannot be added.
The problem here is that I don’t have a HP envy printer to test with.

My suggestion would be to clone my ink2mqtt addon to your hassio local addons dir and to work our how to install hplib as part of the image creation. You can see in the dockerfile what I needed to install/compile for ink.

You’ll presumably also need to change the shell script that calls ink to call the HP executable and parse its output.

thnx, but i have not much experience with docker/coding/compiling,

just a regular HA user :slight_smile:
i have asked on github HassOS, to maybe include INK & HPLIB in next HassOS releases , much easier then?

That is not how a HA add-on works, each add-on runs in its own container, independent from the HA main container, that’s at least how I understood it.

1 Like

Please note: the printer add-on by hijinx has been improved somewhat, it should now be easier to install and configure: https://github.com/james-fry/hassio-addons

Please note 2: only for printers that work with ink.

1 Like

Thanks @bouwew for the PR with improvements.

hi, how did you solved?
Thank you

@Korte, sorry, what is your question?

sorry, this question is not for you… :slight_smile:
I just would like to use the ink level indicator in my HA, but not working for me…

Sure I can help. But you need to provide more details. For instance tell us if there’s any error message?

Can you show what is in the log of the ink2mqtt-addon?

Please note: the ink2mqtt add-on https://github.com/james-fry/hassio-addons has been improved further: the installation has been made fully automatic, it is no longer needed to download, copy or edit any files.

These updates have been tested by me on 2 different Canon printers. I would like to invite anyone with a non-Canon printer to test the updated add-on and let me know your results. Please note, some printers are not supported by the Ink-application. The output of Ink is shown in the Log of the add-on.

The add-on can be updated by:

  • saving the text in the Config window
  • uninstall the add-on
  • install the add-on from James Fry’s addon repository
  • put the saved text back into the Config window and press Save
  • start the add-on

In case of a problem, please let us know what is shown in the Log window of the add-on.

1 Like

I have been using SNMP sensor for this - works out of the box without installing anything.
How different is this component, would that be any better?

sensor:
  - platform: snmp
    name: Printer Black Toner
    host: 192.168.1.106
    accept_errors: true
    baseoid: .1.3.6.1.2.1.43.11.1.1.9.1.1
    unit_of_measurement: '%'
  - platform: snmp
    name: Printer Cyan Toner
    host: 192.168.1.106
    accept_errors: true
    baseoid: .1.3.6.1.2.1.43.11.1.1.9.1.2
    unit_of_measurement: '%'
  - platform: snmp
    name: Printer Magenta Toner
    host: 192.168.1.106
    accept_errors: true
    baseoid: .1.3.6.1.2.1.43.11.1.1.9.1.3
    unit_of_measurement: '%'
  - platform: snmp
    name: Printer Yellow Toner
    host: 192.168.1.106
    accept_errors: true
    baseoid: .1.3.6.1.2.1.43.11.1.1.9.1.4
    unit_of_measurement: '%'

The ink2mqqt component uses ink and libinklevel (http://libinklevel.sourceforge.net/) and the results are available via MQTT. For a list of supported printers see the sourceforge-link.

I’m not sure but I’m expecting that a printer that supports SNMP is not supported by Ink/Libinklevel.
I know that certain HP printers require Cups and HPLib. So, the use of this addon will be somewhat limited.

1 Like

I’m not using this ink2mqtt.sh script. I’m using something else that runs 2 commands against hp-info. 1 command for the printer status, and the other that runs once for each ink cartridge. This doesn’t work on hass.io.

Thanks mate. Works a treat.

1 Like

Yes, I know. I tried to create an add-on that has both Cups and HPLIP, but I got stuck at compiling HPLIP :frowning:

well, i have an Hp ENVY inket printer, running hass.io, if anyone can find/make an addon , i’m verry happy :slight_smile: , since i am unable to install extra components