本帖最后由 dscao 于 2021-3-14 00:38 编辑
试了一下,参考原帖修改了一下文件格式以适配最新版本的ha,基本没问题。
sensor:
- platform: snmp_interface
host: 192.168.1.1
community: public
resources:
- type: interface12
- type: interface13
- type: interface14
homeassistant:
customize:
sensor.192_168_1_1_interface12ifinoctets:
friendly_name: LAN入站
sensor.192_168_1_1_interface12ifoutoctets:
friendly_name: LAN出站
sensor.192_168_1_1_interface13ifinoctets:
friendly_name: WAN下载
sensor.192_168_1_1_interface13ifoutoctets:
friendly_name: WAN上传
sensor.192_168_1_1_interface14ifinoctets:
friendly_name: WAN2下载
sensor.192_168_1_1_interface14ifoutoctets:
friendly_name: WAN2上传
configuration加入下面的才会有日志信息输出接口序号,再调整自己的接口序号:
logger:
default: error
logs:
custom_components.snmp_interface: debug
修改后的插件:
|