Commit Graph

483 Commits

Author SHA1 Message Date
Koen Kanters
9c8323326d Greatly reduce amount of subscribed topics. #4948 2020-11-16 17:03:22 +01:00
William Sutton
1c3ad9da72
Log zigbee-herdsman version on startup (#4930)
* add getZigbeeHerdsmanVersion Function

Allow current zigbee-herdsman version to be exposed to controller for logging and to startup output.

* Update utils.test.js

Add tests for getZigbeeHerdsmanVersion() function

* Update utils.js

Added getZigbeeHerdsman to module exports

* Update utils.js

Fixed path because I'm dumb.

* Update utils.test.js

Apparently version numbers are important when they're different.

* Update zigbee.js

Added actual display of herdsman version output.

* Update utils.js

Remove git checking in getZigbeeHerdsmanVersion()

* Update utils.test.js

Remove commitHash from getZigbeeHerdsmanVersion test

* Update utils.js

Remove commitHash from getZigbeeHerdsmanVersion

* Update utils.js

* Update utils.test.js

* Update utils.js

Try removing less code this time.

* Update utils.test.js

* Update zigbee.js

* Update utils.js

* Update utils.js

* Update utils.test.js

* Update utils.js

* Update utils.test.js

* Update utils.js

* Update utils.js

* Update zigbee.js

* Update utils.js

Generalize getZigbeeHerdsmanVersion() to getDependVersion(), so any node_module dependency can be checked

* Update zigbee.js

* Update utils.test.js

* Update utils.js

* Update zigbee.js

* Update utils.test.js

* Update zigbee.js

* Update zigbee.js

* Update zigbee.js

* Update zigbee.js

* Update zigbee.js

* Update utils.js

* Update zigbee.js

* Update utils.test.js

* Update zigbee.js

Co-authored-by: Koen Kanters <koenkanters94@gmail.com>
2020-11-14 17:25:22 +01:00
Koen Kanters
b5436d4b93 Fix devices marked unavailable in Home Assistant after restart. https://github.com/Koenkk/zigbee2mqtt/issues/4912 2020-11-13 19:45:27 +01:00
Koen Kanters
cbf353e387 Fix linkquality N/A when refreshing frontend. https://github.com/Koenkk/zigbee2mqtt/issues/4942 2020-11-13 17:29:23 +01:00
Drzony
7305960d53
Display manufacturer name for unsupported devices (#4938)
* Display manufacturer name for unsupported devices

* fixup! Display manufacturer name for unsupported devices
2020-11-11 18:27:20 +01:00
Koen Kanters
f8943011d4 Fix unbind for default_bind_group (901) not working from frontend. https://github.com/Koenkk/zigbee2mqtt/issues/4901 2020-11-11 18:11:18 +01:00
github-actions[bot]
8c20fa5d83
Update zigbee-herdsman-converters to 12.0.233 (#4924)
* Update zigbee-herdsman-converters to 12.0.233

* Update publish.test.js

* Update publish.test.js

* Update publish.test.js

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Koen Kanters <koenkanters94@gmail.com>
2020-11-10 21:40:15 +01:00
github-actions[bot]
431c7f7327
Update zigbee-herdsman-converters to 12.0.232 (#4913)
* Update zigbee-herdsman-converters to 12.0.232

* Update homeassistant.test.js

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Koen Kanters <koenkanters94@gmail.com>
2020-11-09 17:46:02 +01:00
github-actions[bot]
b1f129c6e8
Update zigbee-herdsman-converters to 12.0.231 (#4905)
* Update zigbee-herdsman-converters to 12.0.231

* Update homeassistant.js

* Update bridge.test.js

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Koen Kanters <koenkanters94@gmail.com>
2020-11-08 14:45:56 +01:00
Koen Kanters
c27e66b618 Changes for exposes. 2020-11-04 22:33:00 +01:00
github-actions[bot]
e1b5a105dd
Update zigbee-herdsman-converters to 12.0.223 (#4820)
* Update zigbee-herdsman-converters to 12.0.223

* Update homeassistant.js

* Update bridge.test.js

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Koen Kanters <koenkanters94@gmail.com>
2020-10-30 23:39:26 +01:00
Koen Kanters
aac7cb1ff6 Fix brightness or state not read when reading state and brightness. https://github.com/Koenkk/zigbee2mqtt/issues/4803 2020-10-29 18:03:16 +01:00
Koen Kanters
9a53399a8c Changes for zigbee-herdsman-converters 12.0.221 2020-10-27 21:50:55 +01:00
Koen Kanters
b2049b449b Home Assistant discovery: use availability instead of availability_topic. https://github.com/Koenkk/zigbee2mqtt/issues/775 2020-10-27 21:49:44 +01:00
Koen Kanters
63044421fd Get linkquality from herdsman instead of mesage. https://github.com/Koenkk/zigbee2mqtt/issues/4758 2020-10-24 17:15:46 +02:00
github-actions[bot]
b13d18fa9a
Update zigbee-herdsman-converters to 12.0.219 (#4745)
* Update zigbee-herdsman-converters to 12.0.219

* Update homeassistant.js

* Update bridge.test.js

* Update package.json

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Koen Kanters <koenkanters94@gmail.com>
2020-10-24 14:35:21 +02:00
github-actions[bot]
d73aea8ede
Update zigbee-herdsman-converters to 12.0.215 (#4721)
* Update zigbee-herdsman-converters to 12.0.215

* Update homeassistant.js

* Update publish.js

* Update bridge.test.js

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Koen Kanters <koenkanters94@gmail.com>
2020-10-19 16:48:09 +02:00
Koen Kanters
5134f0b689 Fix 0x0000000000000000 in networkmap. 2020-10-19 16:38:53 +02:00
github-actions[bot]
09fbed6c75
Update zigbee-herdsman-converters to 12.0.214 (#4713)
* Update zigbee-herdsman-converters to 12.0.214

* Update bridge.test.js

* Update homeassistant.js

* Update homeassistant.js

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Koen Kanters <koenkanters94@gmail.com>
2020-10-18 21:51:32 +02:00
Marco Massarotto
e63a2ac7f6
Allow redefine autodiscovery type (#4647)
* allow to redefine entity type and id in homeassistant autodiscovery

* Update homeassistant.test.js

Co-authored-by: Koen Kanters <koenkanters94@gmail.com>
2020-10-13 20:33:48 +02:00
Koen Kanters
9098bb1e06 Add missing test 2020-10-11 15:12:07 +02:00
Koen Kanters
8202a10837 Permit joining on specific device. https://github.com/Koenkk/zigbee2mqtt/issues/3281 2020-10-11 15:05:21 +02:00
Koen Kanters
eecd15ebfa
Don't republish identical optimistic group states. #3461 (#4623)
* Don't republish identical optimistic state for groups. #3461

* Fixes
2020-10-09 23:29:34 +02:00
John Doe
da91158f94
rePublish device state on rename (#4620)
* Republish device state on rename

* Update bridge.js

* Update bridge.js

Co-authored-by: Koen Kanters <koenkanters94@gmail.com>
2020-10-09 22:59:10 +02:00
Koen Kanters
24d8e5f113 Expose linkquality sensor for all devices. https://github.com/Koenkk/zigbee-herdsman-converters/pull/1638 2020-10-09 21:57:54 +02:00
Koen Kanters
9d29bcc566 Fix switches/plugs not controllable in group. https://github.com/Koenkk/zigbee2mqtt/issues/4558 2020-10-09 21:40:33 +02:00
Koen Kanters
3a1f697d93 Don't log when including logger.js 2020-10-07 17:15:46 +02:00
Koen Kanters
8f40d18c0a Fix last seen unknown when opening frontend. #4266 2020-10-07 17:05:46 +02:00
Koen Kanters
5d1975d60c
Add optimistic option. https://github.com/Koenkk/zigbee2mqtt/issues/4524 (#4572) 2020-10-06 21:50:07 +02:00
Koen Kanters
a982acc1ca Fix tests after https://github.com/Koenkk/zigbee2mqtt/pull/4510 2020-10-06 21:42:05 +02:00
Koen Kanters
e90182642d Republish groups on device remove. https://github.com/nurikk/z2m-frontend/issues/31 2020-10-06 19:28:32 +02:00
Koen Kanters
a2a7cebd07 Fix tests 2020-10-05 17:43:57 +02:00
github-actions[bot]
57b5529cd1
Update zigbee-herdsman-converters to 12.0.198 (#4551)
* Update zigbee-herdsman-converters to 12.0.198

* Update homeassistant.js

* Update publish.test.js

* Update publish.test.js

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Koen Kanters <koenkanters94@gmail.com>
2020-10-04 00:32:43 +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
Koen Kanters
50226d2c84
Exposes for lights. #4466 (#4516)
* Add dumpHomeAssistantMapping

* Add exposes for lights. https://github.com/Koenkk/zigbee2mqtt/issues/4466

* Updates

* Updates
2020-10-01 18:33:59 +02:00
Koen Kanters
4bb3ddcff2 Make frontend non-experimental. https://github.com/Koenkk/zigbee2mqtt/issues/4266 2020-09-27 22:18:48 +02:00
Koen Kanters
49e621123a Fix Home Assistation device trigger not working after rename. #4452 2020-09-25 19:48:30 +02:00
Koen Kanters
e286a66cea Don't rediscover Home Assistant device_automation (triggers). #4452 2020-09-25 18:47:28 +02:00
Koen Kanters
48cf4728bb Clear outdated Home Assistant device_automation discoveries. #4452 2020-09-25 18:20:27 +02:00
Koen Kanters
d386da6366 Fixes for 4f6797c365 2020-09-25 17:44:24 +02:00
Koen Kanters
da2eb505fd Clear availability topic on device remove. #4432 2020-09-25 16:50:12 +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
b79fb2b6f5 Don't try to setup reporting for Philips devices that do not support it. https://github.com/Koenkk/zigbee-herdsman/issues/110 2020-09-22 17:42:03 +02:00
Koen Kanters
92ce133e24 Enable scenes tests. https://github.com/Koenkk/zigbee-herdsman-converters/pull/1531 2020-09-20 18:17:36 +02:00
Koen Kanters
206f02b200 Updates for scenes. https://github.com/Koenkk/zigbee-herdsman-converters/pull/1531 2020-09-19 11:07:54 +02:00
Koen Kanters
7fe3167e97 Fix crash when saving state.json fails. #4388 2020-09-19 10:59:12 +02:00
Koen Kanters
4f9c36ee44 Don't allow renaming to not allowed friendlyName. https://github.com/Koenkk/zigbee2mqtt/issues/3281 2020-09-19 10:57:39 +02:00
Koen Kanters
8db16cca3d Republish devices on OTA update. https://github.com/Koenkk/zigbee2mqtt/issues/4266 2020-09-15 22:13:30 +02:00
John Doe
2caaaa8d24
Fix mallformed (nullish) messages handling (#4347)
Co-authored-by: Koen Kanters <koenkanters94@gmail.com>
2020-09-13 15:38:10 +02:00
John Doe
9cabe1e23a
Fix frontend api messages pollution (#4326) 2020-09-10 20:54:03 +08:00
Koen Kanters
c29cc784ba Touchlink identify. https://github.com/Koenkk/zigbee2mqtt/issues/3281 2020-09-09 18:24:32 +02:00
Koen Kanters
14da75f4a7 Touchlink factory reset specific device and scan. https://github.com/Koenkk/zigbee2mqtt/issues/3281 2020-09-08 20:24:49 +02:00
Koen Kanters
7b226e6efe Clear retained messages on device/group rename or delete. #4290 2020-09-07 17:29:53 +02:00
github-actions[bot]
7103ba4219
Update zigbee-herdsman-converters to 12.0.181 (#4275)
* Update zigbee-herdsman-converters to 12.0.181

* Update group.test.js

* Update publish.test.js

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Koen Kanters <koenkanters94@gmail.com>
2020-09-05 23:34:49 +02:00
Koen Kanters
778665b35b Don't rename entity ID in Home Assistant by default. #4095 2020-09-04 21:13:40 +02:00
Koen Kanters
ba7a85bbb5
Frontend (#4232)
* Initial implementation of backend for frontend.

* Frontend fixes (#4205)

* Send data to frontend api withoud baseTopic preffix

* Send frontend api requests to mqtt

* Fix topic name sanitisation

* Fix base_topic trimming

* Update frontend.js

* Add zigbee2mqtt-frontend dependency

Co-authored-by: Koen Kanters <koenkanters94@gmail.com>

* Dont' setup separate MQTT connection.

* Correctly stop

* Add frontend tests.

* [WIP] Bindings structure change (#4233)

* Change bindings location

* Bump frontend version

* Republish devices on bindings change

* Fix data structure

* Fix  payload double encoding

* Change endpoints structure

* Expose config to bridge/info

* Fix typo

* Updates

Co-authored-by: Koen Kanters <koenkanters94@gmail.com>

* Resend states on ws reconnect

* Update deps

* Bump frontend (#4264)

Co-authored-by: John Doe <nurikk@users.noreply.github.com>
2020-09-04 18:42:24 +02:00
Koen Kanters
f57ec9f0fd Add definition to raw networkmap 2020-09-02 17:17:35 +02:00
Koen Kanters
27566dc5d1 Add coordinator, endpoint binds/supported clusters to bridge/devices. https://github.com/Koenkk/zigbee2mqtt/issues/3281 2020-08-31 18:48:04 +02:00
Koen Kanters
ad0f11cc0f Base supported groups converters of its members. https://github.com/Koenkk/zigbee2mqtt/issues/764 2020-08-30 11:30:38 +02:00
github-actions[bot]
db6d9bd5bb
Update zigbee-herdsman-converters to 12.0.172 (#4180)
* Update zigbee-herdsman-converters to 12.0.172

* Update homeassistant.js

* Update zigbeeHerdsman.js

* Update publish.test.js

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Koen Kanters <koenkanters94@gmail.com>
2020-08-25 20:01:46 +02:00
Koen Kanters
d980b97413 Fix Home Assistant automations based on click event not working. #4168 2020-08-23 22:58:07 +02:00
mgrom
54f164cc21
fixes related to #4070 (#4132)
* fix

* eslint fix

* don't use temp topic when low and high temp used

* fix for temp high

* Add tests

Co-authored-by: Koen Kanters <koenkanters94@gmail.com>
2020-08-23 22:36:30 +02:00
Koen Kanters
676684158a
Fix messages from Xiaomi devices skipped sometimes when send through Xiaomi router. #3592 (#4170)
* Update receive.js

* Fix messages from Xiaomi devices skipped sometimes when send through Xiaomi router. https://github.com/Koenkk/zigbee2mqtt/issues/3592
2020-08-23 22:05:48 +02:00
github-actions[bot]
bffe4db029
Update zigbee-herdsman-converters to 12.0.167 (#4144)
* Update zigbee-herdsman-converters to 12.0.167

* Update homeassistant.js

* Update publish.test.js

* Update publish.test.js

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Koen Kanters <koenkanters94@gmail.com>
2020-08-20 22:03:00 +02:00
Koen Kanters
22f657ed4d Add device_announce event to new api. https://github.com/Koenkk/zigbee2mqtt/issues/3281 2020-08-20 20:55:40 +02:00
Koen Kanters
8c5fae900e Don't use state converter on invalid JSON and the payload is not on, off or toggle. https://github.com/Koenkk/zigbee2mqtt/issues/1348 2020-08-17 21:29:11 +02:00
Koen Kanters
9148977b39 Rename device entity_id in Home Assistant when changing friendly_name. #4096 2020-08-17 20:19:44 +02:00
Koen Kanters
5f75c9c9f8 Clear outdated Home Assistant configs 2020-08-17 17:24:57 +02:00
Tom
08524953bf
Add Environment Variable Override (#4085)
* Add Environment Variable Override

I need to be able to manage settings on this service via Environment Variables.   I've added the ability to override anything in the settings schema with a corresponding environment variable.  

e.g. to override settings.serial.port you can set ZIGBEE2MQTT_SERIAL_PORT=/dev/ttyS0
to override the mqtt username you can set ZIGBEE2MQTT_MQTT_USER=testusername

This new addition will not perform any action on existing installations unless the matching environment variable is set.  I have tested this setting string, number, boolean, object and array values.

* Adding test case for environment variables and slight modification to ensure 100% code coverage.

* Adding a test to confirm that env variables will set non default values.  Also realized that I was errantly applying the env variables to the defaults for testing.  Understanding what this is doing more clearly I realize that should be clean.

* Refactoring to

1. Remove the test variables from the schema and defaults and manually reflect the tests in the test.

2. Rename environment variable base from ZIGBEE2MQTT_ to ZIGBEE2MQTT_CONFIG_

* Small improvements

* Removing the unneeded test.

Co-authored-by: Koen Kanters <koenkanters94@gmail.com>
2020-08-13 23:50:30 +02:00
Koen Kanters
9774031169 Sort logged and published JSON objects alphabetically. #4091 2020-08-13 20:00:35 +02:00
Koen Kanters
81db31b784 Fix attribute output not publishing all values. https://github.com/Koenkk/zigbee2mqtt/issues/4054 2020-08-08 16:36:58 +02:00
Koen Kanters
ff2fe2b358 Separate Home Assisant name by space instead of _ when friendlyName contains space. #4048 2020-08-08 13:54:39 +02:00
Koen Kanters
3cdf7604a0 Fix no color_temp for group on changing color_xy and vice versa. #4034 2020-08-05 21:54:39 +02:00
Koen Kanters
6345cb07bf Disable reporting on device when reporting is disabled. https://github.com/Koenkk/zigbee2mqtt/issues/3826 2020-08-04 19:11:13 +02:00
Koen Kanters
852bca5a08 Implement update state for new api. https://github.com/Koenkk/zigbee2mqtt/issues/3634 https://github.com/Koenkk/zigbee2mqtt/issues/3281 2020-08-02 23:09:43 +02:00
Koen Kanters
3e071a73df Invert cover tests. https://github.com/Koenkk/zigbee-herdsman-converters/issues/1447 2020-08-02 10:08:55 +02:00
Koen Kanters
9a6397fe75 Make Zigbee2MQTT naming consistent 2020-08-01 10:36:20 +02:00
lionel590
ded3a58883
Network parameters / config displayed in zigbee2mqtt/bridge/config (#4010)
* Update zigbee.js

* added network parameters to zigbee2mqtt/bridge/config

* added network parameters to zigbee2mqtt/bridge/config

* added test for network config in zigbee2mqtt/bridge/config

* Fix network data

* Added test data for network parameters

* Update zigbee.js

* Update zigbee.js

* Update bridge.test.js

* Update bridge.test.js

* Update utils.js

* Update bridge.js

Co-authored-by: Koen Kanters <koenkanters94@gmail.com>
2020-07-30 22:31:52 +02:00
Koen Kanters
274109bc85
Allow to disable Home Assistant via MQTT. #3281 (#4007)
* Initial

* Updates
2020-07-29 23:10:03 +02:00
Koen Kanters
a7f990ef95 New api: log to MQTT. https://github.com/Koenkk/zigbee2mqtt/issues/3281 2020-07-28 22:12:22 +02:00
Koen Kanters
946ebe16b6 Allow to specify which clusters are being bound/unbound. https://github.com/Koenkk/zigbee2mqtt/issues/3281 2020-07-28 21:05:02 +02:00
Koen Kanters
b9ba635bea Fix crash when attribute value is undefined of null (publish empty payload in this case). #3980 2020-07-27 22:07:03 +02:00
Koen Kanters
7d27e6db69 Changes for zigbee-herdsman-converters 12.0.150 2020-07-26 14:19:33 +02:00
Koen Kanters
812c4927e7 Handle group setup failure. https://github.com/Koenkk/zigbee2mqtt/issues/3966 2020-07-26 10:11:58 +02:00
Koen Kanters
00f836fce6 Don't discover sensor_click when legacy: false is set. https://github.com/Koenkk/zigbee-herdsman-converters/issues/1393 2020-07-24 22:53:10 +02:00
Koen Kanters
ad13564687 Improve error messages when configuration is invalid. #3943 2020-07-23 19:17:26 +02:00
github-actions[bot]
a01048487d
Update zigbee-herdsman-converters to 12.0.148
* Update zigbee-herdsman-converters to 12.0.148

* Update publish.test.js

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Koen Kanters <koenkanters94@gmail.com>
2020-07-22 23:32:38 +02:00
Koen Kanters
28d48f3d96 Skip message when definition is undefined and still interviewing instead of modelID. https://github.com/Koenkk/zigbee2mqtt/issues/3947 2020-07-22 14:00:27 +02:00
Koen Kanters
db748a1333 Implement new api healthcheck. #3281 2020-07-21 21:16:52 +02:00
github-actions[bot]
ad0bbbec97
Update zigbee-herdsman-converters to 12.0.146
* Update zigbee-herdsman-converters to 12.0.146

* Update publish.test.js

* Update homeassistant.js

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Koen Kanters <koenkanters94@gmail.com>
2020-07-20 18:58:17 +02:00
Koen Kanters
1f39ff6f57 Fix transition from device_options not applied. #3922 2020-07-19 00:04:39 +02:00
Koen Kanters
a845d35b8e Update Birth & Will Topic for Home Assistant #3918 2020-07-16 23:16:59 +02:00
github-actions[bot]
570985b877
Update zigbee-herdsman-converters (#3917)
* Update zigbee-herdsman-converters to 12.0.140

* Update publish.test.js

* Update publish.test.js

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Koen Kanters <koenkanters94@gmail.com>
2020-07-16 22:59:30 +02:00
Koen Kanters
67f02adbd0 Prefer blocklist/passlist over blacklist/whitelist 2020-07-15 23:22:32 +02:00
Koen Kanters
ff1a64b192 Change ID -> id for new api. https://github.com/Koenkk/zigbee2mqtt/issues/3281 2020-07-15 22:16:18 +02:00
Koen Kanters
62b26ab4b9 Fix tests 2020-07-14 22:09:11 +02:00
Koen Kanters
8415adc514 Make new api snake case. https://github.com/Koenkk/zigbee2mqtt/issues/3281 2020-07-13 23:00:33 +02:00
Koen Kanters
57a2d435a9 Republish groups on change. https://github.com/Koenkk/zigbee2mqtt/issues/3281 2020-07-13 21:45:44 +02:00
Koen Kanters
ff8f16fedb Group MQTT api. https://github.com/Koenkk/zigbee2mqtt/issues/3281 2020-07-12 23:50:15 +02:00
Koen Kanters
d81f5575ff Bind for new api. https://github.com/Koenkk/zigbee2mqtt/issues/3281 2020-07-12 21:56:11 +02:00