Jump to content

MQTT smart home switch

So I hope her is someone who can help me out. I am planning to get into smart home with an Openhab controller and want to start with my lights. As I am in my flat for rent I can't change up the whole wiring so my plan would be to buy some of these sonoff switches and placing them in my fuse box to switch the according lights. But as I still want my wall switches to function I want to just buy an esp8266 board and just wire up the switch and send the request via MQTT to my OpenHAB controller which then tells the Sonoff via MQTT to switch the light on:
59fa11e329b0a_wallswitchplan.PNG.8650f225d9e1e0ec59a5b03717067488.PNG

 

So my question is if this would be an okay solution or if I am better off building everything from scratch (so that I have the esp8266 with the switch and an relais wired up behind the wall switch)?

Thanks for your help! ;) 

Main Rig

Spoiler

CPU - i7 6700 | RAM - 16GB (2x8GB) G.Skill, 16GB (2x8GB) Crucial OEM | GPU - MSI GTX 980 Gaming | PSU - Cooler Master G450M | Storage - 1x 256GB Samsung SM951 (NVMe)(System), 2x 500GB Samsung 860 EVO (Striped) | Case - Fractal Design Define R5 (with TG side Panel) | OS - Windows 10 Pro

NAS / Docker Host

Spoiler

CPU - Xeon E3-1220v3 | RAM - 16GB (2x8GB) Kingston ECC | PSU - Enermax Revolution SFX 550W | Storage - 3x 4TB WD Red, 1x 2TB WD Red, 4x 3TB Seagate Constellation, 2x 250GB Samsung 850 EVO (Cache) | Case - AVID Unity Media Engine (3U Rackmount) | OS - UnRAID OS Pro

VM Host

Spoiler

