diff --git a/lib/extension/groups.ts b/lib/extension/groups.ts index d3c88644cc..fab9e48ced 100644 --- a/lib/extension/groups.ts +++ b/lib/extension/groups.ts @@ -167,10 +167,11 @@ export default class Groups extends Extension { if (this.state.exists(device)) { const state = this.state.get(device); const endpointNames = device.isDevice() && device.getEndpointNames(); - const stateKey = device.definition.meta && + const stateKey = endpointNames && endpointNames.length >= member.ID && + device.definition.meta && device.definition.meta.multiEndpoint && - (!device.definition.meta.multiEndpointSkip || !device.definition.meta.multiEndpointSkip.includes('state')) && - endpointNames && endpointNames.length >= member.ID ? `state_${endpointNames[member.ID - 1]}` : 'state'; + (!device.definition.meta.multiEndpointSkip || !device.definition.meta.multiEndpointSkip.includes('state')) ? + `state_${endpointNames[member.ID - 1]}` : 'state'; if (state[stateKey] === 'ON' || state[stateKey] === 'OPEN') { return false;