* 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>
* Allow filtering of attributes in mqtt json payload or published attributes
* Add test for mqtt_attribute_filter
Just doing attribute_and_json should be fine as the code changes are run before this. Doing this tests lets us varify both json or seperate topic get properly filtered.
* Add test for mqtt_attribute_filter on group
* Rename mqtt_attribute_filter to filtered_attributes
* Iterate objects recursively and support array output
* Fix eslint errors
* Improve array handling and expand related test
* Improve tests and array support, add special case for color attributes
* Update controller.js
Do not use JSON.stringify when outputting Non-JSON to MQTT. When using JSON.stringify strings are quoted in the MQTT messages but they should not be quoted (MQTT is different from JSON).
* Update controller.js
* Update controller.js
* Update controller.js
* Add Discord channel. https://github.com/Koenkk/zigbee2mqtt.io/issues/31
* extend controller.js function getDeviceInfoForMqtt
extend controller.js with
``
zclVersion,
appVersion,
stackVersion,
hwVersion,
swBuildId,
``
* Rework #2
Only Publish hwVersion and swBuildId as this seems to be valid as posible.
Map with default option 'unknown' to be in a good way.
* Fix tests
* Update README.md
* Expand attribute output. #493
If attribute is actually an Object, expand it in the format `topic/key-subkey` in order to keep the same amount of topic levels for predictable parsing.
This only expands the first level of contained object. If more expansion are needed a more robust method should be implemented rather than just nesting `if`s.
* Fixing whitespace
fixing https://travis-ci.org/Koenkk/zigbee2mqtt/builds/507616980
* first time splitting line... obviously
Not sure what the proper approach is, but I guess we can put all params on new line.
* identation... really...
How is that `eslint`? any other requests?