I am trying to create a Smart Home device controlled by Google Assistant using a Raspberry Pi. I am using a service called IFTTT to handle the Google Assistant part and my idea for getting that event onto my Raspberry Pi is to use a Backendless service. IFTTT will POST a request regarding the event to my Backendless server and the my idea is that the Pi will either:
- Poll the Pub/Sub system
- Register for push notifications
- Register a listener on a live-data object.
As this project is going to be battery powered and my connection will be long lived (permanent if all goes well) and from some research it would seem that WebSockets are the most efficient type of connection (over Long/Short Polling) as well as offering benefits in better latency. From what I understand the Live-Data API offered by Backendless SDK makes use of WebSockets to keep objects up-to-date.
Due to the nature of Raspberry Pi my solution is going to be written using Python and I can’t find a Backendless python implementation (not a problem, REST to the rescue); but I also can’t find anything about how to connect to a Live-Data object using the REST API.
Any advice on how to achieve a WebSocket connection into a live-data object without using an SDK would be much appreciated. Or; if WebSockets are a bad idea in the first place, I am also happy to take suggestions on alternative approaches to receiving events from Backendless.