SNMP Install


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

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

  - name: apc_epdu
    community: public
    version: 2c
    scan_interval: 300

  - platform: snmp
    name: "Host"
    host: apc_epdu

But i get this error:

Setup failed for snmp: No setup or config entry setup function defined.
21:31:41 – (ERREUR)
The snmp integration does not support YAML setup, please remove it from your configuration
21:31:41 – (ERREUR)
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 ?


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
    community: public
    version: '2c'
    baseoid: .
    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?