diff --git a/README.md b/README.md index 69c835799c..19cee144a6 100644 --- a/README.md +++ b/README.md @@ -84,7 +84,7 @@ Zigbee2MQTT integrates well with (almost) every home automation solution because ### [IoBroker](https://www.iobroker.net/) - Integration implemented in IoBroker ([documentation](https://github.com/o0shojo0o/ioBroker.zigbee2mqtt)). - +
## Architecture diff --git a/lib/extension/homeassistant.ts b/lib/extension/homeassistant.ts index 557db87272..9c928dfe0e 100644 --- a/lib/extension/homeassistant.ts +++ b/lib/extension/homeassistant.ts @@ -1679,6 +1679,19 @@ export default class HomeAssistant extends Extension { const timer = setTimeout(async () => { // Publish all device states. for (const entity of [...this.zigbee.devices(false), ...this.zigbee.groups()]) { + + // Expose device configurations to homeassistant + // https://github.com/Koenkk/zigbee2mqtt/issues/18862 + this.discover(entity, true); + + if (entity.isDevice() && this.discoveredTriggers[entity.ieeeAddr]) { + for (const config of this.discoveredTriggers[entity.ieeeAddr]) { + const key = config.substring(0, config.indexOf('_')); + const value = config.substring(config.indexOf('_') + 1); + this.publishDeviceTriggerDiscover(entity, key, value, true); + } + } + if (this.state.exists(entity)) { this.publishEntityState(entity, this.state.get(entity), 'publishCached'); }