UMIS SDK
    Preparing search index...

    Function startShellyEmulator

    • Starts an emulator of a Shelly Gen3 relay with one switch (id 0) that only opens for a signed command. It answers JSON-RPC at POST /rpc (Switch.Set, Switch.GetStatus, Shelly.GetDeviceInfo) and serves a status page at GET /.

      Switch.Set needs an X-Umis-Command header whose signature comes from a trusted key and covers the exact body (checked with verifyRelayCommand); a command works once. The output is derived from the clock, never from timers: it is on while now is before the instant the flip-back timer ends. With digestPasswordEnv the call needs Shelly digest authentication as well (user admin, SHA-256). Switch.GetStatus and Shelly.GetDeviceInfo need neither, so that the status page can poll without credentials; they change nothing. Browser pages can call the emulator from the origins in cors only.

      Parameters

      Returns Promise<RelayEmulator>