HomematicIp 1.0.1
See the version list below for details.
dotnet add package HomematicIp --version 1.0.1
NuGet\Install-Package HomematicIp -Version 1.0.1
<PackageReference Include="HomematicIp" Version="1.0.1" />
paket add HomematicIp --version 1.0.1
#r "nuget: HomematicIp, 1.0.1"
// Install HomematicIp as a Cake Addin #addin nuget:?package=HomematicIp&version=1.0.1 // Install HomematicIp as a Cake Tool #tool nuget:?package=HomematicIp&version=1.0.1
HomematicIp
This package allows to query the HomematicIp REST and WebSocket endpoint.
The following code be self-explanatory. If it is not, there are explanatory comments in the HomematicIp.Console project. You can also use that project to get started
#region 1. Authorization
HttpClient HttpClientFactory() => new HttpClient();
var accessPointId = "YOUR_ACCESS_POINT_ID";
var homematicAuthService = new HomematicAuthService(HttpClientFactory, accessPointId, "YOUR_PIN", "MyHomematicApp");
await homematicAuthService.ConnectionRequest();
System.Console.WriteLine("Please press the blue button on the access point.");
while (!await homematicAuthService.IsRequestAcknowledged())
{
await Task.Delay(TimeSpan.FromSeconds(1));
}
var authToken = await homematicAuthService.RequestAuthToken();
await File.WriteAllTextAsync("config.txt", authToken);
#endregion
#region 2a. QueryRestEndpoint
var homematicService = new HomematicService(HttpClientFactory, accessPointId, authToken, new ClientWebSocket());
var cts = new CancellationTokenSource();
await homematicService.ConnectAsync(cts.Token);
var homematicIpEnvironment = await homematicService.GetCurrentState(cts.Token);
System.Console.WriteLine($"This Homematic Installation has {homematicIpEnvironment.Clients.Count} connected Clients.");
#endregion
#region 2b.QueryWebSocketEndpoint
var events = homematicService.ReceiveEvents(cts.Token);
events.Where(notification => notification.HomematicIpObjectBase is ShutterContactDevice)
.Subscribe(notification =>
{
var shutterContactDevice = notification.HomematicIpObjectBase as ShutterContactDevice;
System.Console.WriteLine($"{shutterContactDevice?.Label}: WindowState={shutterContactDevice?.WindowState}");
});
events.Subscribe(System.Console.WriteLine);
await events.LastOrDefaultAsync();
#endregion
Yet unsupported devices
Since there are a lot of Homematic devices, you might be presented with a message like this. In that case please open an issue, we will add the device asap:
The HomematicIp Endpoint sent a message about an unknown HomematicIp Object (most likely a yet unsupported device). Please open an issue at https://github.com/larsbeck/HomematicIp to have this device added to the library. We will need the following: {...}
A big thank you for laying the groundwork goes to the creators of this Python library https://github.com/coreGreenberet/homematicip-rest-api
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. 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. |
.NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
.NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen40 was computed. tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- Microsoft.CSharp (>= 4.5.0)
- Newtonsoft.Json (>= 12.0.1)
- System.Net.WebSockets.Client (>= 4.3.2)
- System.Reactive (>= 4.1.5)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.