Shelly gen 1 features missing from gen 2: CORS

  • I have got my first Shelly gen 2 device and was hoping to be able to control and configure it in the same way as I can my gen 1 devices. I use a webpage that searches for shelly devices and allows you to discover, link to and configure the devices.

    This is not possible with gen 2 devices though because as far as I can see the "Allow Cross-Origin Resource Sharing" option that is present on all gen 1 devices is omitted from gen 2 devices. This means that it is not possible to communicate with the device from a browser.

    Please tell me that I am wrong and that this pretty core http communication feature has not been forgotten about.

  • Cors is no longer needed as new Shelly Gen2 devices can be controlled via RPC/WebSockets instead. Using websockets is much more flexible because you can subscribe to device events and your browser gets instantly notified if something changes.

    For me this is a HUGE step forwards. CORS and such stuff is somewhat old school and outdated.


    I've added an example for the new Pro 4 PM here, hope that helps.

    Seven of Nine
    30. August 2021 um 20:25

    >100 Shellies, darunter so gut wie alles was der Hersteller produziert hat. ;)
    :!: ich beantworte grundsätzlich keine Fragen per persönlicher Nachricht:!:

  • Hi, im trying connect to my Shelly 2.5 via websocket, using websocket clients like extension to chrome (simpleWebSocketClient) or app to android (websocketTester) without any luck. I use url wss://192.168.22.183:80, the IP adress is correct, not sure about port. Is my url incorrect, or its necessary enable websocket in device, or something else i missing ?

    Thank you, Jan

    btw i love you all my life, 7 ;)

  • m trying connect to my Shelly 2.5 via websocket,

    sorry, this won't work. Shelly 2.5 is a Gen1 device (ESP8266) .

    Websockets is a Gen2-Device-Feature (Plus and Pro devcies): You'd need a Shelly Plus 2PM or Shelly Pro 2PM instead of the old Shelly 2.5.

    >100 Shellies, darunter so gut wie alles was der Hersteller produziert hat. ;)
    :!: ich beantworte grundsätzlich keine Fragen per persönlicher Nachricht:!: