Websockets Support

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?

It looks like the recently added official bose driver uses the lustre library

1 Like

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.

Yes, this is good to know, so thanks for posting!

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… :face_with_diagonal_mouth:

1 Like

Hi, @lmullineux

@Automated_House shared a good example of Lustre. I will be able to share more examples and documentaion tomorrow.

1 Like

Hi @andresg

It would be great to see more examples and documentation. Thanks for the support

Louis

Hi, guys.

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.

1 Like

Doesn’t the current Sonos LAN integration use web sockets? If so, I assume the Edge Driver would need to also.

Hi, @Automated_House

That is true, but we are not allowed to make that repo public yet.

Is a WebSocket driver for Sonos in the works? I’ve seen a community-based LAN driver, but nothing that will properly replace the existing WebSocket DTH.

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.

Thank you

Thanks, I ended up using that Bose driver as a reference for my implementation, all working much better with the lustre library