-
Notifications
You must be signed in to change notification settings - Fork 3
5. VeraHuesBridge project
The VeraHuesBrdige library contains two core components: SSDPService and a Webserver. This is the heart of the system (the other projects either consume this project directly, or indirectly via RESTful service calls). The main components of this project are described here.
SSDPService: This routine will attempt to listen on the Multicast UDP Ip and Ports provided to it in the configuration. Simple Service Discovery Protocol (SSDP) allows the Amazon echo to discover the NanoHuesBridge, and with some magic, allows the service to poses as a Philips Hues device. This service does a couple of things:
-
It listens on an IP address of the machine
-
It examines UDP broadcasts
-
If a UDP broadcast contains the SSDP discovery phrases, it will respond with a location of an XML file. Echo will use that XML file to learn how to talk to the software.
Webserver: This is a Microsoft self-hosted module that does a mix of RESTful services and handles the SSDP XML file requests. It provides routes to 4 main areas (and 1 catch-all HttpRoute):
-
SetupApi - This handles SSDP requests for the XML file describing its service capabilities.
-
DevicesApi - This handles RESTful calls to manage the devices (Add, Remove, Modify and List).
-
HueApi - This performs a single function of returning a deviceResponse object to the Echo upon request.
-
LightsApi - This provides RESTful service to get a list of lights or the state of a single light for the Echo, as well as turn on/off lights via an update function.
-
DefaultApi - Currently this a catch-all HttpRoute. It does not implement any specific controller.