Connecting to /zigbeeLogsocket websocket from a driver


I am considering writing a driver that's going to listen to /zigbeeLogsocket web socket (this is what Zeegbee Log is doing). Based on this information I can find out devices that have connectivity issues so I can troubleshoot them later.

The following code on python does it without any problem.

import asyncio
import websockets

async def hello():
    async with websockets.connect("ws://") as websocket:
        while True:
            print(await websocket.recv())

Here is the similar code for my driver that does pretty much the same, except if fails:

def refresh() {
    log.debug 'Refreshing data'

void webSocketConnect() {
    final String wsUrl = "ws://"
    log.debug "wsUrl: $wsUrl"
    try {
        log.debug "Connection has been established"
    catch (e) {
        log.debug "Initialize error: ${e.message} ${e}"
        log.error "WebSocket connect failed: ${e}"

void webSocketStatus(final String status) {
    log.debug "webSocketStatus: ${status}"


22:57:34.779 debug webSocketStatus: failure: Failed to connect to /
22:57:34.765 debug Connection has been established
22:57:34.763 debug wsUrl: ws://
22:57:34.746 debug Refreshing data

Please advise what the problem might be.

p.s. this is my second driver, I might be missing some obvious stuff.

1 Like

Can’t send and receive from the same TCP port.




Thank you!

1 Like

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.