Smart home with arduino

I'm planning to have home assistance with Raspberry Pi, and I'm thinking of putting an Arduino or a similar board (esp32) in every room and connecting Raspberry Pi with these boards with a Cat5 cable. Then, I will connect some sensors, like temperature, to these boards.
First question is, is it okay to connect Raspberry Pi to a switch and then to multiple Arduino boards?
Don't want to put wifi board in every room, so trying to find a no wifi solution.

Second, I have a wall switch that turns on and off the room lamp. If I put a cable (I'm thinking about cat5) from Arduino to a wall switch, then connect the lamp to a 5V relay, I can control the lamp with Arduino. Cat5 cable has 8 wires. I can use 3 to power and control a 5V relay, and the other 2 connect to a wall switch, so I can turn on the light with the switch but turn it on with Arduino, or turn it on with Arduino if I connect a motion sensor, and turn it off with a switch.

Does it work? Do you know a better solution? I can put a different wire from Arduino to a wall switch, but as I know, the cat5 is better because it has a twisted pair, and FTP has a shield to reduce interference.

Thanks

Just do it like home assistant is designed for. You use Esp boards with esphome firmware.
You say, don't want wifi in every room. Why?
You can use Esp boards with ethernet. Or BLE.

Yes, I can use W5500 and connect ESP to Ethernet. But what about the lamp control? I know there is a Shelly device, but then I have esp with wifi and an in-wall switch wifi/ble. if I put more devices, there will be 3-5 wifi devices in a room. Right now I can put Cat5 or other cable from ESP to the switch and control it.

Welcome to the forum

What is your objection to using WiFi, which the ESP32 has as standard ? No extra hardware required

Connect Raspberry Pi to ESP with wifi it's ok for me. I ask because one or more esp will be far away from HA, so I'm thinking of putting a cable to it.
Talking about the switch, I know I can add Shelly to the system, and it works, but it's a new house and I can put cables. It's quite easy to do it right now, and for me, it looks better to have cable, not 5 wifi devices in the bedroom.

If you use 5 ESP32s in the bedroom then you will have 5 WiFi devices whether or not you use the WiFi. Do you really think that connecting Ethernet cable to 5 devices will look better than 5 WiFi devices ? Bear in mind that each Arduino/ESP32 will need a board to connect the cable to

In any case, what do you envisage these 5 devices in the bedroom doing ?

No I'm planning to put one esp to each room. Let's say bedroom.
I connect all the sensors in this room to this board, and I want to connect the lamps to the same esp.
So if I turn on the switch, the esp turns the light on, the switch did not directly turn the light on.
If I put a motion sensor, I can turn on the light with it, or turn on the light at 30% brightness, and with the switch I can turn in light to 100% or turn it off. The same, I want to connect the electrical curtains to the ESP so I can open or close the curtains with esp.
i can put all the cat5 cable inside the wall, so one end will be connected to the ESP, and the other goes to a device like a wall switch or curtains.

As I look right now, I can put Shelly inside the wall switch then connect it to HA, and I can control the lamp with it (1 wifi). Then put one next to the curtains (second wifi) and to other. I'm thinking maybe is better to put cable as I have I chance now and when the house is finished, if I want to add a new smart device, I can connect it with Wifi anytime.

I always recommend that you start with an existing Home Automation Protocol. They work without re-wiring your home and things this dimmer switch are VERY difficult to build yourself. This kind of dimmer-switch works remotely or manually and even if you can build it, it will probably cost more to build. And if you want to add a controlled light or outlet, etc., later you can just order it which is a lot faster than building something.

I have a Z-Wave system with a programmable hub and abut 10 controlled lights & outlets. The hub runs stand-alone to turn-on lights at night, or I can use Wi-Fi with my laptop. My setup can't be accessed over the Internet, but that could be added.

Most of these protocols (including Z-Wave) don't work directly with Wi-Fi. The Wi-Fi goes to the hub and then a different protocol sends a message to the lights/outlets.

I chose Z-Wave because at the time there was more "stuff" available.

The only part that I built myself is a "sunrise dimmer" and "wake-up system". I have a Z-wave outlet that the thing I built plugs-into, so the home automation system takes care of the clock and day-of-week stuff and my gizmo just has to fade-up a light over 10-minutes and then beep gently.

Then why did you say

Using you plan you could connect to a single ESP32 using WiFi and use it to control 5 things in the room. Having said that, whether you use WiFi or cable the wiring from the ESP32 to the devices is not going to be easy

You can use ethernet cable or wifi extender.
WT32-ETH01 is economic Esp32 board with ethernet.
Also every Shelly can be used as extender.
Everything is connected to local network, not directly to Pi.

I am doing something similar. WiFi is not reliable so I chose doing it with a CAN network. There is external interference that I cannot control.

Only 4 conductors required, power ground CAN-H and CAN-L. Each node will control several devices. This is being used to replace a 24V wired system that has been in place for over 20 years.

As others have said, use ESPhome with a WiFi network that you have extended to the whole property, using wired or wireless access points. Building a robust WiFi infrastucture makes everything else that follows less complicated and more reliable.

Also with Home Assistant and ESPhome you don't need Arduino skills. It's mostly about editing configuration files that are used to generate code that is compiled and then runs on the microcontroller.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.