I am trying to make my home automation hub to work with Alexa.Our architecture is as follows.We have many users who have a central hub in their home which is always connected to the cloud server.The hub is also connected to various smart switch nodes in each room. Each hub has a unique id.Each user has a unique username and password.Each hub is mapped to one user. A user can use his unique credentials to log in to a mobile app and control appliances remotely.
My request flow is as follows. A sample request to 'turn on' a device from the mobile app is handed to cloud server via API.The server identifies the user and forwards the request to the hub mapped with the requesting user. The hub handles the request and forwards it to the corresponding smart switch node.The smart switch node turns on the requested device and acknowledges the hub.Hub acknowledges the server that device has turned on.
From my little research, I found that Alexa smart home skill is apt for my case.But I couldn't find any tutorials that let my users login into my system from Alexa companion app and authenticate Alexa to make requests to my server on behalf of user's voice commands. Users voice command can be anything like 'turn off kitchen floorlight', 'what is my bedroom fan speed.?', 'turn on scene movietime' , 'is living room Air Conditoner on.?' , 'dim bedroom lights by 50%' etc.