I’m the author of a popular driver for Logitech harmony integration that uses websockets to connecting to a harmony hub. The implementation is based upon lua-websockets but I keep running into issues with users who have multiple hubs, I suspect that is to do with the way lua-websockets works.
I have noticed since I originally wrote the driver that lustre websocket library has been added to the ST lualibs.
I’m now considering whether it is worth refactoring to use the lustre library, or creating a V2 of my driver and whether using this would address some of the issues faced.
Is there any documentation showing how to utilise the library from an edge driver, how it integrates, or any example websocket drivers that use lustre?
Thanks @Automated_House , That’s really interesting and I hadn’t already seen that.
By the look of that driver, the developer has bundled lustre into the driver, rather than rely on the version shipped in the hub firmware.
I suspect for the same reason I have been unable to get the shipped version working at all, the shipped version has references to a base64 library that is not in the bundled libraries. it references base64 lib, when it should reference st.base64.
The version shipped with the driver seems to fix this.
Although I wonder how they are going to have a functioning Bose driver that uses mediaPlayback capability: it hasn’t ever completely worked. It used to be the FF button didn’t work, now that seems to be fixed, but now the play/pause button doesn’t work … at least on iOS…
I’m back. Unfortunatelly this is everything I could get: GitHub - cosock/lustre: Websockets for cosock. The bose driver uses an older version of Lustre and I was not able to get any other up-to-date example. There may be examples out in the community but as far as first party drivers, there just aren’t a lot of partner products we need to integrate with that use WebSockets between the devices and the SmartThings Hub.
The big difference is that the version in bose uses callbacks, but the more up-to-date version of Lustre is part of the cosock ecosystem, which uses coroutines and message passing instead of callbacks.
Just finally remembering to reply here to thank you, I ended up updating my driver to use lustre using the Bose driver as a reference implementation. All is working fine and seems much more stable than the library I was using previously.