Domotise non-domotic appliances through home automation Appthe HomeKits, Broadlink and Homebridge

8 minutes of reading
Guide purposes:
Concepts dealt with:
  • Software installation and configuration
Software components used:
Prerequisites:
Physical devices used:
GUIDE more indicated for:

Apple-200x200

Notes and disclaimer
  • qualsiasi modifica all'impianto elettrico dev'essere progettata ed effettuata da personale qualificato;
  • any changes implemented in probefore is a propersonal responsibility as well as a profirst risk and danger (the contents of the present page are purely educational);
  • any changes implemented in proprior to a device it voids the guarantee, quality approvals and certifications.

Abstract

The "homebridge-broadlink-rm"Is a Home pluginbridge conceived to take advantage of the Broadlink RM Mini 3, a device capable of receiving and above all sending infrared signals, as well as its "big brother", the Broadlink RM Pro/Pro+, capable of receiving and also sending radio signals to 433mhz and 315mhz.

The combined use of Homebridge, this plugin and these components allows to make home appliances many devices - typically controlled via infrared signals and / or radio signals - and then control and command them via HomeKit's App(app "Home" yes iOS) as well as Siri.

Index

Installation

Installation, like all Home pluginsbridge - it's very simple.
Run the following command - on unix-based systems (linux, Raspberry etc.) from the terminal, from systems windows su procommand mpt:

npm install -g homebridge-broadlink-rm

and wait for the end of proprocedure.
Nb. In case Homebridge be it already running as a service (as described in our Home installation guidebridge), prosee to interrupt it before installing using the command:

sudo systemctl stop homebridge

Update Searchnamento

To update the package, simply run the following command:

sudo npm update -g -devhomebridge-broadlink-rm

Configuration

Understand the configuration

Like all add-ons for Homebridge, then installation is necessary prosee the configuration, which resides inside the file config.json of Homebridge same. For more specific information (on structure, location) of the configuration file, refer to to this brief guide.

The plugin configuration "homebridge-broadlink-rm ”includes the addition to the configuration file of a new platform named BroadlinkRM. An example of minimal configuration (without defined accessories) is as follows:

"platforms": [
  {
   "platform": "BroadlinkRM",
   "name": "Broadlink RM",
   "hideScanFrequencyButton": false,
   "hideLearnButton": false,
   "hideWelcomeMessage": true,
   "accessories": [
   ]
  }
]
  • "platform": Defines the name of the platform, which must be mandatory"BroadlinkRM"
  • "name“: Defines the name of the accessory that will be displayed on HomeKit
  • "hideScanFrequencyButton“: Defines whether or not to display (on HomeKit) a key that enables the radio code acquisition function (if the model is used Broadlink RM Pro/Pro+)
  • "hideLearnButton“: Defines whether or not to display (on HomeKit) a key that enables the infrared hexadecimal code (HEX) acquisition function
  • "hideWelcomeMessage“: Defines whether to show the welcome message of the plugin when starting Homebridge
  • "accessories“: Defines the opening of a sub-block dedicated to the definition of individual accessories.
How to acquire infrared and RADIO FREQUENCY HEX codes

First to ask yourself proproblem of capturing the codes, the healthiest thing is to jump on ours COLLABORATIVE ARCHIVE of infrared / radiofrequency codes. With any luck, you may already find the job done. Differently, don't forget (always through that page) after collecting yours, to send them to the archive!

ATTENZIONE: in case you have a computer available Windows, as an alternative to the methods described in this paragraph, we recommend using one faster and more practical based on free TOOL "Broadlink Manager ”, described in detail in this guide.

Once the platform is added and Home is runbridge, on HomeKit appa button called "LearnIR" will appear. To acquire the infrared HEX codes of our remote controls and / or radiofrequency of our radio controls it will be necessary to position yourself in front of the terminal with Homebridge running and activating this button. At this point, the Broadlink RM (any model) will "listen" to any infrared and / or radio frequency HEX codes and, once received, will display them on the terminal via Homebridge.

