I already had the older Hub (2242-222) and decided to try out the new Hub (2245-222) for the integration with Harmony and to try out the new API. After messing around with it for a couple days and sniffing the traffic from the Windows app I thought I share some of what I found.
Insteon has stated that the new hub needs to be connected for it to work and this is mostly correct. If you link items like switches or remotes to responders, they will still work if the network is unplugged. However it looks like all the mobile apps rely on using the cloud service to send command and receive status updates.
The new Hub seems to basically work as a relay device. It looks like the Hub and the clients all connect to a couple Pubnub channels to receive and publish commands. There are two channels, one appears to be for the Hub itself and one is for the any commands/events.
When the Windows app connects it authenticates with the Insteon api getting all the info about the account and the devices that are setup. It also makes a call to request the authentication token and the channel names on Pubnub for the specific Hub ID.
The app uses the rest api to subscribe to the two channels get the event status. The events stream seems to show everything the hub does. I paired a mini remote buttons to 4 empty scenes and I was able to see the different insteon events for a single tap, double tap, long press, etc.
Each event in the stream is tagged with a message id which is the epoch timestamp along with a sequential id number. Looking at the history of the events, it only stores the last 100 events. Looking at the stream for the Hub I also saw the history of when upgraded the Hub and the PLM firmware along with the web addresses for the firmware files.
I’ve been playing around with the official API as well which does have an event stream endpoint but I was never able to get it to work properly. Tapping into the pubnub stream I’m hoping to make a smartapp to tie in the insteon devices and provide realtime status for the various devices. This method would depend on still having internet connectivity.
The old local HTTP api on the hub still works for sending commands and getting the bufferstatus so it is also possible to have local commands as backup if there is no network. The api though makes it much easier to discover all the devices and get a realtime status of devices.