(Smart Home) Automation with Node-RED
Yesterday I expanded the memory in my home and code server to 16 GB and wondered what I could do with all the resources this server provides me. So I looked around a bit and came across an open source program called Node-RED. Especially in the context of Smart Home and Home Assistant, I’ve heard about it a few times, but never looked into this software in more detail.
Basically, Node-RED is something similar to IFTTT, Zapier, or Beehive and n8n, which I had mentioned on the blog before. For those tools, I had sometimes found minor use cases, but ultimately not much use.
But now that I’m also into smart home - today I ordered some smart plugs -, I thought I should try Node-RED as well, after all Node-RED offers direct integration with Home Assistant and thus allows to automate the smart home. Among many other things…
The installation was pretty simple using Docker: create a service in
docker-compose.yml, start it, done.
Then I installed the package
node-red-contrib-home-assistant-websocket, which provides integration with Home Assistant. This can then be used to retrieve and change the states of the entities in Home Assistant, run services, etc.
The operation of Node-RED is similar to Scratch, which we used to learn programming at school. There are nodes that can be connected to form programs or flows. Programming without having to write code, so to speak. You can then configure the individual nodes to customize the actions to be executed.
I have mainly created two flows so far. One flow allows me to query the temperature in my apartment and outside via a Telegram bot. It also sends an update every three hours between 6am and 6pm. The other flow allows me to query and change the status of the Wi-Fi (on or off) via Telegram. I can also switch the guest Wi-Fi in this way. The flows look like this (sorry for the German descriptions):
In addition, I have created a third flow - for testing - which replies me with a QR code of the text I send in a command:
What I would like to set up again is something my father had tinkered with and programmed back in the day. Using a Telegram bot, you could query if the dryer in the basement was still working and get a notification when it was done.
The simplest option would be a socket sensor that measures how much power is currently being drawn from the socket. However, the available ready-made options for this somehow seems to be quite small. Another possibility would be to tinker something myself with ESPHome, but for that I first have to get closer to the whole chip and sensor matter. I just don’t feel like soldering that much.
Tags: Automation, Home Assistant, IFTTT, Node-RED, Open Source, Smart Home