diff --git a/packages/nodes-base/nodes/PhilipsHue/PhilipsHue.node.ts b/packages/nodes-base/nodes/PhilipsHue/PhilipsHue.node.ts index cbd8321586..908790a5cf 100644 --- a/packages/nodes-base/nodes/PhilipsHue/PhilipsHue.node.ts +++ b/packages/nodes-base/nodes/PhilipsHue/PhilipsHue.node.ts @@ -77,9 +77,23 @@ export class PhilipsHue implements INodeType { 'GET', `/bridge/${user}/lights`, ); + + const groups = await philipsHueApiRequest.call( + this, + 'GET', + `/bridge/${user}/groups`, + ); + for (const light of Object.keys(lights)) { - const lightName = lights[light].name; + let lightName = lights[light].name; const lightId = light; + + for (const groupId of Object.keys(groups)) { + if(groups[groupId].type === 'Room' && groups[groupId].lights.includes(lightId)) { + lightName = `${groups[groupId].name}: ${lightName}`; + } + } + returnData.push({ name: lightName, value: lightId,