Testing socket, telnet and websocket interfaces

Hello all,

I'm in the process of reviewing socket, telnet and websocket implementations used by drivers and apps. Before someone asks, there are/will be no changes to the APIs interfaces.

We need some pointers to apps or drivers that use these interfaces and do not require a physical device. We got JUnit tests (of course!), but I'd also like to see real world usage patterns and incorporate it into automated testing as much as possible. I've been looking through GitHub for usages, but likely have missed a bunch.

Please let me know, and thank you in advance!

2 Likes

telnet

  • intesis driver (needs login)

web socket

  • echo speaks (needs login)
  • older nest manager (needs old style working google login)
  • weather flow light (needs login)

Also an option, deprecated by some, in Node-RED nodes for hubitat

Here's my app/driver that uses Telnet...

HubConnect, of course. :smiley:

Any of my MagicHome/EcoPlugs/Lightify drivers use Telnet/Socket. NetCat has been my go-to for virtually testing these, but a simple response server could also do the trick. As long as there is a response, the drivers stay alive.

Let me know if I can do anything to help. I’d love to see these interfaces smoothed out.

Don't forget Envisalink

I use Raw Socket (in beta) in the Kasa Plug, Bulb, and Switch drivers (as well as UDP). Some of the interesting items I have included is:
Concatenation of multi-message replies,
Working without socket status messages from client (it does not generate these),
Error handling (to assure delivery of commands to client).

Link: [RELEASE] TP-Link/Kasa Plug, Switch, and Bulb integration

PS: One thing I am interested in is the Hubitat resource utilization of UDP vs Raw Socket for my system. I can do both; however, Chose raw socket because of user desire for quick polling. But I can create a hybrid with minimal code impact.

I know this is an old thread. Is there a way of opening an encrypted socket using rawSocket? The endpoint I'm connecting to (currently using openssl in node-red) is not an http, mqtt or websocket endpoint, all of which support ssl/tls connections.

Seems odd that rawSocket doesn't support that. Am I missing something or perhaps it's not documented?

would be nice but dont think it is implemented.

It's not implemented at the moment. Which device/functionality do you have in mind?

There is an undocumented interface into my alarm panel, a QolSys IQ2+. I can access it by running

openssl s_client -host 10.0.0.199 -port 12345

It is a bi-directional interface that periodically reports the state of all alarm sensors and allows the alarm to be armed and disarmed. At the moment, I have to have a node-red flow connect to the alarm panel using a daemon node that runs openssl, then massage and push the data to a mqtt broker (an Aedes node in Node-Red). then have a HE device connect to the broker.

It works but it's really cumbersome and adds several failure points to the whole thing. Would be so much simpler and self-contained if I could just open the connection to the alarm panel directly in HE,

Seems to me that you already have the whole ssl/tls thing implemented as we can open https and wss connections in HE. Wouldn't an encrypted raw socket mostly be a subset of already existing functionality? In my case, the ability to ignore cert errors is a must, as the cert in the alarm panel is self-signed. But you already have that option in https and wss as well.

I intend to publish my driver sooner or later, but the whole openssl/node-red thing complicates it.

Thanks.

I need SSL or tls to be able to allow my sendmail to basically work with any server.

Feature request noted. The usual "no promises" policy applies.

2 Likes

Download the Hubitat app