SharpBroadlink 1.0.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package SharpBroadlink --version 1.0.0                
NuGet\Install-Package SharpBroadlink -Version 1.0.0                
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="SharpBroadlink" Version="1.0.0" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add SharpBroadlink --version 1.0.0                
#r "nuget: SharpBroadlink, 1.0.0"                
#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.
// Install SharpBroadlink as a Cake Addin
#addin nuget:?package=SharpBroadlink&version=1.0.0

// Install SharpBroadlink as a Cake Tool
#tool nuget:?package=SharpBroadlink&version=1.0.0                

A simple C# API for controlling RM from Broadlink.
This is a port of python-broadlink to C# .Net Standard.

Description

Supported device:

  • RM Pro
  • RM mini 3 (Black Bean)
  • A1 Temperature/Humidity/Noise/Light/VOC Sensor
  • SP mini 3 Smart Plug

Supports .NET Standard2.0

Requirement

Xb.Core
Xb.Net

Usage

  1. Create your new C# project.
  2. Download this solution.
  3. Add a project-reference SharpBroadlink/SharpBroadlink.csproj to your project.
  4. Setup devices or discover devices as follows:
Setup:

== Preparation - It is the same as the original. ==

  1. Put the device into AP Mode.
  2. Long press the reset button until the blue LED is blinking quickly.
  3. Long press again until blue LED is blinking slowly.
  4. Manually connect to the WiFi SSID named BroadlinkProv.

== Preparation is over ==

using SharpBroadlink;
 
// Security mode options are [None, Wep, WPA1, WPA2, WPA12]    
Broadlink.Setup('myssid', 'mynetworkpass', Broadlink.WifiSecurityMode.WPA12);
Discover devices:
using SharpBroadlink;
 
var devices = await Broadlink.Discover(5);
Get signal data with RM:
using SharpBroadlink;
 
var devices = await Broadlink.Discover(5);
var rm = (SharpBroadlink.Devices.Rm) devices[0];
 
// Enter Learning mode
await rm.EnterLearning();

Here, Point the remote control to be learned to RM Pro, and press the button.
And...

// Get signal data.
var signal = await rm.CheckData();
 
// Test signal
await rm.SendData(signal);
Get sensor data with A1:
using SharpBroadlink;
 
var devices = await Broadlink.Discover(5);
var device = (SharpBroadlink.Devices.A1)devs.First(d => d.DeviceType == DeviceType.A1);

// before Auth, cannot get values. 
await device.Auth();
 
var values = await dev.CheckSensors();
Get/Set plug state with SP3:
using SharpBroadlink;
 
var devices = await Broadlink.Discover(5);
var device = (SharpBroadlink.Devices.Sp2)devs.First(d => d.DeviceType == DeviceType.Sp2);

// before Auth, cannot get values. 
await device.Auth();
 
var powerState = await dev.CheckPower();
var nightLightState = await dev.CheckNightLight();

await dev.SetPower(!powerState);
await dev.SetNightLight(!nightLightState);

Licence

MIT Licence

Original python-broadlink:
https://github.com/mjg59/python-broadlink

Protocol document:
https://github.com/mjg59/python-broadlink/blob/master/protocol.md

Product 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. 
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.3 1,422 8/9/2019
1.0.2 962 12/30/2018
1.0.1 768 9/29/2018
1.0.0 734 9/29/2018

first release.