CPU - Xeon E3-1246v3 | RAM - 32GB (4x8GB) Samsung ECC | PSU - Enermax Revolution SFX 550W | Storage - 2x 512GB Samsung 860 Pro (System / "Fast" VM's), 4x 500GB HGST (RAID 10) | Case - Avid Unity MediArray XT (3U Rackmount) | OS - Windows Server 2019 Datacenter

Notebooks

Spoiler

Fujitsu Lifebook E756CPU - i5 6200U | RAM - 8GB DDR4 OEM | GPU - Intel HD 520  | Storage - 250GB Crucial MX500 | OS - Windows 10 Pro

Apple MacBook Pro Mid 2015 | CPU - i7 4770HQ | RAM - 16GB | GPU - Intel Iris Pro | Storage - 512GB Toshiba XG4 NVMe | OS - macOS 10.15.1

 

Link to comment
Share on other sites

Link to post
Share on other sites

In my experience, most of the time building it your self is about the same price as buying a sonoff product. Or the difference is very neglectable. For the ease of use, I would say go with sonoff (~$6). If you want to use more GPIO pins etc, go with a ESP-12E (~$3). And if you want to go to the cheap DIY route. Go with an ESP-01S(~$1).

The last 2 obviously need a power source (ESP12E a 5v supply (~$1) and ESP-01S 3.3v(~$1.50 for 10)) (And you obviously need a relay switch board, get a 5v operated one. 3.3v will still work ~$2)

If you want to be able to tell if the light is switched on. (Despite the state of the relay) you'll need something in the line of a non-invasive AC current sensor such as a SCT-013-000. You'll be needing additional components for it though. Such as a 3.5mm female jack, 33 ohm resistor, 10uF capacitor and a 10K ohm resistor. Schematics are widely available online. (For example http://www.homautomation.org/2013/09/17/current-monitoring-with-non-invasive-sensor-and-arduino/ )

 

This would make your system a little bit fancier, as you can actually let the ESP check if any current flows, thus if the light is on.

Main RIG: i7 4770k ~ 4.8Ghz | Intel HD Onboard (enough for my LoL gaming) | Samsung 960 Pro 256GB NVMe | 32GB (4x 8GB) Kingston Savage 2133Mhz DDR3 | MSI Z97 Gaming 7 | ThermalTake FrioOCK | MS-Tech (puke) 700W | Windows 10 64Bit

Mining RIG: AMD A6-9500 | ASRock AB350 Pro | 4GB DDR4 | 500GB 2.5 Inch HDD | 2x MSI AERO GTX 1060 6GB (Core/Memory/TDP/Avg Temp +160/+800/120%/45c) | 1x Asus Strix GTX 970 (+195/+400/125%/55c) | 1x KFA2 GTX 960 (+220/+500/120%/70c) | Corsair GS800 800W | HP HSTNS-PD05 1000W | (Modded) Inter-Tech IPC 4U-4129-N Rackmount Case

Guest RIG: FX6300 | AMD HD7870 | Kingston HyperX 128GB SSD | 16GB (2x 8GB) G.Skill Ripjaws 1600Mhz DDR3 | Some ASRock 970 Mobo | Stock Heatsink | some left over PSU  | Windows 10 64Bit

VM Server: HP Proliant DL160 G6 | 2x Intel Xeon E5620 @ 2.4Ghz 4c/8t (8c/16t total) | 16GB (8x 2GB) HP 1066Mhz ECC DDR3 | 2x Western Digital Black 250GB HDD | VMWare ESXI

Storage Node: 2x Intel Xeon E5520 @ 2.27Ghz 4c/8t (8c/16t total) | Intel ServerBoard S5500HCV | 36GB (9x 4GB) 1333Mhz ECC DDR3 | 3x Seagate 2TB 7200RPM | 4x Western Digital Caviar Green 2TB

Link to comment
Share on other sites

Link to post
Share on other sites

On 2.11.2017 at 1:56 PM, Aelita Sophie said:

In my experience, most of the time building it your self is about the same price as buying a sonoff product. Or the difference is very neglectable. For the ease of use, I would say go with sonoff (~$6). If you want to use more GPIO pins etc, go with a ESP-12E (~$3). And if you want to go to the cheap DIY route. Go with an ESP-01S(~$1).

The last 2 obviously need a power source (ESP12E a 5v supply (~$1) and ESP-01S 3.3v(~$1.50 for 10)) (And you obviously need a relay switch board, get a 5v operated one. 3.3v will still work ~$2)

If you want to be able to tell if the light is switched on. (Despite the state of the relay) you'll need something in the line of a non-invasive AC current sensor such as a SCT-013-000. You'll be needing additional components for it though. Such as a 3.5mm female jack, 33 ohm resistor, 10uF capacitor and a 10K ohm resistor. Schematics are widely available online. (For example http://www.homautomation.org/2013/09/17/current-monitoring-with-non-invasive-sensor-and-arduino/ )

 

This would make your system a little bit fancier, as you can actually let the ESP check if any current flows, thus if the light is on.

Wow thank you for your detailed answer! Unfortunately I think I'll put this project on hold first because I won't be a lot at home till 2018 and I will probably move again because my company is moving.. But if I am ready to yustomize my rooms with smart home, I'll consider your recommendations! ;) 

Main Rig

Spoiler

CPU - i7 6700 | RAM - 16GB (2x8GB) G.Skill, 16GB (2x8GB) Crucial OEM | GPU - MSI GTX 980 Gaming | PSU - Cooler Master G450M | Storage - 1x 256GB Samsung SM951 (NVMe)(System), 2x 500GB Samsung 860 EVO (Striped) | Case - Fractal Design Define R5 (with TG side Panel) | OS - Windows 10 Pro

NAS / Docker Host

Spoiler

CPU - Xeon E3-1220v3 | RAM - 16GB (2x8GB) Kingston ECC | PSU - Enermax Revolution SFX 550W | Storage - 3x 4TB WD Red, 1x 2TB WD Red, 4x 3TB Seagate Constellation, 2x 250GB Samsung 850 EVO (Cache) | Case - AVID Unity Media Engine (3U Rackmount) | OS - UnRAID OS Pro

VM Host

Spoiler

CPU - Xeon E3-1246v3 | RAM - 32GB (4x8GB) Samsung ECC | PSU - Enermax Revolution SFX 550W | Storage - 2x 512GB Samsung 860 Pro (System / "Fast" VM's), 4x 500GB HGST (RAID 10) | Case - Avid Unity MediArray XT (3U Rackmount) | OS - Windows Server 2019 Datacenter

Notebooks

Spoiler

Fujitsu Lifebook E756CPU - i5 6200U | RAM - 8GB DDR4 OEM | GPU - Intel HD 520  | Storage - 250GB Crucial MX500 | OS - Windows 10 Pro

Apple MacBook Pro Mid 2015 | CPU - i7 4770HQ | RAM - 16GB | GPU - Intel Iris Pro | Storage - 512GB Toshiba XG4 NVMe | OS - macOS 10.15.1

 

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×