Home automation with a Raspberry Pi
Objects and Custom Scripts
The Objects dialog lists all the existing adapters with their respective configuration options. They are summarized in a tree below the respective instance (Figure 6). You can typically modify the configuration of the end devices in the individual folders by adjusting the predefined values. Because the individual attributes of the devices are also required for creating corresponding controls in the Vis editor visualization dialogs (discussed in the next section), you will want to assign meaningful names to the object attributes and enter them in the corresponding lines of the attribute view to ensure a better overview of the features in the Vis editor interface.
Because the current configuration of a component does not yet allow automated control, ioBroker offers a scripting option for installing a convenient interface: the JS Script Engine adapter. In the interface, you can choose whether you want to create the script in JavaScript, Blockly, or TypeScript. If you choose Blockly, ioBroker integrates a modular system that allows programming of components through the underlying JavaScript back end with graphical puzzle pieces.
Once you have integrated the script engine into the system, a new Scripts entry appears in the sidebar, where you can call the engine. Script programming requires some prior knowledge, but the ioBroker developers do offer detailed documentation to help you out [5].
Uniform Interface
With the help of the Vis interface, you can combine your entire private IoT into a unified control center. Vis is also implemented as an adapter and installed when the control software in ioBroker is installed. The visualization module combines all common control elements such as switches, scripts, and scenes of the smart home infrastructure in a uniform, web-based interface that you can access with any end device (Figure 7). To access the interface, either call the corresponding adapter in the Instances group from the adapter web page icon, or enter the IP address of the Raspberry Pi followed by port number 8082 in the address bar of a browser.
If you call the Vis adapter from the Instances view, the Vis editor appears, where you can define the individual attributes for the end devices to be controlled. The editor has complex optional settings for the respective actuators, switches, sensors, and terminal devices; it is a good idea to read the manual up front to avoid creating faulty controls. The individual device attributes can be found by choosing the Objects item in the ioBroker sidebar (Figure 6).
If you call the Vis adapter manually from the web browser, you are taken to a dialog that presents an editor; clicking the VIS RUNTIME button opens the preconfigured control interface, which you can use to switch the individual devices on and off or to display information. A tablet that displays this interface in the browser is ideal for this task, letting you monitor and control your infrastructure conveniently, simply by tapping.
In the Vis interface, you can also include widgets in the editor that provide you with information such as the weather situation or a time display. Widgets are enabled in the same way as traditional device controls [6]. The system lets you freely design the widgets in terms of appearance; the same applies to the Vis interface background. The developers provide basic layout templates that can be freely customized.
Developing Scenarios
ioBroker lets you program and use scenes to control your device groups individually. To do so, use the Adapters selection to integrate the scenes adapter into the system. After doing so, the new Scenes option appears in the vertical bar on the left side of the program window. On opening, you are taken to the scene editor, which lets you define individual, changing settings profiles for individual components or component groups.
ioBroker stores the settings profiles in a tree structure. Once you have captured one or more of these scenes, incorporate them into your control interface in the Vis editor; then, you can manage multiple devices together by predefined scene profiles (e.g., automatically dimming the lights and lowering the blinds for a home theater setting).
« Previous 1 2 3 Next »
Buy this article as PDF
(incl. VAT)
Buy Linux Magazine
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Subscribe to our ADMIN Newsletters
Support Our Work
Linux Magazine content is made possible with support from readers like you. Please consider contributing when you’ve found an article to be beneficial.
News
-
New Slimbook EVO with Raw AMD Ryzen Power
If you're looking for serious power in a 14" ultrabook that is powered by Linux, Slimbook has just the thing for you.
-
The Gnome Foundation Struggling to Stay Afloat
The foundation behind the Gnome desktop environment is having to go through some serious belt-tightening due to continued financial problems.
-
Thousands of Linux Servers Infected with Stealth Malware Since 2021
Perfctl is capable of remaining undetected, which makes it dangerous and hard to mitigate.
-
Halcyon Creates Anti-Ransomware Protection for Linux
As more Linux systems are targeted by ransomware, Halcyon is stepping up its protection.
-
Valve and Arch Linux Announce Collaboration
Valve and Arch have come together for two projects that will have a serious impact on the Linux distribution.
-
Hacker Successfully Runs Linux on a CPU from the Early ‘70s
From the office of "Look what I can do," Dmitry Grinberg was able to get Linux running on a processor that was created in 1971.
-
OSI and LPI Form Strategic Alliance
With a goal of strengthening Linux and open source communities, this new alliance aims to nurture the growth of more highly skilled professionals.
-
Fedora 41 Beta Available with Some Interesting Additions
If you're a Fedora fan, you'll be excited to hear the beta version of the latest release is now available for testing and includes plenty of updates.
-
AlmaLinux Unveils New Hardware Certification Process
The AlmaLinux Hardware Certification Program run by the Certification Special Interest Group (SIG) aims to ensure seamless compatibility between AlmaLinux and a wide range of hardware configurations.
-
Wind River Introduces eLxr Pro Linux Solution
eLxr Pro offers an end-to-end Linux solution backed by expert commercial support.