I am pulling a device list from my router with SNMP sensor.
Sensor works however, I have trouble parsing the information the way I want it.
If there is an easier way, I am open to suggestions.
I would like to track the status of my Aimesh network but Asuswrt integration doesn’t exactly help with this matter.
I would like to know if a node is using wired, wireless backhaul or totally offline.
I have created 3 input_texts to store MAC addresses because they will not change at all.
How to parse this text to store ip addresses and status for each of the nodes.
I am still trying to create something but below is my draft code.
# AIMESH STATUS
- platform: snmp
host: 192.168.1.1
baseoid: .1.3.6.1.2.1.25.1.28.3.1.1.6.97.105.109.101.115.104
name: "Aimesh Devices"
accept_errors: true
default_value: 0
version: 2c
value_template: >-
{% set lyra_o = false %}
{% set lyra_m = false %}
{% set lyra_s = false %}
{% if states('input_text.lyra_o_mac') in (value | string) %}
{% set lyra_o = true %}
{{ (value | string ) }}
{% elif states('input_text.lyra_m_mac') in (value | string) %}
{% set lyra_m = true %}
{% elif states('input_text.lyra_s_mac') in (value | string) %}
{% set lyra_s = true %}
{% endif %}
scan_interval: 35
After struggling a lot, I have managed to get it work by creating separate template sensors. I will share my configuration in case someone might find this useful. The hard part was to figure out how to use the namespaces for loop operations.
Created two input texts for each nodes.
One for manually entering MAC address and the other is for saving ip address in case the node is offline.