myNOC.Remootio 1.0.2

dotnet add package myNOC.Remootio --version 1.0.2
                    
NuGet\Install-Package myNOC.Remootio -Version 1.0.2
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="myNOC.Remootio" Version="1.0.2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="myNOC.Remootio" Version="1.0.2" />
                    
Directory.Packages.props
<PackageReference Include="myNOC.Remootio" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add myNOC.Remootio --version 1.0.2
                    
#r "nuget: myNOC.Remootio, 1.0.2"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package myNOC.Remootio@1.0.2
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=myNOC.Remootio&version=1.0.2
                    
Install as a Cake Addin
#tool nuget:?package=myNOC.Remootio&version=1.0.2
                    
Install as a Cake Tool

myNOC.Remootio

Overview

A .NET client library for communicating with a Remootio smart gate and garage door controller via its WebSocket API.

This library ports the official remootio-api-client-node TypeScript implementation to C#, including the full AES-CBC + HMAC-SHA256 encryption protocol, the authentication challenge/response flow, and real-time state change events.

Designed to work in both ASP.NET Core server apps and Blazor WebAssembly SPAs (the browser's native WebSocket handles the device connection in WASM).

Installation and Compatibility

The package targets .NET 8 and .NET 10. Install it in your application project:

dotnet add package myNOC.Remootio

Setup and Configuration

Add the Remootio service to your IServiceCollection. The same RemootioService instance is registered as both IHostedService (manages the WebSocket connection lifecycle) and IRemootioService (exposes gate state to your components):

services.Configure<RemootioDeviceConfig>(configuration.GetSection("Remootio"));
services.AddSingleton<RemootioService>();
services.AddSingleton<IRemootioService>(sp => sp.GetRequiredService<RemootioService>());
services.AddHostedService(sp => sp.GetRequiredService<RemootioService>());

Configuration

Bind RemootioDeviceConfig from your appsettings.json:

{
  "Remootio": {
    "DeviceIp": "192.168.1.50",
    "ApiSecretKey": "<64-char hex — from the Remootio app>",
    "ApiAuthKey": "<64-char hex — from the Remootio app>",
    "SendPingMessageEveryXMs": 60000,
    "AutoReconnect": true,
    "GateImageUrl": "http://192.168.1.51/snapshot.jpg"
  }
}

The ApiSecretKey and ApiAuthKey are shown in the Remootio mobile app under Remootio device → API Settings.

Security note: Store the API keys in environment variables or a secrets manager rather than in a committed appsettings.json file.

Usage

Subscribing to gate state

var remootio = serviceProvider.GetRequiredService<IRemootioService>();

remootio.GateStateChanged += (sender, state) =>
{
    Console.WriteLine($"Gate is now: {state.Description}");  // "Open" or "Closed"
    Console.WriteLine($"IsOpen: {state.IsOpen}");
};

remootio.ConnectionChanged += (sender, connected) =>
{
    Console.WriteLine($"Connected: {connected}, Authenticated: {remootio.IsAuthenticated}");
};

Sending commands

// Only sent if the gate is currently closed (device enforces this)
remootio.OpenGate();

// Only sent if the gate is currently open (device enforces this)
remootio.CloseGate();

Reading current state synchronously

GateState? state = remootio.CurrentGateState;
bool authenticated = remootio.IsAuthenticated;

Blazor Usage

In a Blazor WebAssembly component, subscribe to events in OnInitialized and call InvokeAsync(StateHasChanged) from event handlers to trigger re-renders:

@inject IRemootioService Remootio
@implements IDisposable

<div class="gate-status">@(Remootio.CurrentGateState?.Description ?? "Connecting...")</div>
<button @onclick="() => Remootio.OpenGate()"  disabled="@(Remootio.CurrentGateState?.IsOpen ?? true)">Open</button>
<button @onclick="() => Remootio.CloseGate()" disabled="@(!(Remootio.CurrentGateState?.IsOpen ?? false))">Close</button>

@code {
    protected override void OnInitialized() =>
        Remootio.GateStateChanged += OnStateChanged;

    private async void OnStateChanged(object? sender, GateState state) =>
        await InvokeAsync(StateHasChanged);

    public void Dispose() =>
        Remootio.GateStateChanged -= OnStateChanged;
}

The package supports Source Link, so your debugger can load the library source from the exact GitHub commit used to build your installed version. Debug symbols are published to the NuGet.org symbol server.

To step into the library, enable Source Link support in your debugger and configure the NuGet.org symbol server. See Microsoft's symbol and source debugging guide for Visual Studio setup.

Protocol Notes

  • The Remootio device listens on ws://{DeviceIp}:8080/
  • All commands and responses after the AUTH frame are encrypted with AES-128-CBC (PKCS7 padding) using the ApiSecretKey (pre-auth) or ApiSessionKey (post-auth)
  • Message integrity is verified with HMAC-SHA256 over the raw {"iv":"...","payload":"..."} JSON string
  • The library automatically handles the AUTH → challenge → QUERY authentication flow and re-authenticates on reconnect
Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.2 53 10/4/2026
1.0.1 52 10/4/2026
1.0.0 63 10/4/2026