I'm doing research on home automation, and I've stumbled across Revolution Pi. I'm trying to see if this matches my intentions. Can you please help me put together the correct setup?
I'm a software developer by trade. I'm not very familiar with electrical engineering, but I have friends who are much more familiar with it than I am. I want to automate equipment in and around my home. It will go beyond the basic on/off switching of lights; the intention is to be able to create "scenes" to change multiple devices simultaneously for a given situation. The situation can be based on multiple factors, like geofencing, weather, time of day, and other inputs.
I'm comfortable programming in JavaScript and PHP, and so naturally I'm looking at Node.js solutions. I understand that real PLCs are programmed using Ladder Logic, but if I can avoid learning a new language, that'd be great. I've read here that with your latest RevPi image, you are including Node-RED out of the box. But I've had a hard time finding information on the forum newer than 5 months old about whether or not the community or KUNBUS has succeeded in developing a driver to let Node-RED talk directly with the process image on the RevPi Core. The most recent solution I've read here was to use the "piTest" program that comes with RevPi in a Node-RED node to read the state of the process image. A video tutorial on this would be much appreciated.
There are still some parts of the puzzle that aren't very clear to me. Some of these are general concepts which were unfamiliar to me until last week, such as ModBus. When I'm researching domotics and PLCs, ModBus is something I stumble across a lot, but I don't actually know if I really need ModBus functionality. I'm very familiar with MQTT, and I can easily see a home automation network working purely with MQTT. I believe I've read here that RevPi support MQTT as well. Actually, I'm not sure if that is only the RevPi Connect, or if all of them support it, which is another question I have: is there a comparison chart that compares Core, Core 3 and Connect modules? That'd be great.
All of this is still theoretical, and it's getting a bit crowded in my head
This is how I think my setup would work:
- Using a RevPi Core or Connect, a program runs every x milliseconds.
- A connected DIO module would allow me to control some equipment in the house. For example, the DIO module could control 14 relays, which turn on or off 14 different things in the house.
- All of the DIO module changes would be saved in the Core's process image. This is, I believe, the "source of truth" about the RevPi state, which I can use to read values from or write new values to.
- Every time the Core program runs (cyclically, every x milliseconds), I believe the process image should have the latest state of the RevPi.
- When the process image is updated, Node-RED would update its nodes which use the process image. This would be the starting point for many automations built with Node-RED.
- When anything (manual input, or automated process) causes Node-RED to change one of its outputs, it has to somehow (?) write the new state back into the RevPi's process image.
- The DIO module would receive this change from the core, I guess? Then it would change its outputs according to the new process image state.
- At no point would Node-RED try to read or write directly to the DIO module. This part is slightly confusing because there are some resources online that seem to imply to do that. From what I've read on this forum, that is anti-pattern; everything should go through the process image.
Basically, to automate my home in JavaScript, I think I'd need (to prototype):
- RevPi Core 3 (or Connect??)
- DIO module
- ... and nothing else, assuming Node-RED and MQTT are supported out of the box.