So let's take the case if you want to capture all the TV remote control codes. First of all, it is convenient to use an Excel sheet to mark all the codes that will be acquired, in order to have a reference table when you want to configure some new accessories or to make changes to the configuration.
The "LeanIR" button is then pressed on theapp"House", point the remote control towards the Broadlink, press the key you wish to acquire and the terminal is observed.
Here is an example taken from the Raspberry terminal when acquiring the "power" button of a Samsung TV:

Broadlink RM captures HEX codes

The HEX code - which is usually a string starting with "2600" - e appare so:

2600460093951237123812381213121212131213111312381238123812121213121311131213121212381213111312131113121312121238121312381139113911391138123812000d050000

Once all the codes that interest us are counted, we can go to configure the accessories available on HomeKit mediated by this powerful plugin.

Accessory: SWITCH (switch)

The most trivial - but more versatile - of the accessories is the switch. The basic configuration is similar to the following:

{
"name":"TV On/Off",
"type":"switch",
"data":{
  "on":"2600500000012...",
  "off":"2600500000012..."
  }
}

This configuration will correspond to a switch that in the ON position will send a certain code (the first one), in OFF another one.
It's not mandatory indicate codes for each feature. For example, it is possible to indicate the code ON but not OFF, and vice versa. This is very important in the case of using a secondary feature of this and other accessories, ie the auto-on / auto-off. It is in fact possible to define switches which, after a certain number of seconds (definable), they automatically deactivate themselves when they are activated, or they activate themselves when they are deactivated. This is very convenient when you want to create a sort of "button" that executes an HEX command and returns to the previous state. Finally, further important functionality Is that of define the state (on or off) of a switch using the "ping" command: in the example above, if the TV is connected to the Wifi network and responds to the ping, can be understood as "on", and therefore the plugin is able - opportunameconfigured - to display the status of the switch as on on HomeKit.

A more complete example is this:

{
  "name": "TV",
  "type": "switch",
  "pingIPAddress": "192.168.1.10",
  "pingIPAddressStateOnly": true,
  "pingFrequency": 90,

  "data": {
    "on": "2600500000012...",
    "off": "2600500000012..."
  }
}

The ip indicated (by way of example) is that assigned to the TV to determine its status.

Finally, it is useful to know that the contents of the "on" and "off" fields can be rappalso reported by further blocks, which contain more HEX codes and / or repeated HEX codes. This feature is also shared with other accessories and it is particularly useful where scenarios are to be created.

Let's say you want to create a switch that, if activated, sends the same HEX code several times (for example, the one to increase the TV volume):

{
  "name":"Volume+",
  "type":"switch",
  "enableAutoOff": true,
  "onDuration": 2,
  "data": [
    {
      "data": "2600500000012...",
      "sendCount": 5,
      "interval": 0.3
    }
  ]
}

In this example, activating the "Volume +" switch will cause sending the indicated HEX for 5 times with 0,3 interval seconds between each sending.

In conclusion, it could be convenient to define a switch that, for example, if activated turn on the TV and then turn on a SAT decoder, setting it to a specific channel. The configuration appit would go roughly like this:

{
  "name": "TV > SAT",
  "type": "switch",

  "enableAutoOff": true,
  "onDuration": 1,

  "data": [{
      "data": "2600500000012...",
      "sendCount": 1,
      "pause": 2
    },
    {
      "data": "2600500000012...",
      "sendCount": 1,
    }
  ]
}

Which, on activation, sends the first code, awaits 2 seconds, then send the second.

All the specifications related to this accessory are available here.

Accessory: OUTLET (POWER OUTLET)

This accessory is identical to the switch accessory, and has the same functionalities and purposes. Simply, it is "shown" to HomeKit as power outlet and not as a switch.
All the specifications related to this accessory are available here.

