I think HA wants a dot as first character in the OID too, but try first without.
Hi
Firstly , thank you very much for taking the time to provide the update.
I have tried your config with and without the . but sadly still not working.
I do have the entity back in the SNMP integration but showing no data
I check in dev tools , states and no sensor created.
So stil lost …
Going to give it a rest for a day and pick it up again tomorrow
Many thanks for all the help
Regards
Andy
You should try enabling “debug” to your HA logger for snmp in your configuration.yaml. It should look something like:
logger:
default: blah blah
logs:
homeassistant.components.snmp: debug
Restart HA and see what the logs say.
I’m curious, if sensor.wd_ex2
is not in the developers tools under state, then what is the name of the entity that the SNMP Integration says it has?
Regarding the question of OID, the device is using an enterprise MIB, and the OID starts at the beginning of the OID tree as 1.3.6.1.4.1.x.x.x.x
which corresponds to iso(1).org(3).dod(6).internet(1).private(4).enterprises(1). Syntactically, I don’t see a reason for it to begin with a dot. There is not anything in the docs to indicate it should or could begin with a dot.
Hi,
Maybe a good idea re the logger , but I have no idea how to do that . Will look to see if I can work it out though.
Re the entity, maybe I am confusing everyone with my description. What I am referring to is when I go into setting / integrations snmp it says 1 Entity.
But when I click on it to display it ( as happens on other integrations) the is nothing there , just a black page with the headers and a note in the middle saying no data.
Hope that explains a bit better
Regards
Andy
Hi
So I managed to enable the logger , very easy to do, and what I found in the logs was
ERROR (MainThread) [homeassistant.components.sensor] Error adding entity sensor.wd_ex2 for domain sensor with platform snmp
At least that explains why no entity is shown , but I dont understand what this error really means… Any ideas please
Regards
Andy
Unfortunately the error doesn’t tell you much. The SNMP Integration is trying to create a sensor by “inheriting” from the sensor integration and thus the SNMP integration is telling the sensor integration to create an SNMP sensor, but the sensor integration is not happy about something.
I suggest you post your configuration.yaml for your sensor:
(which will include your SNMP config).
Try
name: "WD EX2"
Hi
Here the part of the configuration file for the snmp sensor
sensor:
- platform: snmp
name: WD EX2
host: 192.168.2.117
community: public
version: 2c
baseoid: .1.3.6.1.4.1.5127.1.1.1.8.1.7
unit_of_measurement: '°C'
scan_interval: 30
device_class: 'temperature'
state_class: 'measurement'
As you can see Im using WD EX2 and i have tried several names.
Is that useful?
Regards
Andy
Try to put the name in quotes, either single or double.
Hi Wally
Tried that , changed it to “WD” still no good.
Its got to be something basic I’m doing wrong
Regards
Andy
I’m kinda wondering if its your YAML config that is causing the problem…
Anyway, here are a couple of other suggestions to try; not to get it to work but
provide some more insight as to what the problem may be:
- configure the host with an IP address that doesn’t exist on your network.
You should see an error about not being able to contact the host. - Change the OID to something not found in your MIB Browser. See if you get an error.
- Post what your MIB Browser is showing for the real OID you want to use.
Hi,
Some good ideas which I tired.
Changing the IP did result in an errors in the log that proved the real IP is working fine . These errors were tiemout errors as the snmp sensor was setup with the last result saying No SNMP response received before timeout ,
Putting it back to the real host , those errors disappeared but then replaced by these regarding the OID
2024-09-29 11:09:44.422 DEBUG (MainThread) [homeassistant.components.snmp.sensor] SNMP OID .1.3.6.1.4.1.5127 received type=<class ‘pysnmp.proto.rfc1905.NoSuchObject’> and data
2024-09-29 11:09:44.423 ERROR (MainThread) [homeassistant.components.snmp.sensor] SNMP error for OID .1.3.6.1.4.1.5127: No Such Object currently exists at this OID
2024-09-29 11:09:44.424 ERROR (MainThread) [homeassistant.components.sensor] Error adding entity sensor.wd for domain sensor with platform snmp
These clearly point to the OID as the problem in my view.
then I tried two differnet MIB browser to check I was reading leaf nodes and the OID value was correct which both are.
This is what the MIB browser output is of that leaf node
“Name”,“Full Name”,“OID”,“Type”,“Access”,“Indexes”,“MIB Module”,“Description”
“mycloudex2ultraTemperature”,“.iso.org.dod.internet.private.enterprises.WD.productID.projectID.modelID.submodelID.nasAgent.mycloudex2ultraTemperature”,"
.1.3.6.1.4.1.5127.1.1.1.8.1.7",“DISPLAYSTRING”,“read-only”,“”,“MYCLOUDEX2ULTRA-MIB”,“The temperature of the system.”
All that done , whilst I feel I know the problem now I have no idea how ot fix it.
my config is this
sensor:
- platform: snmp
name: "WD"
host: 192.168.2.117
community: public
version: 2c
baseoid: .1.3.6.1.4.1.5127.1.1.1.8.1.7
unit_of_measurement: '°C'
scan_interval: 30
device_class: 'temperature'
state_class: 'measurement'
do i have anything wrong here such as device or state class
This is giving me a headache …
It is saying that it can’t read .1.3.6.1.4.1.5127
Maybe that node is not included in the public community view.
Do you log in with version 2c and public community when you are using your MIB browser?
Finally working , well sort of.
I figured out it was the OID so I enabled SNMP on a windows 11 PC , and that worked fine with a MIB Browser. However I couldn’t find which value to use and found on a Microsoft web site a generic OID.
I used that and had to # the unit of measurement, device and state class and then a reboot later I finally have an entity in the snmp integration.
So what I need to do is understand what values from the mib browser I can use , I thought they must be OID , but I think I can use timeticks, integer etc but not sure
But a good step forward thou
Regards
Andy
Googling around I found the MIB for this product (please ignore the issue in that post as it is irrelevant). So I think you have the correct OID.
However, another HA Forum user recently posted having an OID problem with pysnmp. His error was different from yours, but his solution was to add an instance index .0
(even though its a scalar) to the end of the OID.
So in summary, try: baseoid: 1.3.6.1.4.1.5127.1.1.1.8.1.7.0
Hi,
I found the same post and tried a few of those OID’s but none worked for me.
In fact they resulted in the same error as previous with no entity being created.
The problem is , its very trial & error needing a restart each time , so Ive come to the conclusion I’ll have to dig around until I find the right ones.
Thank you for taking the time to help
Regards
Andy
Everything coming from SNMP v2c is either string or INT32.
If your temperature sensor is measuring 72.85 °C, then the SNMP value might be 7285, which might be out of range for a temperature sensor in HA.
Hi
So I took the note it should be an Integer and changed my config , which worked and displayed the entity with the correct value. So happy days
However I then took the xml output from the MIB browser and changed my config to use an Octet string value instead and very strangely despite several reboots the original SNMP entity remained.
I will of course change it back to an integer but I cant explain why that is happening .
Also now I have it working and creating one sensor , how do I include more to have multiple sensors for that device .
Do I just add more OID lines or repeat the same config but with different sensor names
many thanks
Andy
Should be something like
sensor:
- platform: snmp
name: "WD"
etc. etc.
- platform: snmp
name: "NAME2"
etc. etc.
When you’re finished, it would be good to post your final config for others to see in the future.
Thank you , yes I will as it might help somebody who are like me stuck, and thank you for the help.
I have been playing with it today and from the xml output of the snmpwalk if I use integers they seem so work
If I use Octetstring doesn’t in any way. (with or without a . at the front, extra 0 on the end as I read in another post … confusing
However the values I need are octetstrings not integers … so even thou I have it working with integers , its pretty useless .
I have seen other posts where they are not using OIDs and have text values so i’m still very confused how the snmp integration works. I have read the documentation on it several times but its very basic and limited info.
So I have a question to anyone who see’s this… does anyone have a WD EX2 that they have done this with, as I am now considering wiping it clean and selling it on ebay…
Appreciate all the help to date as well … thank you Andy