tomaae / homeassistant-mikrotik_router

Mikrotik router integration for Home Assistant
Apache License 2.0
302 stars 51 forks source link

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

Open kbalint opened 11 months ago

kbalint commented 11 months ago

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:

becomes

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

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
      }
    },
tomaae commented 11 months ago

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.