Accessory: FAN (FAN)

The fan accessory is convenient for checking, appgrease, a fan in its most common functions, or on / off, possible rotation speed, possible rotation orientation (clockwise / anticlockwise), possible oscillation.

The convenience of this accessory lies in the possibility of being used, through the apposite HEX code, also to control the ventilation functions of an air conditioner and not just a normal paddle fan, from the ground or ceiling that they are ..

An example of configuration is as follows:

{
  "name": "Ventilatore",
  "type": "fan",
  "data": {
    "on":"2600500000012...",
    "off":"2600500000012...",
    "swingToggle": "2600500000012...",
    "fanSpeed10": "2600500000012...",
    "fanSpeed20": "2600500000012...", 
    "fanSpeed30": "2600500000012...",
    "fanSpeed40": "2600500000012...",
    "fanSpeed50": "2600500000012...",
    "fanSpeed60": "2600500000012...",
    "fanSpeed70": "2600500000012...",
    "fanSpeed80": "2600500000012...",
    "fanSpeed90": "2600500000012...",
    "fanSpeed100": "2600500000012..."
  }
}

All the specifications related to this accessory are available here.

Accessory: light (light)

Solutions exist for the marketluminotecnica - not domotic - controllable with infrared remote controls or 433mhz radio controls, which makes them perfect candidates for rapid home automation through Broadlink RM and this wonderful Home pluginbridge.
In the example that we are going to present, object of domotization it is an adjustable iridescent light (both in colors and in intensity) luminosa) controlled by an infrared remote control similar to this:

HUE Lights Remote Control Light

We capture all the HEX codes after which we configure a "light" accessory in this way:

{
  "name": "HueTV Light",
  "type": "light",

  "data": {
    "on": "2600500000012...",
    "off": "2600500000012...",

    "brightness10": "2600500000012...",
    "brightness20": "2600500000012...",
    "brightness30": "2600500000012...",
    "brightness40": "2600500000012...",
    "brightness50": "2600500000012...",
    "brightness60": "2600500000012...",
    "brightness70": "2600500000012...",
    "brightness80": "2600500000012...",
    "brightness90": "2600500000012...",
    "brightness100": "2600500000012...",

    "hue0": "2600500000012...",
    "hue120": "2600500000012...",
    "hue230": "2600500000012...",
    "hue31": "2600500000012...",
    "hue14": "2600500000012...",
    "hue43": "2600500000012...",
    "hue63": "2600500000012...",
    "hue136": "2600500000012...",
    "hue161": "2600500000012...",
    "hue188": "2600500000012...",
    "hue210": "2600500000012...",
    "hue245": "2600500000012...",
    "hue260": "2600500000012...",
    "hue279": "2600500000012...",
    "hue300": "2600500000012..."
 }
}

Which results in a user experience of this type:

Broadlink and Luce HUE Light on Homebrige

All the specifications related to this accessory are available here.

Accessory: garage-door-opener (opening garage)

This accessory is dedicated to the mechanized opening of doors and gates, and is typically aimed at those who have a similar device typically controlled with remote controls.
A basic configuration of this accessory is the following:

{
  "name":"Porta del garage",
  "type":"garage-door-opener",
  "openCloseDuration":8,
  "data":{
    "open":"2600500000012...",
    "close":"2600500000012...",
    "lock":"2600500000012...",
    "unlock":"2600500000012..."
  }
}

which allows you to define the codes opening, closing, locking and unlocking, as well as the duration of the proclosing process.
The codes, as anticipated, are typically those in radio frequency products from 433mhz radio controls, but CAUTION: only remote controls are supported norolling code.

All the specifications related to this accessory are available here.

Accessory: lock (lock)

This accessory is dedicated to mechanized opening of locks, and is typically aimed at those who have a similar device typically controlled with remote controls.
A basic configuration of this accessory is the following:

