( Article restored specifically for the blog ioBroker )
Many people who are interested in home automation (“Smart Home”) have a well-known open automation system on which to build control: OpenHab, MajorDoMo, Home Assistant, Domoticz, HomeBridge. But if you slightly expand the range of observation, you can find many software systems that can offer similar functionality, and in some places even more. Today, I will tell about one of them - ioBroker . I'll tell you clearly, without immersing in the details of the implementation, because each element will require a separate article (if required, there will be an article).
ioBroker is an automation system developed on the Node.js platform (as well as HomeBridge). Because of this, it can be deployed and run on almost any operating system or virtual machine: Windows, Mac, Linux, in a Docker container, and even on Android. This allows you to scale the system based on the needs: put it on the “raspberry” for home, quest room or server for the hotel.
IoBroker, like most automation systems, is open and extensible. New features or devices are connected by adding a “driver” or “adapter” (so-called ioBroker plugins), which can be installed from the official Store or from the git repository.
Most actions are performed from the web-based administration interface and allow you to change any system parameters (there is no need to edit the config-files in the terminal):
An example of how the administration interface looks like can be found here http://iobroker.click
The 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 takes place with them and their values. Working with devices consists of a subscription to the change of states and the actual change of other states depending on the situation.
For example, an ordinary light bulb can be represented as one state, which will indicate whether it is turned on or not. But if the bulb is dimmable, then another state is needed - the level of brightness. For a light bulb that changes color, there is also a state of hue (hue) and saturation. For more complex devices, the number of observed states is growing.
Some states have feedback and when they are changed by ioBroker (for example, the user has changed the value or when the script is running), the value is sent back to the device or service.
Thus, for example, you can turn on the light bulb, manually changing its state in the objects, or switch the thermostat operation mode.
All states are stored in a tree-like registry, which is very similar to the MQTT protocol approach, where data correlates with 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 that support this protocol.
IoBroker has, by default, a device search driver and automatic driver installation for them. Not only devices that are standardly recognized 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 constantly appear 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.
A user can interact with ioBroker in several ways.
ioBroker has the most flexible options for customizing the visual interface among open automation systems. You can create several pages with scenes, on the pages you can arrange widgets for control, display of values and images from the camera. A set of widgets can be arbitrary and installed by additional drivers.
A set of visualization pages of some users is available on the net, which are shared with the developers https://iobroker.click/ . It can be seen that there is no single approach to the design of the “Smart Home” management page and everyone does it on his own. On the one hand, this is good, 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, and more).
After the appearance of Telegram bots, they turned out to be a very convenient way of interacting with the systems of the “Smart Home”. The bot accepts control commands and can output any data available in the system.
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 fulfill the inclusion of a state that refers to the “lighting” in the room “nursery”. And there are many such applications: curtains, music, heating, security, lock, etc. The function is very similar to Siri, but only text.
Also, through the Telegram, they implement a channel of notifications about situations occurring in the system. Very comfortably.
Naturally, ioBroker has the ability to integrate into the Apple HomeKit system. Thanks to the Yahka driver, the system can create accessories 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 present in the system.
For example, by creating a virtual device “Lamp” and associating it with the state related to turning on / off a real lamp, you can make a button to control the lamp in the Home application on iOS. And if you connect other additional states, then you can control the dimmable lamp.
Sensors, sensors, cameras, thermostats, fans ... you can display any devices in Homekit and manage them through the Home app or ask Siri to do it.
It is only necessary that the real devices that Siri will manage to be entered into the system and associate the corresponding states with the Homekit virtual devices.
Coma Siri, it is possible to control devices with a voice through Amazon Alexa, which is also 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 connected to your local server, which redirects and executes commands from your Amazon Dot.
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 a voice command to text and send it to ioBroker, where the text2command driver already mentioned 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 with voice.
Voice generation from the text is performed by a special SayIt driver that supports popular TTS engines from Google, Yandex, Amazon. And the output of the resulting speech can be done through columns, Chromecast or Sonos.
Also, voice commands can be received via the created page in the Vis-driver (in the Google Chrome browser) and receive voice messages from ioBroker there.
One of the most important parts of automation is scripting. These are logical control units that define dependencies, behavior, and interactions 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 suburban house”, “Send a list of sensor states to telegrams when receiving a command”
All this is implemented by scripts.
To implement scripts, you can use either Blockly's visual language, or Javascript, or TypeScript, or the very popular NodeRed.
The main task of scripts is a description of the reaction to events occurring in the system. For 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 turn on the lights. And when you double-click - turn off the light.
But more complex behavior will require Javascript knowledge, since a lot of examples performed 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.
The majority of 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 began.
There was a corresponding section on the forum , documentation , telegram chat .
I admit, this is the only automation system I have deeply immersed in (although I looked at Hass and MajorDoMo). This has become my hobby. ioBroker is interesting to me for its architecture, capabilities and community. It is now automating the apartment and the cottage.
Most of the above possibilities I managed to try for myself. I figured out and implemented both simple options and more cunning ones. I developed a couple of drivers for myself and other users of ioBroker began to use them.
I will not find fault with other systems and say that this is an ideal system. I want to pay attention to her and give it a try to others. Yes, the threshold for entering scripts requires a basic knowledge of the system, but this is always the case (only the languages are different). Yes, there will be difficulties with setting up some drivers, but everything is solved. If someone has already been through this, then you will succeed.
Source: https://habr.com/ru/post/374363/
All Articles