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

Allow new attributes [linkquality] on MQTT messages #173

Closed
lolorc opened this issue Jul 3, 2018 · 15 comments
Closed

Allow new attributes [linkquality] on MQTT messages #173

lolorc opened this issue Jul 3, 2018 · 15 comments
Labels
feature request Feature request

Comments

@lolorc
Copy link
Contributor

lolorc commented Jul 3, 2018

How difficult would it be to add new attributes to the mqtt messages ?
running zigbee2mqtt with DEBUG=* I can see attributes I would find useful to report:

  • linkquality
  • timestamp

what's the timestamp reference btw ? is that something the device reports or is that a timestamp the gateway creates ?

@palitu
Copy link

palitu commented Jul 3, 2018

I really think that link quality would be a handy thing to track. I am just now realising how poor the range is on these devices.

@ciotlosm ciotlosm changed the title new attributes Allow new attributes [linkquality] on MQTT messages Jul 3, 2018
@Koenkk Koenkk added the feature request Feature request label Jul 3, 2018
@Koenkk Koenkk added this to the 0.2 milestone Jul 3, 2018
@lolorc
Copy link
Contributor Author

lolorc commented Jul 4, 2018

If I may, could it be possible to add a last_seen attributes to every mqtt payload ?
this timestamp would be generated by the host, and would help to know when was the last update.
it could also be of some use for retained messages.

@ryanbeaton
Copy link

While being wary of json bloat these would be useful to use

Sent with GitHawk

@Koenkk
Copy link
Owner

Koenkk commented Jul 4, 2018

@lolorc yes, this is indeed nice to have.

@tb-killa
Copy link
Contributor

@Koenkk We should use the pollTimer function from controller.js and use the
Query the link quality index from a certain device by its ieee address. function from zigbee-shepherd.

Or maybe you´v got another idea :) ?

@Koenkk Koenkk removed this from the 0.2 milestone Jul 25, 2018
@Koenkk
Copy link
Owner

Koenkk commented Jul 25, 2018

@tb-killa I think for every received zigbee message we should parse the linkquality and add it to the message.

@tb-killa
Copy link
Contributor

I found this information with DEBUG=* npm start, it parsed from cc-znp like this

cc-znp:AREQ <-- AF:incomingMsg, { groupid: 0, clusterid: 3, srcaddr: 14129, srcendpoint: 3, dstendpoint: 1, wasbroadcast: 0, linkquality: 0, securityuse: 0, timestamp: 12584614, transseqnumber: 0, len: 7, data: <Buffer 18 09 0d 01 00 00 21> } +2s

@Koenkk Do you know if we got this Information inside zigbee-shepherd too ?
I search for link and found references inside lib/components/af.js
It seems to be that it could be available via

case 'incomingMsg':
..
case 'incomingMsgExt':
..
case 'zclIncomingMsg':
..

If you point me i could maybe help :)

Koenkk added a commit to Koenkk/zigbee-shepherd that referenced this issue Jul 29, 2018
Koenkk added a commit that referenced this issue Jul 29, 2018
@Koenkk
Copy link
Owner

Koenkk commented Jul 29, 2018

Added the linkquality attribute to the messages.

E.G.
2018-7-29 22:08:54 INFO MQTT publish, topic: 'zigbee2mqtt/0x00158d0001d8e1d2', payload: '{"click":"double","linkquality":36}'

@jarrah31
Copy link

Regarding link quality, what do the numbers represent? Lower the number = better or worse signal for example? What's the number range?
TIA

@talondnb
Copy link

My routers are both at 2 and 5, not a good sign. :(

@Koenkk
Copy link
Owner

Koenkk commented Aug 24, 2018

The lower the number the worst the signal, 2 and 5 are indeed very low.

In the same room I get somewhere between 50-100.

@lolorc
Copy link
Contributor Author

lolorc commented Aug 27, 2018

Hi there,
I've just updated from your latest changes, I correctly get the linkquality attribute, Thanks a lot.
Any idea what would be the higher value ? Been able to get 148 by bringing a device just in front of the coordinator.

@lolorc
Copy link
Contributor Author

lolorc commented Aug 27, 2018

how do you plan on implementing the last_seen attribute ? Would it be a simple timestamp locally generated from the local time of the computer running the zigbee2mqtt daemon ?
I guess that would be enough since the zigbee timestamp attribute is holding a relative number.

@faronov
Copy link

faronov commented Aug 28, 2018

Found some interesting how to get RSSI value
https://sunmaysky.blogspot.com/2017/02/conversion-between-rssi-and-lqi-in-z.html

@lolorc
Copy link
Contributor Author

lolorc commented Oct 3, 2018

closing, reporting timestamp/last_seen for later :)

@lolorc lolorc closed this as completed Oct 3, 2018
qm3ster pushed a commit to zigbeer/zigbeer that referenced this issue Mar 11, 2019
wilmardo pushed a commit to wilmardo/zigbee2mqtt that referenced this issue Sep 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request Feature request
Projects
None yet
Development

No branches or pull requests

8 participants