Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FR] Missing Routers #247

Closed
Sineos opened this issue Sep 4, 2023 · 9 comments · Fixed by #248
Closed

[FR] Missing Routers #247

Sineos opened this issue Sep 4, 2023 · 9 comments · Fixed by #248
Assignees
Labels
enhancement New feature or request

Comments

@Sineos
Copy link

Sineos commented Sep 4, 2023

What happened?

Apparently zigbee2mqtt or rather the firmware of TI based coordinators can "forget" that certain devices are routers.

To detect this, zigbee2mqtt has implemented a coordinator_check.

Sending:
zigbee2mqtt/bridge/request/coordinator_check
will return on:
zigbee2mqtt/bridge/response/coordinator_check
with an array of missing routers like:
{"missing_routers":[{"friendly_name":"LEDGarage","ieee_address":"0x04cd15fffe0ae5f7"}]}

It would be nice to have an option to check this regularly, e.g. every day at 3 in the night and populate some data points under:
zigbee2mqtt.0.info

What did you expect to happen?

No response

How to reproduce it (minimal and precise)

No response

Adapter version

2.11.0

Log

No response

@Sineos Sineos added the problem Something isn't working label Sep 4, 2023
@o0shojo0o o0shojo0o added enhancement New feature or request and removed problem Something isn't working labels Sep 5, 2023
@o0shojo0o
Copy link
Contributor

o0shojo0o commented Sep 5, 2023

Oh yes, I didn't know that, but it's definitely interesting.
Eight routers were also found in my case...

{
  "data": {
    "missing_routers": [
      {
        "friendly_name": "FL.Licht.Links",
        "ieee_address": "0xb4e3f9fffea14f56"
      },
      {
        "friendly_name": "FL.Licht.Decke Hinten",
        "ieee_address": "0x0017880102a096e5"
      },
      {
        "friendly_name": "KZ.Geraet.WorkStation",
        "ieee_address": "0x00158d000356bb32"
      },
      {
        "friendly_name": "FL.Licht.Rechts",
        "ieee_address": "0xb4e3f9fffea3efbd"
      },
      {
        "friendly_name": "FL.Licht.Garderobe",
        "ieee_address": "0x00124b0022661ae6"
      },
      {
        "friendly_name": "FL.Licht.Decke Vorne",
        "ieee_address": "0x0017880102eebc0b"
      },
      {
        "friendly_name": "BU.Licht.Schreibtisch",
        "ieee_address": "0x842e14fffe26f649"
      },
      {
        "friendly_name": "SZ.Licht.Bett",
        "ieee_address": "0x588e81fffefea724"
      }
    ]
  },
  "status": "ok"
}

@o0shojo0o
Copy link
Contributor

Please test the dev branch -> https://github.com/o0shojo0o/ioBroker.zigbee2mqtt/tree/Missing-Routers-%23247

@Sineos
Copy link
Author

Sineos commented Sep 6, 2023

Oh yes, I didn't know that, but it's definitely interesting.

Many thanks for picking it up. I stumbled upon this also by pure chance and was quite surprised and have implemented this check in my Iobroker Node-Red instance already. Of course, having it directly in your great adapter is very much appreciated.

Unfortunately I have already fixed my devices but I will test nevertheless.

I would consider this a quite serious health issue for a zigbee network so this might even warrant some warning messages at "info" level in the iobroker log.

@o0shojo0o
Copy link
Contributor

What does your JSON currently look like when it doesn't find missing_routers?

@Sineos
Copy link
Author

Sineos commented Sep 7, 2023

Hmm, good point.
In the "Objects" tab it just looks like an empty array:

grafik

When clicking on the empty array. The GUI error page pops up:

grafik

this.props.role is undefined

