Websocket use?

I know this is probably a dumb question, and I have tried to make sense by searching, but
what is websocket used for and what effect will my hub's performance have if I don't have websocket on?
i have one C7 hub, so not nearly as fancy a setup as most here, but I do have several rules and apps running locally.
I also send notifications to my phone.
Please be gentle! hehe

You must be talking about some specific app or driver, as there is no hub-wide "websocket" setting. Websocket is a communication protocol that some integrations can use. Often, it's an alternative to HTTP, and it might be more efficient since it's a single connection that allows back-and-forth communication indefinitely, rather than needing to send HTTP requests back and forth or use older, less efficient protocols that tried to accomplish a similar goal. So, if you have the option, it's probably better in general to leave it on, but if an option exists, it's likely there because sometimes you might run into compatibility issues where turning it off makes things better.

So, that's the general scoop. :slight_smile: For something specific, maybe you're talking about Hubitat Dashboard? That's a built-in app on Hubitat I can think of that uses Websockets if it can, because it provides a way to update the Dashboard in your browser (or mobile app) in real-time without needing to wait for the a periodic refresh over HTTP (which it should fall back to if WebSockets fail). If you're using a really old browser or yours likes to randomly disconnect for some reason, changing this setting might help.

But this is just a guess as to what you might be talking about. If you need more, I'd suggest sharing exactly where you see this setting. Hope this helps a bit!

2 Likes

If you were to open a websocket and listen, you’d see all of the hubs activity. With this data, you can incorporate actions/devices from other hubs - I.e. hub mesh.

There is no harm.

WOW! That was a VERY helpful explanation! Thank You!
Yes, I am using Echo Speaks and webcore can be enabled/disabled from within the app.
I just didn't know if HE needed it or used it, hub-wide and that is where I was getting confused as to it's use.
I also use the Hubitat Dashboard on my phone and car tablet, so I will check to make sure it is turned for those as well.
Thank You again!

So websocket would be used if I had several hubs and used the hub mesh.
I will have to remember that (hard when your old), for when I get another hub.
Thank You!

2 Likes

Hub Mesh handles all the communication details for you, though it has options for UDP (default) versus TCP (an option you can try if the former causes problems) as the transport protocol.

Again, there is no hub-wide "websocket on or off" setting, so anything you see with this phrasing is likely tied to a specific use and, as such, is found inside a specific app or driver. I'm not familiar with Echo Speaks (aside from knowing what it is), so I can't say what the setting does in that particular case.

1 Like

Enabling WebCore I would think only applies to those using WebCore instead of Rule Machine. I’m not sure what that has to do with websocket as I haven’t used WebCore on HE, but I’m thinking that it might mean giving WebCore info from the Alexa websocket used by Echo Speaks in this case.

I'm jumping into the deep end here. I do not know much about websockets or how to use them. But a websocket may address a need for me. Kodi is my music server. I'm using a webcore POST to retrieve song data when Kodi is playing a song. The problem here is to know when Kodi is actually playing a song so that I can do a POST. I do have a method to monitor Kodi to see if a song is playing, but that is not real time. Does a websocket continuously monitor a device state?