Raspberry with node.js - how to run a Terminal command and display the output

Before you go down the Home Assistant route, why not try a different approach…
Have you ever heard of Node-Red? It’s a graphical programming/workflow system that runs beautifully on an RPI and has a Blynk plug-in. It can access the ports on your RPI (GPIO pins, SPI, I2C etc) and doesn’t need any real programming skills. If you want to write custom functions you can do, but most of the time you can achieve what you want using the existing nodes and additional plug-ins.
There’s a large community of developers who contribute plug-ins (known as ‘Contribs’ in Node-Red speak) and an active Node-Red support forum.

This is what I use as the heart of my home automation system and it’s great. Personally, I don’t attach any sensors directly to the RPI (although that can be done). Instead I use ESP8266/NodeMCU type devices and get them to exchange data with the RPI via MQTT messages. This data can be things like temperature, pressure and humidity readings, or commands to activate relays etc attached to the NodeMCU devices.
Node-Red also has a built-in dashboard which can be used to display data, and provide widgets to control devices. Personally, I don’t like the dashboard, so use Blynk instead.

I recently decided to try exploring a Home Assistant. It has a massive learning curve, and the Docker version is crippled in a way which makes it almost impossible to use. I quickly switched to a conventional install on an RPI4 (which requires you to burn the image files to an SD card rather than do a conventional install from Buster etc) and spent around 3 full days evaluating it. Although it clearly has some nice features, but for me it was too far outside of my comfort zone to be worth the additional investment in time that would be needed to become fully comfortable with it, and migrate my systems to it.

If you want to know more about the way I use Node-Red in our Spanish holiday home then have a read of this…

Pete.