ioBroker - an open automation system (overview)

( Article restored specifically for ioBroker blog )


Many who are interested in home automation ("Smart Home") have heard about open source automation systems on which they can build controls: OpenHab, MajorDoMo, Home Assistant, Domoticz, HomeBridge. But if you expand the observation range a little, you can find many software systems that can offer similar functionality, and in some places even more. Today, I will talk about one of them - ioBroker . I’ll tell you briefly, without diving into the implementation details, because each element will require a separate article (if necessary, there will be an article).



What kind of beast?


ioBroker is an automation system developed on the Node.js platform (as well as HomeBridge). Thanks to this, it can be deployed and run on almost any operating system or virtual machine: Windows, Mac, Linux, in the Docker container, and even on Android. This allows you to scale the system based on your needs: put it on the "raspberries" for the house, quest rooms or on the server for the hotel.


The ioBroker system, like most automation systems, is open and extensible. New functionality or devices are connected by adding a "driver" or "adapter" (the so-called ioBroker plugins), which can be installed from the official Store or from the git repository.


Most actions are performed from the administration web interface and allow you to change any system parameters (there is no need to edit config files in the terminal):


  • managing a set of drivers and their parameters
  • monitoring and changes of system objects, states and their history
  • development of behavior scripts and event handlers
  • development of visual dashboards for managing and presenting states
  • and much more.

An example of what the administration interface looks like can be found here http://iobroker.click


How does it work inside?


IoBroker’s approach is that each connected device or service is represented as a set of states that can be changed by the device or user. Those. the device is decomposed into elements and further work occurs with them and their values. Work with devices consists in subscribing to a change of states and actually changing other states, depending on the situation.


So, for example, an ordinary light bulb can be represented as a single state, which will indicate whether it is on or not. But if the bulb is dimmable, then one more state is needed - the brightness level. For a light bulb that changes color, it is also a state of hue and saturation. For more complex devices, the number of observed states is increasing.



Some states have feedback and when they are changed by ioBroker (for example, the user changes the value or when the script is executed), the value is sent back to the device or service.
Thus, for example, you can turn on the light bulb by manually changing its state in objects, or switch the thermostat operation mode.


All states are stored in a tree registry, which is very similar to the approach with the MQTT protocol, where the data corresponds to the topics. Therefore, the corresponding MQTT driver easily integrates with any mqtt-servers (or brokers). It also acts as an MQTT server / broker for IOT devices supporting this protocol.


Supported Devices and Services


IoBroker has a default active driver for finding devices and automatically installing drivers for them. Not only devices that are recognized by standard through UPnP are supported, but simply devices that can be found by IP address or connected to a USB port.



