Post

Automating Planned Jobs with ioBroker and Node-RED

Automating Planned Jobs with ioBroker and Node-RED

Home automation has come a long way, and with tools like ioBroker and Node-RED, it’s easier than ever to create complex automation systems. Both of these platforms allow you to control and automate devices, schedules, and tasks with a high degree of flexibility. In this blog post, we’ll explore how you can use ioBroker and Node-RED together to automate planned jobs—whether it’s switching on lights at a specific time, controlling your thermostat, or triggering any other automation you need for your home or office.

🔧 What is ioBroker?

ioBroker is a powerful open-source platform for home automation. It acts as a hub for controlling devices, integrating with various protocols and platforms like Zigbee, Z-Wave, and MQTT. It allows you to automate tasks based on triggers, time schedules, or sensor data, making it a great choice for creating sophisticated automation systems.


🌐 What is Node-RED?

Node-RED is a flow-based development tool for visual programming. It allows you to wire together devices, APIs, and services in a flow chart-like environment. Node-RED is ideal for creating complex automations without writing much code, using a drag-and-drop interface. It can be integrated with various home automation systems, including ioBroker, to expand the capabilities of your home automation setup.


🤖 Why Use ioBroker and Node-RED Together?

While ioBroker offers powerful device management and automation capabilities, Node-RED provides an intuitive, flow-based interface for building complex automations. By combining these two platforms, you can leverage the strengths of both:

  • ioBroker provides device control and integration.
  • Node-RED offers flexibility, logic, and scheduling with its flow-based programming.

Using Node-RED with ioBroker makes it easy to automate tasks based on time, events, or other conditions, while also giving you the flexibility to scale and customize your setup.


📝 Prerequisites

Before we dive into the setup, make sure you have the following:

  1. ioBroker installed: You can install ioBroker on a Raspberry Pi, server, or any compatible system. Follow the installation guide on the official website.
  2. Node-RED installed: Node-RED can be installed on the same machine or a different one. You can install it by following the official installation guide.
  3. Basic knowledge of ioBroker, Node-RED, and home automation concepts.
  4. Access to devices or services you want to automate (lights, smart plugs, thermostats, etc.).

⚙️ Step 1: Setting Up ioBroker for Automation

First, let’s set up ioBroker to control devices. ioBroker can integrate with a wide range of devices and protocols, so we’ll focus on something simple, like controlling a smart light.

  1. Install the necessary adapters: For device control, you’ll need to install relevant adapters in ioBroker. For example, if you are using Z-Wave devices, you will need the Z-Wave adapter.
  2. Add and configure devices: Once the adapter is installed, you’ll need to pair your devices with ioBroker. In the ioBroker dashboard, go to the Objects tab and ensure your devices are visible and can be controlled via the ioBroker interface.
  3. Create basic automation (optional): Before integrating with Node-RED, it’s good to confirm that your devices are working correctly within ioBroker. For example, try turning on/off a light manually via the ioBroker dashboard.

⚡ Step 2: Installing the Node-RED Adapter for ioBroker

Node-RED can be integrated with ioBroker using the Node-RED adapter. This allows Node-RED to access the devices and objects configured in ioBroker and control them based on the automation flows you create.

  1. Install Node-RED Adapter:
    • In the ioBroker interface, go to the Adapter section and search for the Node-RED adapter.
    • Install the adapter and configure it with the correct settings (e.g., port number, authentication).
  2. Enable Node-RED: Once the Node-RED adapter is installed, it will start a Node-RED instance within the ioBroker environment. You can now access Node-RED via the dedicated menu entry in the ioBroker dashboard.

🛠️ Step 3: Creating Automation Flows in Node-RED

Now that ioBroker and Node-RED are set up, you can start creating automation flows in Node-RED to automate tasks, including time-based or event-driven actions. Here’s how to automate a simple task such as turning on a light at a scheduled time.

1. Access Node-RED Dashboard

Open Node-RED in the ioBroker dashboard by clicking on the menu entry on the left side. You should see the flow editor.

2. Drag and Drop Nodes to Create the Flow

Here’s how you can create a flow to automate a job:

  • Inject Node (for scheduled timing): The Inject node is used to trigger events based on specific conditions. You can set this node to trigger at a specific time or interval.
    • Drag the Inject node to the workspace.
    • Double-click to configure it. Set the Payload to a value (e.g., true for turning on the light).
    • Set the Repeat option to define when it should trigger (e.g., every day at 7:00 PM).
  • ioBroker Out Node (for controlling devices): This node will send commands to ioBroker to control the devices.
    • Drag the ioBroker Out node to the workspace.
    • Connect the Inject node to the ioBroker Out node.
    • Double-click on the ioBroker Out node to configure it. Select the device object from ioBroker (e.g., your light device) and set the desired action (e.g., on for turning on the light).

🚀 3. Deploy the Flow

Once the nodes are connected and configured, click Deploy in the top-right corner of the Node-RED interface. This will activate your flow, and it will start automating the job at the scheduled time.

Example Flow:

Here’s a simple example of what the flow might look like:

1
[Inject Node] --> [ioBroker Out Node]
  • Inject Node is configured to trigger at a specific time.
  • ioBroker Out Node sends the command to turn on the light in ioBroker.

🧪 Step 4: Testing and Troubleshooting

After deploying your flow, test it by either waiting for the scheduled time or manually triggering the Inject node to simulate the event. If something isn’t working, check the following:

  • Ensure that your ioBroker devices are correctly configured and visible in Node-RED.
  • Verify the Inject node’s settings for correct timing or interval.
  • Check the logs in both Node-RED and ioBroker for error messages or connection issues.

🧠 Final Thoughts

By combining ioBroker and Node-RED, you can easily automate planned jobs and create complex automation systems for your home or office. With the flexibility of Node-RED’s flow-based programming and ioBroker’s extensive device control capabilities, you can build highly customizable automation setups that fit your needs.

In this article, we demonstrated how to use these two platforms to automate a scheduled task (e.g., turning on a light) based on time. The possibilities are endless, and you can extend this setup to control a variety of devices, integrate external services, or trigger more complex automation flows based on different conditions.

Remember, the key to successful automation is always testing and refining your flows. Whether you’re controlling lights, heating, or even running custom scripts, ioBroker and Node-RED make it easier than ever to create the automation system of your dreams.

This post is licensed under CC BY 4.0 by the author.