My Smart Home Build

I suppose there is no harm in that. Here are some exterior pictures


A few interior
Patio

Great Room

Garage (1,800 sq ft, my favorite room in the house :grin:)

Our builder has some other pics on his website from when the house was almost done. We are missing our big fridge and backsplash in these pics, but I think most of the other stuff was done.
http://www.arkoscustomhomes.com/scenicview.html

5 Likes

Absolutely amazing! Dream home!

1 Like

@bphillips921 your project is great, cheers!

I have a question: where did you buy these screw terminals?:

I got them on Amazon

1 Like

@bphillips921 I have another question, if I may.

You wrote:

I use a 8 channel relay and ESP32 with ESPhome to automatically switch to the TV as an input when the TV is playing.

Can you write more - what exactly the relays are connecting?

I.e. can you achieve that your audio source #1 is playing on speaker A, while at the same time source #2 plays on speaker B?

Maybe you could share the schematics?

Thank you!

I’ll do my best to explain it. It gets a little messy.

First, the parts needed.
3D printed case

ESP32

8 channel relay

RCA keystones

RCA terminals

ESPHome Code

esphome:
  name: rca_switch
  platform: ESP32
  board: nodemcu-32s

wifi:
  ssid: "Basement_AP_IoT"
  password: "PASSWORD"
  #Static IP
  manual_ip:
    static_ip: 192.168.1.111
    gateway: 192.168.1.1
    subnet: 255.255.255.0
  #Turn Off Power Save Mode
  power_save_mode: none
  fast_connect: on

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Rca-Switch Fallback Hotspot"
    password: "sSN6czO4UzZa"

captive_portal:

# Enable logging
logger:

# Enable Home Assistant API
api:

ota:
  password: "PASSWORD"


switch:
  - platform: gpio
    pin: GPIO23
    name: "Garage Speaker Switch-Right"
    icon: "mdi:speaker"
    restore_mode: ALWAYS_OFF
    inverted: true
  - platform: gpio
    pin: GPIO22
    name: "Garage Speaker Switch-Left"
    icon: "mdi:speaker"
    restore_mode: ALWAYS_OFF
    inverted: true
  - platform: gpio
    pin: GPIO21
    name: "RCA 3"
    icon: "mdi:speaker"
    restore_mode: ALWAYS_OFF
    inverted: true
  - platform: gpio
    pin: GPIO19
    name: "RCA 4"
    icon: "mdi:speaker"
    restore_mode: ALWAYS_OFF
    inverted: true
  - platform: gpio
    pin: GPIO18
    name: "RCA 5"
    icon: "mdi:speaker"
    restore_mode: ALWAYS_OFF
    inverted: true
  - platform: gpio
    pin: GPIO5
    name: "RCA 6"
    icon: "mdi:speaker"
    restore_mode: ALWAYS_OFF
    inverted: true
  - platform: gpio
    pin: GPIO17
    name: "RCA 7"
    icon: "mdi:speaker"
    restore_mode: ALWAYS_OFF
    inverted: true
  - platform: gpio
    pin: GPIO16
    name: "RCA 8"
    icon: "mdi:speaker"
    restore_mode: ALWAYS_OFF
    inverted: true

Here is the wiring schematic. One relay will control 2 inputs and one output. So, for stereo sound left and rigth you will need two relays.

  • Connect the “-” terminals for all 3 RCA jacks on each speaker side (RCA input 1 Left, RCA input 2 Left, and RCA output Left). Repeat for right inputs and outputs.

  • Connect the RCA outputs to the middle “common” terminal on the relay. Connect the left output to one relay and the right to the other

  • Connect RCA input 1 to the “NC” on the relay. Connect the left to one relay the right to the other.

  • Connect RCA input 2 to the “NO” on the relay. Connect the left to one relay the right to the other.

With this setup you can individually trigger the left and right relays, so you could have input 1 playing through the left speaker and input 2 playing through the right. I use my script in HA to always change GPIO23 and GPIO22 at the same time so that both speakers play the same input. You could also hardwire this by soldering a “Y” wire that goes from one GPIO pin on the ESP32 to 2 input pins on the relay that you always want to switch together.

