Fix network throughput sensors having duplicate unique IDs
Both RX and TX sensors were using 'network' as value_template_path, causing identical unique_ids and only one sensor to be created in HA. Now using distinct paths: network.rx_throughput and network.tx_throughput. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
parent
0d3912ee44
commit
9dd21023ef
@ -135,8 +135,8 @@ defmodule Systant.HaDiscovery do
|
||||
{"sensor", "disk_home_usage", build_sensor_config("Home Disk Usage", "#{base_topic}", "disk.disks", "%", "mdi:harddisk", "{{ (value_json.disk.disks | selectattr('mounted_on', 'equalto', '/home') | list | first).use_percent if (value_json.disk.disks | selectattr('mounted_on', 'equalto', '/home') | list) else 0 }}")},
|
||||
|
||||
# Network Sensors - Primary interface throughput
|
||||
{"sensor", "network_rx_throughput", build_sensor_config("Network RX Throughput", "#{base_topic}", "network", "MB/s", "mdi:download-network", "{{ (value_json.network[0].rx_throughput_bps | float / 1024 / 1024) | round(2) if value_json.network and value_json.network|length > 0 else 0 }}")},
|
||||
{"sensor", "network_tx_throughput", build_sensor_config("Network TX Throughput", "#{base_topic}", "network", "MB/s", "mdi:upload-network", "{{ (value_json.network[0].tx_throughput_bps | float / 1024 / 1024) | round(2) if value_json.network and value_json.network|length > 0 else 0 }}")},
|
||||
{"sensor", "network_rx_throughput", build_sensor_config("Network RX Throughput", "#{base_topic}", "network.rx_throughput", "MB/s", "mdi:download-network", "{{ (value_json.network[0].rx_throughput_bps | float / 1024 / 1024) | round(2) if value_json.network and value_json.network|length > 0 else 0 }}")},
|
||||
{"sensor", "network_tx_throughput", build_sensor_config("Network TX Throughput", "#{base_topic}", "network.tx_throughput", "MB/s", "mdi:upload-network", "{{ (value_json.network[0].tx_throughput_bps | float / 1024 / 1024) | round(2) if value_json.network and value_json.network|length > 0 else 0 }}")},
|
||||
|
||||
# Binary Sensors for status
|
||||
{"binary_sensor", "system_online", build_binary_sensor_config("System Online", "#{base_topic}", "mdi:server", "connectivity")}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user