myNOC.Remootio
1.0.2
dotnet add package myNOC.Remootio --version 1.0.2
NuGet\Install-Package myNOC.Remootio -Version 1.0.2
<PackageReference Include="myNOC.Remootio" Version="1.0.2" />
<PackageVersion Include="myNOC.Remootio" Version="1.0.2" />
<PackageReference Include="myNOC.Remootio" />
paket add myNOC.Remootio --version 1.0.2
#r "nuget: myNOC.Remootio, 1.0.2"
#:package myNOC.Remootio@1.0.2
#addin nuget:?package=myNOC.Remootio&version=1.0.2
#tool nuget:?package=myNOC.Remootio&version=1.0.2
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.jsonfile.
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;
}
Debugging with Source Link
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
AUTHframe are encrypted with AES-128-CBC (PKCS7 padding) using theApiSecretKey(pre-auth) orApiSessionKey(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 | Versions 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. |
-
net10.0
- Microsoft.Extensions.Hosting.Abstractions (>= 10.0.12)
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.12)
- Microsoft.Extensions.Options (>= 10.0.12)
-
net8.0
- Microsoft.Extensions.Hosting.Abstractions (>= 10.0.12)
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.12)
- Microsoft.Extensions.Options (>= 10.0.12)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.