{
  "name":"Serratura",
  "type":"lock",
  "lockDuration":3,
  "unlockDuration":3,
  "data":{
    "lock":"2600500000012...",
    "unlock":"2600500000012..."
  }
}

which allows you to define the codes of opening, closing, as well as the duration of proopening and closing process.
The codes, as anticipated, are typically those in radio frequency products from 433mhz radio controls, but CAUTION: only remote controls are supported norolling code.

All the specifications related to this accessory are available here.

Accessory: window-covering (dark)

This accessory is useful for checking dark for finestkings and doorsnestre. In essence, it allows you to define the HEX codes for the proprocess opening and closing, also can be customized in order to determine the duration of proopening / closing process and what percentage of coverage the dark should be considered open or closed.
A basic configuration of this accessory is as follows:

{
  "name":"Scuro Camera",
  "type":"window-covering",
  "totalDurationOpen": 45,
  "totalDurationClose": 40,
  "data":{
    "open":"2600500000012...",
    "close":"2600500000012...",
    "stop":"2600500000012..."
  }
}

All the specifications related to this accessory are available here.

Accessory: air-conditioner (air conditioner / air conditioner)

This accessory is perhaps, together with the switch, the most useful and functional of the whole plugin.
It allows, in fact, to configure an accessory on HomeKit named (A / C - air-conditioner) which, appgreased, it allows the typical adjustments of an air conditioner / air conditioner, such as temperature, temperature threshold, heating and cooling with temperature target. Typically, this accessory is configured starting from infrared HEX codes captured by the proair conditioner / air conditioner remote control.

The plugin allows you to configure as many HEX codes as there are temperatures adjustable by remote control; at each temperature it is possible to indicate to the plugin (and therefore to HomeKit) if that temperature refers to to a heating (heat) or cooling (cool) mode. It is also possible to indicate which is the reference target temperature for the default mode for heating and / or cooling, as well as setting what a possible car mode corresponds to.
Finally, it is good to know that the "air conditioner / air conditioner" device at HomeKit also reports the ambient temperature as additional information, fundamental data to configure any automations. Given that in fact this device is "virtual" as defined on Homebridge, this plugin comes to us allowing us to point it out where go and collect this crucial information.
The sources can be three:

  • an arbitrary number (useless, however, for the purpose of automating home automation)
  • a text file (in case there is some other source able to write the data on file system)
  • a telemetry MQTT (such as a home automation sensor).

All this configuration helps to provide a user experience of this type:

Homebridge  e  Apple Homekit - air conditioner

A "typical" configuration (absolutely indicative) may be the following:

{
  "name":"Air Conditioner Advanced",
  "type":"air-conditioner",
  "autoCoolTemperature": 23,
  "autoHeatTemperature": 14,
  "autoSwitch": "A/C Auto Switch",
  "data":{
    "off":"2600500000012...",
    "temperature30":{
    "pseudo-mode":"heat",
    "data":"2600500000012..."
    },
    "temperature16":{
    "pseudo-mode":"cool",
    "data":"2600500000012..."
    }
  }
}

All the specifications related to this accessory are available here.

final Thoughts

In presence of a single Broadlink RM (Mini or Pro/Pro+), it is not necessary to specify anything about the configuration of the plugin. If more devices are present, it is necessary to attribute to each of them a Static IP to indicate then, during the configuration definition phase, to every single accessory, using the "host". This scenario occurs in the presence of different devices in different rooms, where it will be necessary to place a Broadlink RM for each room to be covered.

The plugin "homebridge-broadlink-rm"Is an ally irreplaceable for those who want to venture into the realization of a profirst domotica, especially because it allows you to domotize a large amount of components that otherwise could never be.


Logo Appthe HomeKitsATTENZIONE: remember that there is on our FORUM community an ad hoc section dedicated to Appthe Homekits, for any doubt, question, information on the specific merit of these components.


Please comment below