bwssytems / ha-bridge

Home automation bridge that emulates a Philips Hue light system and can control other systems such as a Vera, Harmony Hub, Nest, MiLight bulbs or any other system that has an http/https/tcp/udp interface. This is a compact impl to run on small format computers. This is impl started from this project https://github.com/armzilla/amazon-echo-ha-bridge.
Apache License 2.0
1.45k stars 198 forks source link

Please describe more of the Alexa-Hue protocol #750

Closed dburner closed 6 years ago

dburner commented 6 years ago

Hello, First thank you all for the work so far. I'm interested in the Alexa <---> Philips Hue protocol. I notice some things are described in the bottom of the Readme file but most of them are responses. Can you please make a wiki page and describe the requests incoming from Alexa (maybe with actual examples). I'm especially interested in the DIM requests and responses (looking at the code there seem to be quite some variations).

Also as a reference these protocol notes from this repo seem to be a good reference.

Thank you.

FloFoer commented 6 years ago

What exactly do you mean by Alexa <---> Philips Hue protocol?
Do you mean the Philips Hue API (sending manual commands to the bridge) or the UPNP emulation behind the scenes for ha-bridge to be discovered as a hue bridge? Since you talk about DIM requests i think you mean the API. The Hue API is already described in detail by Philips themselves. Here: https://www.developers.meethue.com/documentation/getting-started The getting started and core concepts section is freely available and the detailed API documentation is also available after you create a Hue developer account and log in.

dburner commented 6 years ago

The UPNP emulation behind the scenes and what ha-bridge receives from Alexa when someone says "Alexa turn on device" and "Alexa, dim Device Name to Position" and also what it responds with. If this is described in the Philips hue api I'm sorry close this issue.

FloFoer commented 6 years ago

Alexa simply sends calls to the Philips Hue API (http) for the turn on/off/dim part. This API is also used for listing of lights and their status. These requests and also the bridge respones are described in detail in the Hue API documentation.
The whole UPNP part however is not described there (at least not that i know of), but unless you are planning on building your own emulator you are not going to need this kind of information.
Knowledge of the Philips Hue API is of more practical use i think.
Looking at DEBUG log activity the UPNP stuff gets only/mostly used during alexas device discovery phase and not in everyday use.

dburner commented 6 years ago

Well yes I do need that info to build my own emulator. I want to make a simple script for my Raspberry PI to control my AC. If you could do that I would verry much apreciate it, I could start a wiki page right here if that would be helpfull.

FloFoer commented 6 years ago

I've never had anything to do with the UPNP emulation part so i don't really know what's going on there. Would be a job for the project owner @bwssytems
Are you doing this for educational reasons or why are you not simply using ha-bridge for this? I don't think that building your own emulator will be close to a "simple script".

dburner commented 6 years ago

Well a couple of reasons:

Thanks

audiofreak9 commented 6 years ago

@dburner it may be easier to code your own Alexa skill to control your AC unit. I've made multiple skills and it's really easy. One skill returns the temperature of my pool or hot tub monitored by a raspberry pi. Another returns the status of any device in my ha-bridge. Others control homebrew projects.

dburner commented 6 years ago

@audiofreak9 I've seen skills and I've considered them, I like this aproach better since you don't have to say "Alexa, tell SKILL_NAME to dim the AC to etc", just saying "Alexa dim the AC to etc" seems more natural.

RicardoMonteiroSimoes commented 6 years ago

Im also interested in this. I have a graphical Logic editor in Java, and I'd like to implement a Block that could be configured and then pushed to Alexa/Home for quick prototyping. I've taken a look at the Hue API, but havent really seen much.

bwssytems commented 6 years ago

Well folks, there is a lot of info on this site to help you understand how this works. Start by looking at the wiki as it has a description on how this works.

Also, this is an open source project and you can add to it or fork it off to do what you want with.

dburner commented 6 years ago

Ok, Il try to investigate and make a wiki post about this, thank you :)