InkApplications / Shade

💡 Unofficial SDK for the Philips Hue API written for Kotlin Multiplatform.
https://shade.lighting
MIT License
65 stars 4 forks source link

How to get the MAC address of a light? #121

Closed rzarajczyk closed 11 months ago

rzarajczyk commented 1 year ago

According the the Hue docs (https://developers.meethue.com/develop/hue-api/lights-api/#get-attr-and-state) every light has a uniqueid property, which is (quotation from the docs):

Unique id of the device. The MAC address of the device with a unique endpoint id in the form: AA:BB:CC:DD:EE:FF:00:11-XX

Is there a way to retrieve this uniqueid using Shade? I couldn't find it in the Shade API

Note: the same should be possible for dimmer switches;

Thanks in advance!

ReneeVandervelde commented 11 months ago

This link is a reference to the V1 API, which is no longer supported by this SDK. The V2 API already uses unique IDs, which can be accessed via the id field on the Light object.

If this question is regarding an older version of this SDK that was using the v1 api (also versions 1.x of this library) then that field can be accessed through the uuid field. However, it's recommended you update the SDK to version 2 as soon as possible.

rzarajczyk commented 9 months ago

GitHub just reminded me about this topic (better late than never :-)) So basically after some digging I found out that the device has a reference to a zigbee_connectivity service, and there - in zigbee_connectivity - we can obtain the MAC address.

Thank you for your reply!

BTW. MAC address is unique for the device and even if you pair the device to the new bridge it will remain the same. That was the reason I needed it :-)