SNMP and apt

Trying to install utilities to track down SNMP traffic. I am using HAOS (10.2 2023.5.4) and tried to install snmp (tools) using sudo apt get snmp but there is no such function. How can I install this as I am trying to find what objects are on an snmp enabled device.

Specifically I found this great tutorial and am trying to follow it:

apt is debian (and derivatives) specific. HA OS is based on Alpine, so no apt available.

Install the free MIB Browser from here: Free MIB Browser / MIB Browser / SNMP Browser.

Then make a tree walk to get your info and use that to set up the SNMP sensors in HA or use Node Red with its SNMP nodes.

Thank you very much…works perfectly! I mentioned in another post that I can change state to off, but cannot change it to on. I have followed the SNMP instructions and my code is pretty simple:

- platform: snmp
  name: furnace Reset
  version: "2c"
  community: public
  payload_on: 1
  payload_off: 0

Port is 161 and the baseoid is exactly what I am reading with MIB browser. The relay can switch off (if it is turned on from another device) but not turn on. I had read somewhere in previous posts that it had to do with an unknown state, but I thought this auto updates the state.

Use the MIB Browser to see the state when the furnace is on and also check the rights for your community.
Public is normally rather limited in rights.

The Furnace Reset is simply a relay that gets turned on and off. I use a phone app from ControlbyWeb to turn the relay on and off and it updates the state. I would like to be able to do this from HA but can only turn the relay off from the on position set by the mobile app. I changed the community name to “webrelay” per your suggestion, but still nothing has changed.

It is not the name of the community that is important, but the rights. Public is often just a standard created community with only read rights.

And the reason why you should see the state when the furnace is turned on by the mobile app, is because it might have to be written exactly like that to work. That means with same case on letters and any extra characters.

The device has two communities- read community and write community. Both were originally set to webrelay. The state does change with the mobile app and if I open a terminal window via HA, using xml. I have tried using the xml commands that work on the terminal to change the state of the relay like this:

- platform: command_line
#  switches:
#    furnace_reset:
#      friendly_name: "Furnace Reset"
#      command_on: “curl -k”
#      command_off: “curl -k”
#      command_state: “curl -k”
#      value_template: '{{value[66]== "1"}}'

But the same thing happens- I can turn on the relay but not turn it off.
Access in MIB Browser for the relay is listed as read-write

Can you see the result code from calling the curl URLs?
If not then try to call them directly in a browser and see if that gives a result code.

This is just to see if you get an error code back from one of the commands.

No errors recorded from the terminal, and as you can see the state does change correctly on the relay. see below…sorry for the long screenshot, just wanted to give you the result from all three commands as executed.

The ContronlbyWeb app controls the relay also?
Does it produce the same output of the state queries?

yes if I query with either the MIB Browser, curl from the HA terminal, or in the app I have it to change colors for the two different states (red vs. green)

I meant there are no other changes in the way your curl and your ControlbyWeb app produce?

No, no difference. When I try and use a switch in HA, even using the curl command that works or SNMP protocol the switch will turn off but never turn on.

Ok, you mix up a bit about what works and what does not work in the thread, but I think you might have a buggy relay.
Is it possible to maybe get a newer firmware for it?

From the control by web mobile app, relay works fine
From an SSH Terminal in HA using XML commands the relay works fine
From SMNP using the HA GUI Switch the relay will only turn off
From the HA GUI Switch using the same XML commands that work in a terminal the relay will only turn off.
From the web interface of the control by web product the relay turns on and off just fine
In all the instances that work, the web GUI, the Mobile app, and State.xml query all get updated just fine.
The relay does not switch states by itself and it has the latest firmware installed.
Yes, I did mix it up before. The relay turns off no problem, it just does not turn on when using the GUI switch in HA. Sorry for the confusion.

ok, no newer firmware, then only solution seems to be to make a SSH script in HA to turn it on.
I am not that into it, so you will have to find the help somewhere else.
There should be some documentation on the web and also older posts on the forum.
And you could also ask on the forum.

Thank you once again for your time and help.

I found this: Command Line - Home Assistant

Which has a way to update the state (command_state).