Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose device configuration after hass is online #21500

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)).

<br>

## Architecture
Expand Down
13 changes: 13 additions & 0 deletions lib/extension/homeassistant.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1684,6 +1684,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');
}
Expand Down
Loading