SmartHome.SDK.Fibaro 0.3.1

dotnet add package SmartHome.SDK.Fibaro --version 0.3.1
                    
NuGet\Install-Package SmartHome.SDK.Fibaro -Version 0.3.1
                    
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="SmartHome.SDK.Fibaro" Version="0.3.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="SmartHome.SDK.Fibaro" Version="0.3.1" />
                    
Directory.Packages.props
<PackageReference Include="SmartHome.SDK.Fibaro" />
                    
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 SmartHome.SDK.Fibaro --version 0.3.1
                    
#r "nuget: SmartHome.SDK.Fibaro, 0.3.1"
                    
#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 SmartHome.SDK.Fibaro@0.3.1
                    
#: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=SmartHome.SDK.Fibaro&version=0.3.1
                    
Install as a Cake Addin
#tool nuget:?package=SmartHome.SDK.Fibaro&version=0.3.1
                    
Install as a Cake Tool

SmartHome.SDK.Fibaro

A lightweight .NET client SDK for Fibaro/Home Center REST API.

Install

NuGet package name: SmartHome.SDK.Fibaro

Install-Package SmartHome.SDK.Fibaro

Quickstart

using Microsoft.Extensions.DependencyInjection;
using SmartHome.SDK.Fibaro.Interfaces;
using SmartHome.SDK.Fibaro.Services;

var services = new ServiceCollection();

// Basic auth (recommended for Fibaro/Home Center)
services.AddFibaroClient(o =>
{
    o.BaseAddress = new Uri("https://your-home-center/api/");
    o.Username = "apiuser";
    o.Password = "apipass";
});

var provider = services.BuildServiceProvider();
var client = provider.GetRequiredService<IFibaroClient>();

var devices = await client.GetDevicesAsync();
await client.ExecuteActionAsync(123, "turnOn");

Device actions (Basic auth)

  • Execute an action from code (turnOn, setValue): see docs/usage-examples.md.
  • Run an action from the console example using env vars: see docs/try-it.md.

Safer ExecuteAction

Use the overload that maps directly to the Fibaro payload (DeviceActionArgumentsDto):

// { args: [50], integrationPin?: string, delay?: number }
await client.ExecuteActionAsync(123, "setValue", new object?[] { 50 });
// With PIN and delay:
await client.ExecuteActionAsync(123, "setValue", new object?[] { 50 }, integrationPin: "1234", delaySeconds: 30);

Details: see docs/usage-examples.md and docs/endpoints.md notes.

Features

  • HttpClient-based, DI-friendly typed client
  • Authentication: Bearer token or Basic
  • Error handling with FibaroApiException (status code + payload)
  • Models mapped with System.Text.Json

API Surface

  • Task<IReadOnlyList<Device>> GetDevicesAsync(CancellationToken ct = default)
  • Task<Device?> GetDeviceAsync(int deviceId, CancellationToken ct = default)
  • Task ExecuteActionAsync(int deviceId, string action, object? parameters = null, CancellationToken ct = default)
  • Task DeleteDeviceAsync(int deviceId, CancellationToken ct = default)
  • Task<IReadOnlyList<Device>> FilterDevicesAsync(DeviceListFiltersDto filters, CancellationToken ct = default)
  • Task<Device> UpdateDeviceAsync(int deviceId, Device device, CancellationToken ct = default)
  • Task ExecuteGroupActionAsync(string actionName, GroupActionArguments args, CancellationToken ct = default)
  • Task AddInterfacesToDevicesAsync(DevicesInterfacesDto request, CancellationToken ct = default)
  • Task DeleteInterfacesFromDevicesAsync(DevicesInterfacesDto request, CancellationToken ct = default)
  • Task<Device> AddPollingInterfaceAsync(int deviceId, CancellationToken ct = default)
  • Task<Device> DeletePollingInterfaceAsync(int deviceId, CancellationToken ct = default)
  • Task DeleteDelayedActionAsync(long timestamp, int id, CancellationToken ct = default)
  • Task ExecuteActionOnSlaveAsync(string slaveUuid, int deviceId, string action, object? parameters = null, CancellationToken ct = default)
  • Task DeleteDeviceOnSlaveAsync(string slaveUuid, int deviceId, CancellationToken ct = default)
  • Task<DeviceTypeHierarchy> GetDevicesHierarchyAsync(CancellationToken ct = default)
  • Task<IReadOnlyList<DeviceInfoDto>> GetUiDeviceInfoAsync(UiDeviceInfoQuery? query = null, CancellationToken ct = default)

