SNMP not returning value

I’m still working on getting my printer to return the information I need. But apparently HA has something against Magenta. Below is the snmpwalk of the values I am interested in as run under hass user.

(hass) hass@hass:~/.homeassistant$ snmpwalk -v1 -c public 192.168.2.247 1.3.6.1.2.1.43.11.1.1.6.0
iso.3.6.1.2.1.43.11.1.1.6.0.1 = STRING: "black ink"
iso.3.6.1.2.1.43.11.1.1.6.0.2 = STRING: "yellow ink"
iso.3.6.1.2.1.43.11.1.1.6.0.3 = STRING: "cyan ink"
iso.3.6.1.2.1.43.11.1.1.6.0.4 = STRING: "magenta ink"
(hass) hass@hass:~/.homeassistant$ snmpwalk -v1 -c public 192.168.2.247 1.3.6.1.2.1.43.11.1.1.9.0
iso.3.6.1.2.1.43.11.1.1.9.0.1 = INTEGER: 61
iso.3.6.1.2.1.43.11.1.1.9.0.2 = INTEGER: 23
iso.3.6.1.2.1.43.11.1.1.9.0.3 = INTEGER: 90
iso.3.6.1.2.1.43.11.1.1.9.0.4 = INTEGER: 25
(hass) hass@hass:~/.homeassistant$ snmpwalk -v1 -c public 192.168.2.247 1.3.6.1.2.1.43.11.1.1.8.0
iso.3.6.1.2.1.43.11.1.1.8.0.1 = INTEGER: 307
iso.3.6.1.2.1.43.11.1.1.8.0.2 = INTEGER: 114
iso.3.6.1.2.1.43.11.1.1.8.0.3 = INTEGER: 117
iso.3.6.1.2.1.43.11.1.1.8.0.4 = INTEGER: 125
(hass) hass@hass:~/.homeassistant$ 

Next is the relevant section of my config file. The lines with an " * " in front of them are the lines that are not returning anything. No the *'s are not there in my file, I just added them to make finding the lines easier.

sensor:
  - platform: snmp
    host: 192.168.2.247
    name: "dsp1hpnb"
    community: public
    baseoid: 1.3.6.1.2.1.43.11.1.1.6.0.1
  - platform: snmp
    host: 192.168.2.247
    name: "dsp1hpny"
    community: public
    baseoid: 1.3.6.1.2.1.43.11.1.1.6.0.2
  - platform: snmp
    host: 192.168.2.247
    name: "dsp1hpnc"
    community: public
    baseoid: 1.3.6.1.2.1.43.11.1.1.6.0.3
  *- platform: snmp
  *  host: 192.168.2.247
  *  name: "dsp1hpnm"
  *  community: public
  *  baseoid: 1.3.6.1.2.1.43.11.1.1.6.0.4
  - platform: snmp
    host: 192.168.2.247
    name: "dsp1hpcb"
    community: public
    baseoid: 1.3.6.1.2.1.43.11.1.1.9.0.1
  - platform: snmp
    host: 192.168.2.247
    name: "dsp1hpcy"
    community: public
    baseoid: 1.3.6.1.2.1.43.11.1.1.9.0.2
  - platform: snmp
    host: 192.168.2.247
    name: "dsp1hpcc"
    community: public
    baseoid: 1.3.6.1.2.1.43.11.1.1.9.0.3
  *- platform: snmp
  *  host: 192.168.2.247
  *  name: "dsp1hpcm"
  *  community: public
  *  baseoid: 1.3.6.1.2.1.43.11.1.1.9.0.4
  - platform: snmp
    host: 192.168.2.247
    name: "dsp1hpfb"
    community: public
    baseoid: 1.3.6.1.2.1.43.11.1.1.8.0.1
  - platform: snmp
    host: 192.168.2.247
    name: "dsp1hpfy"
    community: public
    baseoid: 1.3.6.1.2.1.43.11.1.1.8.0.2
  - platform: snmp
    host: 192.168.2.247
    name: "dsp1hpfc"
    community: public
    baseoid: 1.3.6.1.2.1.43.11.1.1.8.0.3
  *- platform: snmp
  *  host: 192.168.2.247
  *  name: "dsp1hpfm"
  *  community: public
  *  baseoid: 1.3.6.1.2.1.43.11.1.1.8.0.4

I cut and pasted to build the file, the bad thing about that is if there is a problem, it gets replicated multiple times. Evidently that’s what i have done. But for the life of me, I can’t see what I messed up. Or does HA really not like Magenta?

Well this morning i’m not sure if this is better or worse. now even the snmpwalk won’t return anything for magenta. At least it’s consistent. I pulled down pysnmp libraries and tried those. They fail on magenta too. How can something that obviously should be there suddenly disappear. Maybe it’s time to get a new printer. (after the current ink supplies run out).

Sorry to revive an old topic. I’ve just ran into this problem while adding my HP OfficeJet Pro 8600. The magenta values for max capacity and the current level are both blank, while snmpwalk will show these values.

Did you ever work out a solution?

I use AppDaemon to access it. I just dropped back one level and grabbed the subgroup for markers. Then in my code, I search for each of the color components I needed.

Ok, cool. So there is a way. Such a shame, as SNMP this was would have been so easy.

Do you mind sharing your config? I’m only 3 weeks in to HA and still learning how to do things.

AppDaemon is an add-on to HA. It basically allows you to write your own Python apps to do automation instead of having to fight with YAML. I did mine through AppDaemon so it’s just a python app. I’m happy to share it with you, but it would require that you install AppDaemon as well. It’s not that hard to do and there are several of us that can help you if you like. But I wanted to make sure you understood that it’s not “native” HA before I lead you down that road.

Ah, ok. It’s not a big deal for me at the moment. I mean, is it really that hard to look at the values on my printer screen, or the nagging popups when printing saying low ink. For now, AppDaemon is something I think I’ll leave for now. I have no experience with python, so it’s just another thing for me to learn. For now, I’m focusing on the templating component and what really matters with home automation.

Although, upon saying all that, if it’s a quick process to setup then I might give it a try. I’ve just spent the better part of a day or so getting an indoor temperature reading from my weather station and my UPS data to Home Assistant. Weather Station was a challenge, but UPS is by CyberPower, and couldn’t get it to work with APCUPSd, but found it has SNMP, so lesons learnt here with the printer has paid off with the UPS.

Thats the way it goes sometimes. You spend a day or two fighting with one component, and then what you learn, opens the door for a whole other set of things you hadn’t thought about.

AppDaemon isn’t that hard to install and get working. The instructions are good, the problem is that people don’t tend to follow the instructions :). Happy to help though if you decide to go that way.

What’s your computing environment (raspberry pi, windows)?

Running on a Pi3 under Raspbian.

I noticed that HA 0.47 was released overnight and it has a new component called Python Scripts. Would your python app work via this or is this different again?

I’m not sure. I just installed it yesterday and haven’t had a chance to play with it yet. It sounds like it might, give me a couple of days to look at it and we’ll see.