Commit Graph

46 Commits

Author SHA1 Message Date
Koen Kanters
2a08127e13 Fix tests 2020-10-03 23:24:08 +02:00
Koen Kanters
0c36b7894b Fix json escaped raw networkmap. https://github.com/Koenkk/zigbee2mqtt/issues/3281 2020-10-03 22:47:20 +02:00
qm3ster
f26ddd93ff Replace "problematic" depenencies
Also one comment typo lol

`node-static` was abandoned and vulnerable, which might matter since
it's used in production usage and not development.
replaced with popular `serve-static` + `finalhandler`

`json-stable-stringify` depended on an unneeded and unlicensed
polyfill for JSON builtin.
2020-09-25 15:58:45 +02:00
Koen Kanters
f57ec9f0fd Add definition to raw networkmap 2020-09-02 17:17:35 +02:00
Koen Kanters
9774031169 Sort logged and published JSON objects alphabetically. #4091 2020-08-13 20:00:35 +02:00
Koen Kanters
f8d082e18d Networkmap #3281 2020-06-15 20:10:30 +02:00
Kosta
b42c61d09a
use relative timestamps (#3743)
Use relative timestamps for the network map (e.g, `1 hour, 43 minutes ago` or `15 minutes, 10 seconds ago`), since that is easier to understand/decode than the standard ISO timestamps.

This introduces an additional (light weight) dependency to [humanize-duration](https://github.com/EvanHahn/HumanizeDuration.js) which in itself doesn't have any additional dependencies.

Co-authored-by: Konstantin Baumann <konstantin.baumann@autodesk.com>
2020-06-14 17:43:27 +02:00
Kosta
a2ea520b0c
add support for plantuml based network graphs (#3742)
Add support for [PlantUML](http://plantuml.com/guide) based network graphs, which can be pasted into [this online editor](https://www.planttext.com/).

The test configuration used for unit testing for example produces this output:

![output.svg](https://www.planttext.com/api/plantuml/svg/j5LTRzem57tVhxYFGSFbEbyG7gOoOBHggrMCQPsg2Zc9KwmwSPeufTjVsyD-qlx20dICZuJni4PHPDdtd7lkyRNpwyTFU7bESyqoNSJopP-PW6KXu3CYRNSwID7cjkEO3jok8_ONrqk4a0DXOBYEvJOWOaBoi0loKJGpLMYHt4-OBtabpNl58qYK_bIagSeq3wzKoENve3AOUcqaICjtWhIBs4NwTZbOHzojH_iLe--qeoZYWSiStzoes2-aNrlZ3igmqNAzHcNu-SMm1vDnR_1XV0wNmy6I68QcsngQRV0w2BA8UTA4KCJnmf4cp6T2SyXJ7kYiY9kWKYPV9esIWJgsCw9cTRh_w8QruyOqK59bntbYBJtnQZovdWafqXpE2WuZ1KQRsYwwU7rM7Lua3ucQ9qTLiDLzTAi2hLKo3LLHUZnzuD-EQs2wRE1EjR0RmLGieFV8CWOhPYYPOIuoBdcUmvn92VbSw606nfURYn6QbrUliN6RcXrle-mWC1qBfuiZn-ltRWTUbcnZjSn-aMiLGyYVHC1pC0RYQmDk-_r55bXbkJDcMgVTLYlLJ-f4995ghLGGd-Ky9D_5lSyv2PJAGf4mhJB2af2im8HIizK0OyLuClxuUJ8SlufZfkqllaXjc_4Dn_f_TTNxjGqsQipQKqZntmehpX8XxohITg4S7RgMwc2UUKooRR8o6SL3FLCBmtfOURhM6hVOIfY5-zQSyYHS_BT-0m00__y30000)

The generated script looks like this:

```
' paste into: https://www.planttext.com/

@startuml
card 0x0017880104e45525 [
0x0017880104e45525
---
0x0017880104e45525 (6536) failed: lqi,routingTable
---
Boef notSupportedModelID
---
1970-01-01T01:00:01+01:00
]

card 0x000b57fffec6a5b2 [
bulb
---
0x000b57fffec6a5b2 (40369)
---
IKEA TRADFRI LED bulb E26/E27 980 lumen, dimmable, white spectrum, opal white (LED1545G12)
---
1970-01-01T01:00:01+01:00
]

card 0x000b57fffec6a5b3 [
bulb_color
---
0x000b57fffec6a5b3 (40399)
---
Philips Hue Go (7146060PH)
---
unknown
]

card 0x0017880104e45521 [
button_double_key
---
0x0017880104e45521 (6538)
---
Xiaomi Aqara double key wireless wall switch (WXKG02LM)
---
1970-01-01T01:00:01+01:00
]

card 0x0017880104e45559 [
cc2530_router
---
0x0017880104e45559 (6540)
---
Custom devices (DiY) [CC2530 router](http://ptvo.info/cc2530-based-zigbee-coordinator-and-router-112/) (CC2530.ROUTER)
---
1970-01-01T01:00:01+01:00
]

card 0x00124b00120144ae [
Coordinator
---
0x00124b00120144ae (0)
---
1970-01-01T01:00:10+01:00
]

0x000b57fffec6a5b3 --> 0x00124b00120144ae: 120
0x000b57fffec6a5b2 --> 0x00124b00120144ae: 92
0x000b57fffec6a5b3 --> 0x000b57fffec6a5b2: 110
0x0017880104e45559 --> 0x000b57fffec6a5b2: 100
0x0017880104e45521 --> 0x0017880104e45559: 130

@enduml
```

Co-authored-by: Konstantin Baumann <konstantin.baumann@autodesk.com>
2020-06-14 15:48:50 +02:00
Koen Kanters
c0d4aea5bd Fix lint 2020-05-31 15:02:25 +02:00
Koen Kanters
d440de8069 Fix networkmap error when using Gledopto GL-C-008-2ID. #3623 2020-05-30 18:27:25 +02:00
Koen Kanters
838cb6e702 Update converters. 2020-04-13 21:15:08 +02:00
Koen Kanters
a2d09b08ea Refactor DeviceConfigure 2020-04-11 20:58:22 +02:00
Koen Kanters
10a47df33b Refactor 2020-04-11 20:45:50 +02:00
Koen Kanters
b8b4ff9ee7 baseExtension -> extension 2020-04-11 18:10:56 +02:00
Koen Kanters
e1ec16042f GreenPower devices don't support a network scan. #3322 2020-04-11 17:11:09 +02:00
Koen Kanters
cb0b0b5af9 Clear Home Assistant MQTT discovery on device remove. #2678 2020-01-09 21:47:19 +01:00
Koen Kanters
d562541178 Shepherd -> herdsman. 2019-11-09 20:38:47 +01:00
Koen Kanters
019b087af1 Fix tests. 2019-11-06 20:51:31 +01:00
Koen Kanters
23cf8eade9 Make graphviz networkmap ISO_8601_local time. https://github.com/Koenkk/zigbee2mqtt/issues/2239 2019-11-06 19:49:03 +01:00
Koen Kanters
cb3ec45294 Fix lint. 2019-10-26 18:25:51 +02:00
Koen Kanters
41e68c8ffe Update zigbee-herdsman to 0.7.0. 2019-09-23 22:21:27 +02:00
Koenkk
c8a07a5c2d Add base extension. 2019-09-17 18:32:16 +02:00
Koenkk
11aacb8620 Fix networkmap raw graph breaking change. https://github.com/azuwis/zigbee2mqtt-networkmap/issues/6 2019-09-17 18:19:42 +02:00
Koen Kanters
9c5b3bf4d1 Use lastSeen from zigbee-herdsman. 2019-09-12 22:48:23 +02:00
Koen Kanters
d83085ea7f
Zigbee-herdsman (#1945)
* Update zigbee-herdsman and zigbee-shepherd-converters.

* Force Aqara S2 Lock endvices (#1764)

* Start on zigbee-herdsman controller refactor.

* More updates.

* Cleanup zapp.

* updates.

* Propagate adapter disconnected event.

* Updates.

* Initial refactor to zigbee-herdsman.

* Refactor deviceReceive to zigbee-herdsman.

* Rename

* Refactor deviceConfigure.

* Finish bridge config.

* Refactor availability.

* Active homeassistant extension and more refactors.

* Refactor groups.

* Enable soft reset.

* Activate group membership

* Start on tests.

* Enable reporting.

* Add more controller tests.

* Add more tests

* Fix linting error.

* Data en deviceReceive tests.

* Move to zigbee-herdsman-converters.

* More device publish tests.

* Cleanup dependencies.

* Bring device publish coverage to 100.

* Bring home assistant test coverage to 100.

* Device configure tests.

* Attempt to fix tests.

* Another attempt.

* Another one.

* Another one.

* Another.

* Add wait.

* Longer wait.

* Debug.

* Update dependencies.

* Another.

* Begin on availability tests.

* Improve availability tests.

* Complete deviceAvailability tests.

* Device bind tests.

* More tests.

* Begin networkmap refactors.

* start on networkmap tests.

* Network map tests.

* Add utils tests.

* Logger tests.

* Settings and logger tests.

* Ignore some stuff for coverage and add todos.

* Add remaining missing tests.

* Enforce 100% test coverage.

* Start on groups test and refactor entityPublish to resolveEntity

* Remove joinPathStorage, not used anymore as group information is stored into zigbee-herdsman database.

* Fix linting issues.

* Improve tests.

* Add groups.

* fix group membership.

* Group: log names.

* Convert MQTT message to string by default.

* Fix group name.

* Updates.

* Revert configuration.yaml.

* Add new line.

* Fixes.

* Updates.

* Fix tests.

* Ignore soft reset extension.
2019-09-09 19:48:09 +02:00
Koen Kanters
eb69ea6808 Fix lint 2019-09-09 19:04:07 +02:00
clockbrain
3ae2d2b946 Network map routes selectable by mqtt topic (#1736) 2019-07-15 20:02:56 +02:00
clockbrain
97f9f83181 Use penwidth instead of dotted/dashed lines (#1694) 2019-07-06 10:09:44 +02:00
clockbrain
7a19c8876a Network map fixes (#1676)
* Include scan failed note in network map

* Include relationship in map structure

* Clearer source and destination node naming

* eslint fixes

* More eslint fixes

* Removed empty brackets for no routes

* Reposition short address in device node

* eslint fixes
2019-07-01 16:10:50 +02:00
Andreas Brett
7cabe3a523 colors for network map (#1666)
* Update settings.js

added default color options for network map

* Update networkMap.js

- add timestamp node to indicate when the map was created
- colorize nodes by device type
- colorize edges by activity

* Update networkMap.js

make travis happy

* Update networkMap.js

* Update networkMap.js

* Update settings.js

* Refactor

* Move to graphviz.
2019-06-26 19:30:38 +02:00
clockbrain
38a1aec823 Network map styling improvements (#1653)
* Weight and style lines based on routes

* Refactor to make End Device case more obvious
2019-06-23 21:22:13 +02:00
clockbrain
b28da0265e Include last seen in device boxes on graphviz map (#1633)
* Include last seen in device boxes on graphviz map

* Refactor

* Fix test cases

* Bind

* Refactor last seen label construction

* style fix
2019-06-17 21:28:27 +02:00
clockbrain
3981c1c6e4 Include network routes on the map (#1641)
* Initial inclusion of routes on map

* Forgot to include zigbee.js

* Hex string for route address

* Rebaseline to dev

* Cleaner merging of scan arrays

* style fixes
2019-06-16 13:49:15 +02:00
pali
1f63a32170 [graphviz] show network address in hexastring format (#1638)
* [graphviz] show network address in hexastring format

Wireshark shows network address in hexadecimal format, so it's easier to follow messages in Wireshark if both shows address in same format.

* Update networkMap.js

* Update networkMap.js
2019-06-15 17:04:35 +02:00
Koen Kanters
fb12d15d9d Fix lint error. 2019-06-09 23:46:19 +02:00
clockbrain
b663e37fd9 Also match network map link by short address (#1611) 2019-06-09 08:16:38 +02:00
Koen Kanters
8ad6aee43a Identify QBKG04LM and QBKG03LM as end device. https://github.com/Koenkk/zigbee2mqtt/issues/1594 2019-06-04 19:23:58 +02:00
Koen Kanters
c9c599b60b Refactor publishDeviceState to publishEntityState (for future group support). 2019-02-04 18:36:49 +01:00
clockbrain
5970e498f3 Add styling to graphviz devices and links (#894)
* Add styling to graphviz devices and links

* Fix eslint error and gvrender_set_style warning
2019-01-22 20:07:38 +01:00
Koen Kanters
5f6b37bf83 Support mesh networks in grapvhiz networkmap. https://github.com/Koenkk/zigbee2mqtt/issues/652 2019-01-18 22:11:01 +01:00
Koenkk
6df4e39f18 Refactor! 2018-12-06 21:27:36 +01:00
Koenkk
ddb83cc6e4 Handle zigbee commands sequentially (and refactor it). #529 2018-10-23 20:39:48 +02:00
Laurent
0322354c37 [RFC] graphviz network map, display all devices (#443)
* network map, more info

* add a get(All)Devices method to zigbee

* graphviz: display all devices

loop through all devices, display all devices even those that haven't
responded to the lqi scan.

* makes eslint happy :)

* remove null chars from network map graphviz output

makes graphviz happy :-)

* Improvements to graphviz network map

* Always add device type
2018-10-07 21:46:54 +02:00
Koenkk
4180bd8933 Add friendly_name to graphviz network map. #252 2018-09-29 23:05:18 +02:00
Koenkk
b2a27dd64a Implement basic graphviz networkmap. #252 2018-08-28 22:07:57 +02:00
Koenkk
2a520b0e81 Raw implementation of network map. #252 2018-08-28 21:55:00 +02:00