Hello!
Can somebody please explain a bit further how values coming via SNMP can be used in Home Assistant (HA)? I have SNMP enabled on my Teltonika RUTX11 and set up a few SNMP platform sensors in HA (see my post dated 03 Nov 2023: Teltonika (OpenWRT / RutOS) custom GSM modem modbus - #49 by 7wells).
However, I fail to understand what to do then in HA. I thought that there must be entities appearing, but the only entities that I see in HA in connection with my RUTX11 are from Modbus (which I want to replace by SNMP).
What am I missing? Do I also have to enable Trap service settings on my RUTX11 and enter my HA’s IP in the “Host” field (and add Trap rules, too)? I do not (yet) need alerts via Trap, but just would like to see values of RUTX11 parameters defined in HA via the SNMP platform, but there are none.
EDIT:
Why have the OIDs on Teltonika’s website trailing periods (.1.3.6.1.4.1.48690)? In all examples from HA, the OIDs start without a trailing period (1.3.6.1.4.1.xxx).
Thanks a lot for your help!
PS:
From another Linux machine, I can read values from my RUTX11 like this:
$ snmpget -v2c -c public 192.168.11.1 1.3.6.1.4.1.48690.2.2.1.12.1
iso.3.6.1.4.1.48690.2.2.1.12.1 = INTEGER: -85
However, I do not understand where/how in HA I can get this value.
Is the following in configuration.yaml
not enough?
sensor:
- platform: snmp
host: 192.168.11.1
port: 161
version: 2c
community: public
accept_errors: true
name: 'Teltonika mobile signal strength'
unique_id: "Teltonika_mobile_signal_strength"
unit_of_measurement: "dBm"
baseoid: 1.3.6.1.4.1.48690.2.2.1.12.1
What else do I have to set up in HA to see a corresponding entity and to be able to create a lovelace card with this parameter and value (and others)?
@disuye @Karumbe and others:
Any hints? Thank you so much!
PS2 - solution found!
I had various sensor files in a sensors
folder and referred to all of them from my configuration.yaml
like this:
sensor: !include_dir_merge_list sensors
However, the teltonika.yaml
in that sensors
folder started with sensor:
, which ruined all (without any error messages in the logs):
sensor:
- platform: snmp
host: 192.168.11.1
port: 161
version: 2c
community: public
accept_errors: true
name: 'Teltonika mobile signal strength'
unique_id: "Teltonika_mobile_signal_strength"
unit_of_measurement: "dBm"
baseoid: 1.3.6.1.4.1.48690.2.2.1.12.1
Why? Well, because the configuration.yaml
already contains a sensor:
group.
I just mention this here for completeness, in case others stumble over this, too. My problem had nothing to do with SNMP itself, but rather with my own stupidity.
Cheers!