This is something I've always wanted to do but never had the skills and not even sure how feasible it is either.. but, I've got to start somewhere so figured I'd start with some basic questions.
I'd love to create a 'cloud' version of the current /eventstream API. More specifically, what's described in this thread: Access /eventstream from cloud? Or, alternative ways for hub to 'push' updates to a mobile device
I want a way for a mobile device to get 'push' device state updates when remote. MakerAPI only offers a webhook but that's not feasible for mobile devices. However, the internal /eventstream
is ideal as a client can connect when running and not have to poll to get device changes.
Of course /eventstream isn't available outside of the network.. thus, what I'm looking to do is write a Hubitat app/driver which can be reached from outside of your network..
-
Is it possible for a Hubitat app to create a websocket server? Are there any examples of this in existing apps/drivers anywhere? I know several apps (like Orbit) connect to existing websocket server connections (client-side)
-
Besides the websocket server, I'm also unsure how a mobile device can 'reach' this app externally. MakerAPI uses a cloud token but I assume that's only available to MakerAPI endpoints. Is OAUTH the answer? I know other apps are able to be reached from external services somehow.
Anyway, if anyone has thoughts or ideas please let me know! Maybe I'm in over my head too but can't hurt to do some digging