Hopefully that helps.

Thank you.

So in your drawing the “Output L” and “Output R” are two speakers. What are the “Input 1” and “Input 2” - are they two separate physical amplifiers?

How do you add a 3rd, 4th, more speakers to the same Input? (e.g. you want to broadcast a message to all speakers in the house).

The “Output L” and “Output R” are RCA outputs. They plug into the input of an amplifier. The speakers plug into the amp output. So it goes: Input audio device (chromecast, tv, etc) > RCA switcher > amp > speakers.

The “input 1” and “input 2” can be any audio device that uses RCA. In my case, input 1 is a Chromecast device (chromecast device is plugged into an HDMI > Audio extractor) and input 2 is the TV in my garage.

You could “Y” the output L and output R into multiple amp inputs then hook the speakers into those amp channels. For example, I use this amplifier. Each channel handles 1 speaker and there are 2 channels per zone. So, if I wanted two speakers in the garage and two speakers in the living room to always play the same thing I would “Y” the output L and output R cables from the RCA switch box into zone 1 and zone 2 input. Then I would hook the garage speakers to zone 1 and living room speakers to zone 2. Or, in the case of my amp I linked to, it has 2 Bus inputs. So I could hook my output L and output R to the Bus 1 in on the amp then set zone 1 and zone 2 to use bus 1 as the input source.

1 Like

This was great to read. Thank you for sharing your journey and definitely giving me ideas of what to do next. It took me 5 years to make my home smart, slowly and gradually buying different things. Please keep sharing your updates or if any of the things you used didn’t work out. I am actually thinking about buying few of the hard-wired sensors you used.

Also how long did it take you to set all the things you mentioned? I am very curious.

Incredible work Brad thanks for sharing.
One little question, when connecting your esp32 to the relay board aren’t you using a shift level? The esp32 outputs are 3.3V and the relay board is fored with 5V signals, I’m I right?

It’s hard to put an exact time frame on it, mostly because it’s a work in progress and always will be. I’d say the system was 95% operational within 4 months of moving in. But, I was also preoccupied with moving in, working full-time, and helping my wife raise a 3-month-old and 3-year-old.

During construction, it took me 9 full days to pull all the wires and conduit. It took two and half more full days to terminate all the wires at both ends. After that, a lot of the implementation into HA was a couple of hours at night for several weeks. I already had the ESP/Opto-coupler boards built and code written, so that helped.

I’d say if the wires are all pulled and all that was left was to terminate them and add everything to HA it could be done in 40 hours.

The ESP32 boards have a 5v output. I’m using that.

Yeah no I meant the digital outputs of the esp32. You will be driving each relay in your relay board with the 3.3V digital outputs, ex GPIO23, 22, 21, etc. So wouldn’t you need a level shifter to convert to 5V?

I’ve never needed one. I just hook the 5v and gnd from the ESP to the relay board then hook a GPIO to each relay. It’s been working great.

I did accidentally hook the 3.3v from the ESP to a relay once. It would sometimes flip the relay and sometimes not. Once I realized I had it hooked up wrong and I correctly hooked it to the 5V on the ESP it has always worked.

Strange, I always have to put a shift level, otherwise the 3.3V output from the nodemcu board is not enough to trigger the relays. Must be related to your relay board model.
To avoid this I recently changed my relay board to this model: LILYGO® T Relay ESP32 5V Relay Module 8 Channel With Optocoupler Isolation Wireless Development Board WIFI Bluetooth For Arduino| | - AliExpress

Hi Phillips, Nice writeup and thanks you so much, my question is do I have to use Optocoupler? I was thinking if I can use ESP32 internal pulup voltage for 20 door and windows contact, is it possibible?

I originally tried that and I had some issues with false triggers. I think the long wires were picking up interference and messing with the GPIO inputs.

Thanks for your quick reply, the Optocoupler should be Output PNP or NPN?

I used an NPN

https://www.aliexpress.com/snapshot/0.html?orderId=8142150791363875

Thank! I will get NPN
The link you sent does not work maybe it is country restricted?