Hello,
I try to learn to use OpenHAB2 Rest API and Web Sockets.
I am able to get my sitemap throught the rest api with:
GET /rest/sitemaps/{name}
Now I want to estalish a connection with web sockets to get changes of items. I tried to do so with normal JavaScript WebSocket class:
var socket = new WebSocket('ws://{ip}:8080/rest/items/{itemName}');
But all I get is:
WebSocket connection to 'ws://{ip}:8080/rest/items/{itemName}' failed: Error during WebSocket handshake: Unexpected response code: 200
What is wrong with this?
Thank you!