openhab / openhab-addons

Add-ons for openHAB
https://www.openhab.org/
Eclipse Public License 2.0
1.89k stars 3.59k forks source link

[freeboxos] Websocket failing immediately #17098

Closed lolodomo closed 3 months ago

lolodomo commented 3 months ago

I added few logs to see what happens:

14:01:26.851 [INFO ] [os.internal.api.rest.WebSocketManager] - Connecting Websocket uri wss://mafreebox.freebox.fr:443/api/v10/ws/event
14:01:26.921 [INFO ] [os.internal.api.rest.WebSocketManager] - Websocket connection establisehd
14:01:26.929 [INFO ] [os.internal.api.rest.WebSocketManager] - onWebSocketText message {"action":"register","msg":"unsupported event vm_state_changed","success":false,"error_code":"inval"}
14:01:26.937 [INFO ] [os.internal.api.rest.WebSocketManager] - Socket Closed: [1000] - reason null

Probably because my server does not support VM. I can see that VM_CHANGED is registered here: https://github.com/openhab/openhab-addons/blob/main/bundles/org.openhab.binding.freeboxos/src/main/java/org/openhab/binding/freeboxos/internal/api/rest/WebSocketManager.java#L62

lolodomo commented 3 months ago

Works if I remove VM_CHANGED. What would be the proper way to detect if VM is supported or not ?

lolodomo commented 3 months ago

I will retry registering without VM_CHANGED in case the first registering fails