homeassistant-mikrotik_router icon indicating copy to clipboard operation
homeassistant-mikrotik_router copied to clipboard

By upgrading via the Settings page top-shortcut (/config/dashboard) all interfaces got duplicated

Open kbalint opened this issue 1 year ago • 1 comments

First of all, thank you for your work on this integration!

The newer versions of HA alerts and makes component updates easy via a built-in feature on the Settings page's menu. However if I update Mikrotik_Router this way, it will get into some trouble, and every component got re-added.

I have a custom (handcrafted) page for the router, and it drives me mad to manually change the graph's / menus entities randomly :)

For example:

  • type: entities title: Firewall entities:
    • entity: switch.mikrotik_router_nat_5
    • entity: switch.mikrotik_router_nat_6
    • entity: switch.mikrotik_router_nat_7
    • entity: switch.mikrotik_router_nat_8

becomes - entity: switch.mikrotik_router_nat_10 - entity: switch.mikrotik_router_nat_11 - entity: switch.mikrotik_router_nat_12

in the 'old' ways of working it was not an INT value, but was named accordingly ex.: switch.mikrotik_router_nat_tpc_raspi_rdp

and for the graphs, sensor names fluctuate between the proper and a secondary:

sensor.mikrotik_router_pppoe_out1_rx becomes randomly sensor.mikrotik_router_pppoe_out1_rx_2

I have 10 graphs with 20 items, Total ~40 entities on this page, and randomly it becomes a NaN/NaN / entity not found mess :(

What is the proper way of updating this component?

Software versions

  • Home Assistant version: HA 2023.10
  • Mikrotik Router integration version: ? 0.0.0 (see below) according to Hacks it should be 2.1.4
  • Mikrotik Hardware: hAP ac^2
  • RouterOS version: 6.49.10 (stable)

Diagnostics data

In the Integration's diagnostics page, the component has 0.0.0 as a version:


 "integration_manifest": {
    "domain": "mikrotik_router",
    "name": "Mikrotik Router",
    "config_flow": true,
    "iot_class": "local_polling",
    "documentation": "https://github.com/tomaae/homeassistant-mikrotik_router",
    "issue_tracker": "https://github.com/tomaae/homeassistant-mikrotik_router/issues",
    "dependencies": [],
    "requirements": [
      "librouteros>=3.2.0",
      "mac-vendor-lookup>=0.1.12"
    ],
    "codeowners": [
      "@tomaae"
    ],
    "version": "0.0.0",
    "is_built_in": false
  },
  "data": {
    "entry": {
      "data": {
        "name": "Mikrotik_router",
        "host": "192.x.x.x",
        "username": "**REDACTED**",
        "password": "**REDACTED**",
        "port": 0,
        "ssl": false
      },
      "options": {
        "scan_interval": 30,
        "unit_of_measurement": "Mbps",
        "track_iface_clients": true,
        "track_network_hosts_timeout": 180,
        "zone": "home",
        "sensor_port_tracker": true,
        "sensor_port_traffic": true,
        "track_network_hosts": true,
        "sensor_client_traffic": true,
        "sensor_client_captive": true,
        "sensor_simple_queues": true,
        "sensor_nat": true,
        "sensor_mangle": false,
        "sensor_filter": false,
        "sensor_kidcontrol": true,
        "sensor_ppp": true,
        "sensor_scripts": true,
        "sensor_environment": true
      }
    },

kbalint avatar Oct 12 '23 11:10 kbalint

yup, I'm aware of that. it has to do with how new HA methods handle devices. I have a solution already on other integration I'm currently working on and it will be migrated here too.

tomaae avatar Oct 13 '23 13:10 tomaae