Scenes:

  • Task<IReadOnlyList<SceneDto>> GetScenesAsync(bool? alexaProhibited = null, CancellationToken ct = default)
  • Task<SceneDto?> GetSceneAsync(int sceneId, bool? alexaProhibited = null, CancellationToken ct = default)
  • Task<CreateSceneResponse> CreateSceneAsync(CreateSceneRequest request, CancellationToken ct = default)
  • Task UpdateSceneAsync(int sceneId, UpdateSceneRequest request, CancellationToken ct = default)
  • Task DeleteSceneAsync(int sceneId, CancellationToken ct = default)
  • Task ExecuteSceneAsync(int sceneId, ExecuteSceneRequest? request = null, string? pin = null, CancellationToken ct = default)
  • Task ExecuteSceneSyncAsync(int sceneId, ExecuteSceneRequest? request = null, string? pin = null, CancellationToken ct = default)
  • Task<SceneDto> ConvertSceneAsync(int sceneId, CancellationToken ct = default)
  • Task<SceneDto> CopySceneAsync(int sceneId, CancellationToken ct = default)
  • Task<SceneDto> CopyAndConvertSceneAsync(int sceneId, CancellationToken ct = default)
  • Task KillSceneAsync(int sceneId, string? pin = null, CancellationToken ct = default)
  • Task<IReadOnlyList<SceneDto>> FilterScenesByTriggersAsync(FilterSceneRequest filters, CancellationToken ct = default)

History Events:

  • Task<IReadOnlyList<HistoryEventDto>> GetHistoryEventsAsync(HistoryEventsQuery? query = null, CancellationToken ct = default)
  • Task DeleteHistoryEventsAsync(DeleteHistoryQuery? query = null, CancellationToken ct = default)

Testing

Project includes xUnit + Moq tests. To run:

# From repo root
Dotnet restore
Dotnet build -c Release
Dotnet test .\tests\SmartHome.SDK.Fibaro.Tests\SmartHome.SDK.Fibaro.Tests.csproj -c Release

Packaging

Pack the library (README and XML docs included):

Dotnet pack .\SmartHome.SDK.Fibaro.csproj -c Release

CI/CD

This repo includes a GitHub Actions workflow to build/test on push and publish on version tags. Configure the secret NUGET_API_KEY in your repository settings.

Documentation

See the docs/ folder:

  • docs/getting-started.md – install and first request
  • docs/authentication.md – Basic and Bearer setup
  • docs/endpoints.md – full API surface
  • docs/scenes.md – guide for Scenes
  • docs/usage-examples.md – cookbook
  • docs/error-handling.md – FibaroApiException and patterns
  • docs/testing-and-ci.md – tests and CI
  • docs/troubleshooting.md – common issues
  • docs/versioning.md – release process
  • docs/try-it.md – quick run example

License

MIT

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 is compatible.  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
0.3.1 105 9/13/2025
0.3.0 100 9/13/2025
0.2.4 60 9/12/2025
0.2.3 129 9/9/2025
0.2.2 142 9/7/2025
0.2.1 137 9/7/2025
0.2.0 138 9/7/2025
0.1.0 140 9/7/2025

v0.3.1: History Events API (GET /events/history with filters, DELETE /events/history with shrink/timestamp), models, docs and tests. v0.3.0: Scenes API support (list/get/create/update/delete, execute/executeSync with PIN header, convert/copy/copyAndConvert, kill, filter by triggers); docs (getting-started, endpoints, scenes) and tests. v0.2.4: Safer ExecuteAction overload (args[], integrationPin?, delay?) + docs/README updates. v0.2.3: Device typed property accessors (TryGetProperty/GetPropertyOrDefault) and full /devices/{id} payload mapping. v0.2.2: Documentation updates (README tweaks, examples). v0.2.1: Documentation polish (Basic-auth action examples, console env-var action run), README links. v0.2.0: Devices API coverage (filter, update, delete, actions, group, delayed, interfaces, polling, slave proxy, hierarchy, uiDeviceInfo); viewVersion overloads; docs and tests.