Download the PHP package rudestan/broadlink-api without Composer

On this page you can find all versions of the php package rudestan/broadlink-api. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package broadlink-api

Broadlink API PHP7 library

A PHP 7 library for controlling IR and Wireless 433Mhz controllers (e.g. RM Devices), Smart Plugs (e.g. SP2/SP3) from Broadlink. The protocol refer to: mjg59/python-broadlink

Original code refer to: ThePHPGuys/broadlink.

What are the differences with original implementation from "ThePHPGuys"?

Usage

Discover devices

The code will produce an array with Instances of corresponding Authenticatable (extended from ) devices or/and with Instances of in case no or some Unknown devices found.

Authorize device (get the cipher key)

To control previously discovered RM device it must be Authenticated. Let's say the first device in the array is an instance of class (or any other that extended from ). The code will look like the following:

Set device to learning mode

After RM device got Authenticated we can set it to learning mode for receiving commands from any remote control. The following code will set the device to learning mode in case the device class is instace of RMDevice.

Receive last learned command from the Device

Once the RM Device is in learning mode we can receive the last learned command. We also need to wait until the command arrives, so example code might look like this:

An instance of will be returned once the command will be received.

Send command to the Device

After receiving a Packet from it can be converted to an array by calling method. Converted array can easily be stored for example in json file or in the DB and later can be reused to reproduce this command with the Device. To send previously learned command the following code can be used:

Other usage example

If the IP and Mac address of the device is already known (for example it was previously saved) as well as the command (eg. loaded from JSON) the device can be easily used to trigger this command. Possible code might look like the following:

Use cases

The following API can be used for example to connect Google Home or Alexa together with Broadlink RM Pro for example through Raspberry PI as proxy hub. Or another way of usage can be creation of some web widget for Android instead of using limited official Broadlink Application. This API extends the limits of the Device and it becomes much more interesting.


All versions of broadlink-api with dependencies

PHP Build Version
Package Version
Requires php Version >=7.2.0
ext-openssl Version *
ext-sockets Version *
ext-json Version *
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package rudestan/broadlink-api contains the following files

Loading the files please wait ....