Thanks to the open architecture, new drivers are constantly appearing in ioBroker. Now there are about 200 of them in the official repository ( http://download.iobroker.net/list.html ), and the list of automatically detected devices is constantly updated ( https://github.com/ioBroker/ioBroker.discovery#automatically-discovered ) .


If you have additional equipment (various USB sticks or shields), you can use popular protocols: Z-Wave, Zigbee, BLE, KNX.



You can integrate with other Smart Home systems, controllers and hubs: OpenHab, MiHome, HomeMatic, MegaD, Home assistant and others.


Interaction interfaces


The user can interact with ioBroker in several ways.


Vis Interface



Video example


ioBroker has the most flexible visual interface customization options among open automation systems. You can create several pages with scenes, arrange widgets on the pages, display values ​​and camera images. A set of widgets can be arbitrary and is installed by additional drivers.


A set of visualization pages for some users who shared them with the developers https://iobroker.click/ is available on the network . It can be seen that there is no single approach to the design of the Smart Home control page, and each one does so at his own discretion. This is good on the one hand, because there is room for design and no restrictions. On the other hand, it is difficult for an unprepared user.



Insta-video mirrors with Vis-interface


Also, thanks to the cloud service and the Cloud driver, you can access the ioBroker visual interfaces from the global network without using special tools (VPN, DynDNS, etc.).


Telegram bot


After the advent of Telegram bots, they turned out to be a very convenient way to interact with Smart Home systems. The bot receives control commands and can output any data available in the system.



Video example


Thanks to the text2command driver, you can send a text message to the bot and it will be parsed and executed. For example, the text “turn on the light in the nursery” will turn on a state that refers to the “lighting” in the “nursery” room. And there are many such applications: curtains, music, heating, security, castle, etc. The function is very similar to Siri, but only text.


Also, through Telegram, a channel for notifications about situations occurring in the system is implemented. Very comfortably.


iOS Homekit


Naturally, ioBroker has the ability to integrate into the Apple HomeKit system. Thanks to the Yahka driver, you can create accessories in the system that meet the requirements of HomeKit and use them on iOS devices.
To do this, in the settings of the Yahka driver, you need to create virtual devices and associate their characteristics with the states existing in the system.


So, for example, by creating a virtual device "Lamp" and associating it with a state related to turning on / off a real lamp, you can make a lamp control button in the Home application on iOS. And if you connect other additional states, you can control a dimmable lamp.



Sensors, sensors, cameras, thermostats, fans ... any devices can be displayed in Homekit and controlled through the Home application or ask Siri to do it.
It is only necessary that the real devices that Siri will control are brought into the system and associate the corresponding states with the Homekit virtual devices.



Video example


Voice control


Coma Siri, voice control of devices is also possible through the Amazon Alexa, which is popular in the West (it's a pity not in Russian). To do this, a special Alexa Skill is connected to the ioBroker cloud service associated with your local server, which redirects and executes commands from your Amazon Dot.


Video example


If there is no smart column, then you can execute commands in Russian through the Android Tasker and PAW applications. Through these applications, you can convert the voice command to text and send it to ioBroker, where the already mentioned text2command driver will execute it and report the result.
Additionally, integration through the PAW driver, you can perform many reverse commands on your Android device: make calls, write SMS and play text in your voice.


Voice generation from text is performed by a special SayIt driver that supports popular TTS engines from Google, Yandex, Amazon. And the conclusion of the resulting speech can be done through the speakers, Chromecast or Sonos.


Also, voice commands can be received through the created page in the Vis driver (in the Google Chrome browser) and receive response voice messages from ioBroker there.


Scenarios


One of the most important parts of automation is scripting. These are logical control units that define the dependencies, behavior, and interaction between devices and their states.
"Turn on the light when motion is detected", "Add the temperature of the heating circuit, when the owners approach the country house", "Send a list of sensor statuses to telegrams when receiving a command."


All this is implemented by scripts.


To implement the scripts, either the Blockly visual language, or Javascript, or TypeScript, or the very popular NodeRed can be used.



The main task of scripts is to describe the reaction to events occurring in the system. To do this, scripts describe state change handlers. For example, if you change the click state associated with a wireless button, change the set of states related to sonoff modules that include lighting. And when you double-click - turn off the light.



But more complex behavior will require knowledge of Javascript, as many examples were executed on it. To implement the necessary functionality, you can connect any npm-package and use it in scripts.



And yes, scripts can run on a schedule.


Community


Most ioBroker users are located in Europe, in Germany and this is reflected in the specifics of the community, materials, lessons, examples and documentation.



But in the last two years, the active development of the Russian-speaking community has begun.
There was a corresponding section on the forum , documentation , telegram chat .


Conclusion (personal experience)


I admit, this is the only automation system that I plunged into deeply (although I looked at Hass and MajorDoMo). This has become my hobby. ioBroker is interesting to me for its architecture, features and community. It is now automating the apartment and cottage.


I managed to try most of the above features on myself. I figured out and implemented both simple options and trickier ones. I developed a couple of drivers for myself and other ioBroker users began to use them.


I will not blame other systems and will not say that this is an ideal system. I want to pay attention to her and give her a try to others. Yes, the threshold for entering scripting requires basic knowledge of the system, but this is the case everywhere (only different languages). Yes, there will be difficulties with configuring some drivers, but everything is solved. If someone has already been through this, then you will succeed.