question

newuser-b97b1119-1a09-453b-8d53-8125320abbb2 avatar image

How does Alexa find the IP adress of my Hue Bridge?

Hello, I am quite new to Alexa skill development and still in the process of understanding how it works in detail. As far as I know the data flow to control e.g. a hue lamp in my house is as following:

  1. The Echo sends my spoken words to the Alexa Cloud Service
  2. The Alexa Cloud Service analyses the words and sends an intent to the Hue Cloud Service.
  3. The Hue Cloud Service sends a request to my Hue Bridge at home.
  4. The Hue Bridge switches the lamp.

My question is, how does the Hue Cloud Service know the public IP address of my Hue Bridge to communicate? (This IP address changes at least every 24h.)

As far as I understand, it will not be able get the IP address from the request sent by the Echo. So is it up to the Hue Cloud Service to get it somehow? E.g. the Hue Bridge autonomously sends this information regularily to the Hue Cloud Service in advance? Or does it work completely different?

I want to know this as I would like to create a custom skill to control one of my custom devices.

Thanks in advance,

Peter

alexa smart homehow-to
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Brian@Amazon avatar image
Brian@Amazon answered

Broadly smarthome skills use oauth to connect to the third party service provider. I'm not sure specifically how this works for say a hue bridge but the 3p provider can communicate with their bridge which can then control lights. Ie Alexa --> smarthome adapter --> 3p smarthome service via oauth --> smarthome hub or device

10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

meep avatar image
meep answered

It likely negates the need to 'know' the target device IP by using a slim IoT protocol such as MQTT.

I use this with my skill to communicate with software on the users network without the need to open ports or know the iP address of the machine running the software.

10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Hotstepper13 avatar image
Hotstepper13 answered

The (at least) builtin Hue Skill does not invoke external command.

If you tell Alexa to find your devices, the Echo will send a UPNP Broadcast that will be answered by the bridge, telling the Echo the (internal) IP of it self. After that the Echo send a discovery request to the bridge directly to exchange information about the connected devices (lamps).

I have build a small server that uses exactly this approach on order to switch my KNX connected devices, that is the reason why I know how this works.

10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.