SNMP Install

Hi,

I’m trying to setup home assistant to monitor a APC PDU.

Iv’e set up my configuration.yaml like bellow:

snmp:
  - name: apc_epdu
    host: 192.168.1.3
    community: public
    baseoid: 3.6.1.4.1.318.1.3.4.9
    version: 2c
    scan_interval: 300

sensor:
  - platform: snmp
    name: "Host"
    host: apc_epdu
    baseoid: 3.6.1.2.1.1.1.0

But i get this error:

Setup failed for snmp: No setup or config entry setup function defined.
21:31:41 – (ERREUR) setup.py
The snmp integration does not support YAML setup, please remove it from your configuration
21:31:41 – (ERREUR) setup.py
Invalid SNMP host: Bad IPv6/UDP transport address apc_epdu@161: [Errno -5] Name has no usable addresscaused by <class 'socket.gaierror'>: [Errno -5] Name has no usable address
21:31:40 – (ERREUR) snmp

I understood that we just have to set the snmp in the config.yaml, but it looks like it’s not the right way to do it regarding the error.

How can we set up snmp in HA to monitor a device ?

Thx

Try commenting out the first block, I see nothing like that in the docs.

Yes it worke now.

One more question,

 - platform: snmp
    name: Switch_Port_4
    host: 192.168.1.3
    community: public
    version: '2c'
    baseoid: .1.3.6.1.4.1.318.1.1.30.6.2.1.4.4
    payload_on: 1
    payload_off: 2

I can switch from lovelace, but i can’t use in automation, it looks like it has no unique ID, how can i set up a unique ID ?

You don’t need a unique id in an automation, where are you seeing this error?