value@http://192.168.178.12:8081/static/js/773.890676d7.chunk.js:1:107460function(e,t){return(0,y.jsxs)("div",{children:[e,(0,y.jsx)("br",{})]},t)}Po@http://192.168.178.12:8081/static/js/4164.29c179b8.chunk.js:2:77949function(e,t){return(0,y.jsxs)("div",{children:[e,(0,y.jsx)("br",{})]},t)}No@http://192.168.178.12:8081/static/js/4164.29c179b8.chunk.js:2:77745function(e,t){return(0,y.jsxs)("div",{children:[e,(0,y.jsx)("br",{})]},t)}Ei@http://192.168.178.12:8081/static/js/4164.29c179b8.chunk.js:2:121277function(e,t){return(0,y.jsxs)("div",{children:[e,(0,y.jsx)("br",{})]},t)}ks@http://192.168.178.12:8081/static/js/4164.29c179b8.chunk.js:2:109420function(e,t){return(0,y.jsxs)("div",{children:[e,(0,y.jsx)("br",{})]},t)}ys@http://192.168.178.12:8081/static/js/4164.29c179b8.chunk.js:2:109348function(e,t){return(0,y.jsxs)("div",{children:[e,(0,y.jsx)("br",{})]},t)}vs@http://192.168.178.12:8081/static/js/4164.29c179b8.chunk.js:2:109209function(e,t){return(0,y.jsxs)("div",{children:[e,(0,y.jsx)("br",{})]},t)}us@http://192.168.178.12:8081/static/js/4164.29c179b8.chunk.js:2:105989function(e,t){return(0,y.jsxs)("div",{children:[e,(0,y.jsx)("br",{})]},t)}ss@http://192.168.178.12:8081/static/js/4164.29c179b8.chunk.js:2:106380function(e,t){return(0,y.jsxs)("div",{children:[e,(0,y.jsx)("br",{})]},t)}Hl@http://192.168.178.12:8081/static/js/4164.29c179b8.chunk.js:2:46920function(e,t){return(0,y.jsxs)("div",{children:[e,(0,y.jsx)("br",{})]},t)}34463/ls/<@http://192.168.178.12:8081/static/js/4164.29c179b8.chunk.js:2:103922function(e,t){return(0,y.jsxs)("div",{children:[e,(0,y.jsx)("br",{})]},t)}VoidFunction*ls@http://192.168.178.12:8081/static/js/4164.29c179b8.chunk.js:2:103895function(e,t){return(0,y.jsxs)("div",{children:[e,(0,y.jsx)("br",{})]},t)}rs@http://192.168.178.12:8081/static/js/4164.29c179b8.chunk.js:2:103356function(e,t){return(0,y.jsxs)("div",{children:[e,(0,y.jsx)("br",{})]},t)}enqueueSetState@http://192.168.178.12:8081/static/js/4164.29c179b8.chunk.js:2:53938function(e,t){return(0,y.jsxs)("div",{children:[e,(0,y.jsx)("br",{})]},t)}59117/b.prototype.setState@http://192.168.178.12:8081/static/js/2791.8afe157f.chunk.js:2:1047function(e,t){return(0,y.jsxs)("div",{children:[e,(0,y.jsx)("br",{})]},t)}29545/value/<.children<.onClick<@http://192.168.178.12:8081/static/js/9545.a369076e.chunk.js:1:89474function(e,t){return(0,y.jsxs)("div",{children:[e,(0,y.jsx)("br",{})]},t)}Re@http://192.168.178.12:8081/static/js/4164.29c179b8.chunk.js:2:16881function(e,t){return(0,y.jsxs)("div",{children:[e,(0,y.jsx)("br",{})]},t)}Be@http://192.168.178.12:8081/static/js/4164.29c179b8.chunk.js:2:17035function(e,t){return(0,y.jsxs)("div",{children:[e,(0,y.jsx)("br",{})]},t)}34463/Ir/<@http://192.168.178.12:8081/static/js/4164.29c179b8.chunk.js:2:36935function(e,t){return(0,y.jsxs)("div",{children:[e,(0,y.jsx)("br",{})]},t)}Ir@http://192.168.178.12:8081/static/js/4164.29c179b8.chunk.js:2:37029function(e,t){return(0,y.jsxs)("div",{children:[e,(0,y.jsx)("br",{})]},t)}Ur@http://192.168.178.12:8081/static/js/4164.29c179b8.chunk.js:2:37446function(e,t){return(0,y.jsxs)("div",{children:[e,(0,y.jsx)("br",{})]},t)}34463/Qr/<@http://192.168.178.12:8081/static/js/4164.29c179b8.chunk.js:2:42888function(e,t){return(0,y.jsxs)("div",{children:[e,(0,y.jsx)("br",{})]},t)}cs@http://192.168.178.12:8081/static/js/4164.29c179b8.chunk.js:2:106598function(e,t){return(0,y.jsxs)("div",{children:[e,(0,y.jsx)("br",{})]},t)}Le@http://192.168.178.12:8081/static/js/4164.29c179b8.chunk.js:2:16013function(e,t){return(0,y.jsxs)("div",{children:[e,(0,y.jsx)("br",{})]},t)}Qr@http://192.168.178.12:8081/static/js/4164.29c179b8.chunk.js:2:38740function(e,t){return(0,y.jsxs)("div",{children:[e,(0,y.jsx)("br",{})]},t)}qn@http://192.168.178.12:8081/static/js/4164.29c179b8.chunk.js:2:23136function(e,t){return(0,y.jsxs)("div",{children:[e,(0,y.jsx)("br",{})]},t)}$n@http://192.168.178.12:8081/static/js/4164.29c179b8.chunk.js:2:22918function(e,t){return(0,y.jsxs)("div",{children:[e,(0,y.jsx)("br",{})]},t)}o@http://192.168.178.12:8081/static/js/6565.7d301e83.chunk.js:2:310397function(e,t){return(0,y.jsxs)("div",{children:[e,(0,y.jsx)("br",{})]},t)}EventListener.handleEvent*36134/tn/</<@http://192.168.178.12:8081/static/js/6565.7d301e83.chunk.js:2:318001function(e,t){return(0,y.jsxs)("div",{children:[e,(0,y.jsx)("br",{})]},t)}36134/Ne/</</<@http://192.168.178.12:8081/static/js/6565.7d301e83.chunk.js:2:283232function(e,t){return(0,y.jsxs)("div",{children:[e,(0,y.jsx)("br",{})]},t)}Wr@http://192.168.178.12:8081/static/js/4164.29c179b8.chunk.js:2:38243function(e,t){return(0,y.jsxs)("div",{children:[e,(0,y.jsx)("br",{})]},t)}Ar@http://192.168.178.12:8081/static/js/4164.29c179b8.chunk.js:2:37642function(e,t){return(0,y.jsxs)("div",{children:[e,(0,y.jsx)("br",{})]},t)}34463/Hr/<@http://192.168.178.12:8081/static/js/4164.29c179b8.chunk.js:2:37808function(e,t){return(0,y.jsxs)("div",{children:[e,(0,y.jsx)("br",{})]},t)}Hr@http://192.168.178.12:8081/static/js/4164.29c179b8.chunk.js:2:37752function(e,t){return(0,y.jsxs)("div",{children:[e,(0,y.jsx)("br",{})]},t)}34463/n.createRoot@http://192.168.178.12:8081/static/js/4164.29c179b8.chunk.js:2:128192function(e,t){return(0,y.jsxs)("div",{children:[e,(0,y.jsx)("br",{})]},t)}e@http://192.168.178.12:8081/static/js/58.febd06db.chunk.js:2:300923function(e,t){return(0,y.jsxs)("div",{children:[e,(0,y.jsx)("br",{})]},t)}16677@http://192.168.178.12:8081/static/js/58.febd06db.chunk.js:2:301138function(e,t){return(0,y.jsxs)("div",{children:[e,(0,y.jsx)("br",{})]},t)}t@http://192.168.178.12:8081/static/js/main.2740198b.js:1:300function(e,t){return(0,y.jsxs)("div",{children:[e,(0,y.jsx)("br",{})]},t)}promise callback*77569@http://192.168.178.12:8081/static/js/main.2740198b.js:1:164function(e,t){return(0,y.jsxs)("div",{children:[e,(0,y.jsx)("br",{})]},t)}t@http://192.168.178.12:8081/static/js/main.2740198b.js:1:300function(e,t){return(0,y.jsxs)("div",{children:[e,(0,y.jsx)("br",{})]},t)}@http://192.168.178.12:8081/static/js/main.2740198b.js:1:14126function(e,t){return(0,y.jsxs)("div",{children:[e,(0,y.jsx)("br",{})]},t)}@http://192.168.178.12:8081/static/js/main.2740198b.js:1:14134function(e,t){return(0,y.jsxs)("div",{children:[e,(0,y.jsx)("br",{})]},t)}

