Commit Graph

25 Commits

Author SHA1 Message Date
Koen Kanters
e792f8bc8c Prevent sending Home Assistant discovery messages when not connected to MQTT yet. #3451 2020-04-30 19:06:17 +02:00
Koen Kanters
552eec7baa Isolate legacy MQTT log. #3281 2020-04-05 18:36:08 +02:00
Dustin Sallings
97a4b6b539
Add support for expiring retained messages. (#3082)
* Add support for expiring retained messages.

For most of my environmental monitoring use cases, I want the readings
retained so I can pick them up from clients at any time, but if the
sensor (or zigbee2mqtt) fails, I want the readings to go away so I can
tell the difference between a stale reading and a missing reading.

This is easily accomplished in MQTTv5 using the "message expiry
interval" property.  To add that to zigbee2mqtt, I added a 'version'
option to the mqtt section so I can specify to connect with version 5
and added a 'retention' property to devices allowing me to specify how
long items should be retained.

e.g.

    mqtt:
      base_topic: site/zigbee2mqtt
      server: 'mqtt://myserver'
      user: zigbee
      version: 5
    serial:
      port: /dev/ttyACM0
    devices:
      '0x00358d00022308da':
        friendly_name: someroom
        retain: true
        retention: 900

* Also get from deviceOptions

* Update settings.js

* Update controller.js

Co-authored-by: Koen Kanters <koenkanters94@gmail.com>
2020-03-12 20:25:37 +01:00
Twan Coenraad
dd0ca2a392 Add keepalive option for MQTT (#2767) 2020-01-17 21:38:46 +01: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
Andreas Brett
74b8340afb add TLS/SSL options for connecting to MQTT server (#1706)
* add TLS/SSL options for connecting to MQTT server

* Update mqtt.js

* gotta love travis

* Update mqtt.js

separated processing of mqtt.ca and mqtt.key/mqtt.cert in order to allow for "server-authentication only" as well as "server+client authentication"

* Update mqtt.js
2019-07-10 17:57:41 +02:00
qm3ster
a93838be15 codemod: object-shorthand
Also fixed `new (` and `formatter` by hand.
2019-03-09 16:30:05 +01:00
Koen Kanters
ec0ee53c7a Log zigbee publish errors to MQTT. #1123 2019-02-20 17:57:28 +01:00
Koenkk
6df4e39f18 Refactor! 2018-12-06 21:27:36 +01:00
Koenkk
2a520b0e81 Raw implementation of network map. #252 2018-08-28 21:55:00 +02:00
Koen Kanters
4ee7845b2a
Merge pull request #292 from carpenike/master
Added Self Signed CA Support
2018-08-17 18:41:36 +02:00
Koen Kanters
fb9600d55d
Change selfsigned to reject_unauthorized 2018-08-17 18:39:45 +02:00
Ryan Holt
c00f091d7f removed trailing whitespace 2018-08-17 12:25:02 -04:00
Ryan Holt
b0b2bd2444 adjusted whitespace to remove tabs and replace with spaces. 2018-08-17 12:22:27 -04:00
Ryan Holt
9ee0049248 adjusted to support self-signed certificates on mqtt 2018-08-17 12:15:44 -04:00
Koenkk
43260a3a83 Implement mqtt last will message. #267 2018-08-13 19:21:55 +02:00
Koenkk
2b7aeed4fb Add support for MQTT client ID. #148 2018-07-24 18:31:16 +02:00
Koenkk
7b2763a053 Log devices to bridge/log. #77 2018-05-30 18:09:24 +02:00
Koenkk
c5cb60e998 Enforce code style. #45 2018-05-17 17:20:46 +02:00
Koenkk
2521af7d78 Allow device specific QoS configuration. #47 2018-05-15 18:42:26 +02:00
Koen Kanters
a13080f399 Refactor & remove home assistant pair switch discovery. 2018-04-25 20:54:41 +02:00
Koen Kanters
500bce2418 Perform home assistant MQTT discovery on startup. 2018-04-23 18:17:47 +02:00
Koen Kanters
7cd8e74a7e Implement homeasisstant MQTT discovery. #9 2018-04-20 19:53:40 +02:00
Koen Kanters
3b317535d3 Fixes & improvements. #8 2018-04-18 20:53:22 +02:00
Koen Kanters
d06522d488 Refactor and rename. #8 2018-04-18 18:26:13 +02:00