Ok, that tells us that there is communication between the UPS and HASS but HASS isn’t able to interpret the UPS response.
Did you enable SNMP on the UPS and what community name did you use? According to the SNMP component docs, community name is a required field in the sensor declaration. Do you get any messages in the log?
This is a known issue I reported myself quite some time ago: #2767
Someone was kind enough to start working on a fix: PR #11239. The code in that PR works (tested it myself for a while) but unfortunately it hasn’t been finalized and merged (yet).
The answers to your questions should be in my first post in my issue (linked above), where I included all the snmp sensors I used.
Keep in mind that the bottom 4 sensors in that printscreen only work with the code in the PR (linked above). Without that, those bottom 4 sensors would look exactly like yours.
I copied the new file snmp.py in custom_components of my HA. but i have some errors
File "/usr/src/app/homeassistant/config.py", line 645, in async_process_component_config
platform = get_platform(domain, p_name)
File "/usr/src/app/homeassistant/loader.py", line 104, in get_platform
return get_component(PLATFORM_FORMAT.format(domain, platform))
File "/usr/src/app/homeassistant/loader.py", line 142, in get_component
module = importlib.import_module(path)
File "/usr/local/lib/python3.6/importlib/__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 994, in _gcd_import
File "<frozen importlib._bootstrap>", line 971, in _find_and_load
File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 674, in exec_module
File "<frozen importlib._bootstrap_external>", line 781, in get_code
File "<frozen importlib._bootstrap_external>", line 741, in source_to_code
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "/config/custom_components/sensor/snmp.py", line 205
return str(value)
Maybe i don’t need to put it in custom_components and need to overwrite file snmp.py?
When I was testing the code, I renamed the original snmp.py file on my system and put the one from the PR there instead. I never tried it as a custom component.
Of course, I had to repeat the actions above anytime I updated Home Assistant to a newer version.