Reputation: 817
I am trying to integrate smart home devices with Google home and Alexa but I am facing following issue.
How do I keep track of synchronous request-response? Is there a better way to implement this system?
Upvotes: 0
Views: 392
Reputation: 1
The project gBridge (https://github.com/kservices/gBridge; https://about.gbridge.io) basically implements plain Google Assistant/ Alexa to MQTT bridging.
Regarding your questions, there are two points that help to implement these solutions:
Upvotes: 0
Reputation: 59801
Perfectly possibly to do with HTTP to MQTT and back again.
I've done it for both Alexa & Google Home for my Node-RED nodes.
You just need to keep track of on going requests and include a unique id in the request/response MQTT messages while also running a timer to handle no response from the device.
Upvotes: 1