* Fix conflict between illuminance and illuminance_lux
On certain devices, e.g. GZCGQ01LM, 9290012607, 9290019758, TERNCY-PP01 etc, both
cfg.sensor_illuminance and cfg.sensor_illuminance_lux are applied. As both of these
had the same object_id, only one would show in Home Assistant. Oddly, a mix of both
would apply - e.g. I would get the illuminance value, with the illuminance_lux unit
of 'lx'.
* Add a test for duplicated type/object_id in HA discovery configs
* 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>
* Update HA Discovery Info on Rename
Update HA discovery info when a device is renamed. Adds a new deviceRenamed
event to the event bus, allowing the HA extension to react to the rename
Fixes#2440
* Handle Groups correctly wrt HA discovery data refresh
* Cleanup group handling
* Cleanup group handling
* 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