In the browser's console:

TypeError: this.props.role is undefined
    value ObjectBrowserValue.jsx:566
    React 14
        Po
        No
        Ei
        ks
        ys
        vs
        us
        ss
        Hl
        ls
        ls
        rs
        enqueueSetState
        setState
    onClick ObjectBrowser.jsx:5539
    React 11
        Re
        Be
        Ir
        Ir
        Ur
        Qr
        cs
        Le
        Qr
        qn
        $n
    o helpers.ts:98
    tn trycatch.ts:232
    Ne instrument.ts:589
    React 5
    e bootstrap.jsx:25
    16677 bootstrap.jsx:117
    Webpack 5
        t
        promise callback*77569
        t
        <anonymous>
        <anonymous>
instrument.ts:139

@o0shojo0o
Copy link
Contributor

o0shojo0o commented Sep 7, 2023

Please delete the data point and install again via this link :) -> https://github.com/o0shojo0o/ioBroker.zigbee2mqtt/tree/Missing-Routers-%23247

Then you also have this option:
image

@o0shojo0o
Copy link
Contributor

And I meant the JSON object you get back via MQTT

@o0shojo0o o0shojo0o self-assigned this Sep 7, 2023
@Sineos
Copy link
Author

Sineos commented Sep 7, 2023

The JSON object as returned by MQTT looks like:

{
    "data": {
        "missing_routers": [
        ]
    },
    "status": "ok"
}

The error when clicking on the empty array is also solved 👍

zigbee2mqtt.0 	2023-09-07 21:05:00.021	debug	Received MQTT message on 'zigbee2mqtt/bridge/request/coordinator_check' with data '""'
zigbee2mqtt.0 	2023-09-07 21:06:17.828	info	MQTT publish: topic 'zigbee2mqtt/bridge/response/coordinator_check', payload '{"data":{"missing_routers":[]},"status":"ok"}'

Crontab seems to work as well.

Great work! Many thanks

@o0shojo0o
Copy link
Contributor

Ok then I will create a PR, merge and create a new release :)

o0shojo0o added a commit that referenced this issue Sep 7, 2023
* add coordinator_check and missing_routers

#247

* added state `info.missing_routers_count` and option `Automatic check`

#247

* Update main.js

* fix role

* code cleanup

* small fix
o0shojo0o added a commit that referenced this issue Sep 7, 2023
-   (o0shojo0o) added state `info.coordinator_check` ([#247](#247))
-   (o0shojo0o) added state `info.missing_routers` ([#247](#247))
-   (o0shojo0o) added state `info.missing_routers_count` ([#247](#247))
-   (o0shojo0o) added option `Automatic check for missing routers in the coordinator memory` ([#247](#247))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants