https://youtu.be/FwSEqPfgRTI

The BHonofre is a tiny wifi switch with 2 relays that is made to fit inside a switch box.  It is not UL listed, so in the US you are taking on some risk if you use it this way. One thing I love about it is they give you easy access to all the other GPIO pins on the wifi chip, so it is easy to connect other devices and sensors.  On this one I’m using 2 capacitive touch sensors, one PIR Motion Sensor and a Dallas Temperature sensor. The firmware it comes with is pretty good, and comes ready to use with MQTT and Home Assistant or your Smart Home hub of choice. Since I already installed one with the stock firmware, this time I decided to exchange the firmware for an ESPhome sketch.  The BHonofre is one of a new breed of tiny, dual relay, smart switches that includes the new Sonoff Mini, the Shelly 2.5 and some other lesser known brands. I expect we’ll be seeing more switches like this that easily allow you to make your existing “dumb” light switches more smarter. 

BHonofre:

https://bhonofre.pt/buy-onofre.xhtml

https://github.com/brunohorta82/BH_OnOfre

ESPhome Yaml file:

esphome:
name: main_bathroom
platform: ESP8266
board: esp01_1m
wifi:
ssid: !secret wifi
password: !secret wifi_pw
# Enable logging
logger:
# Enable Home Assistant API
api:
ota:
switch:
- platform: gpio
name: "Main Bathroom Fan"
pin: GPIO5
id: relay_2
- platform: gpio
name: "Main Bathroom Light"
pin: GPIO4
id: relay_1
binary_sensor:
- platform: gpio
pin:
number: GPIO12
mode: INPUT_PULLUP
inverted: True
name: "Main Bathroom Light Button"
on_press:
- switch.toggle: relay_1
- platform: gpio
pin:
number: GPIO13
mode: INPUT_PULLUP
inverted: True
name: "Main Bathroom Fan Button"
on_press:
- switch.toggle: relay_2
- platform: gpio
pin: GPIO02 #D4
name: "Main Bathroom Motion"
device_class: motion
on_press:
then:
- switch.turn_on: relay_1
dallas:
- pin: GPIO16
id: main_bath_temp
sensor:
- platform: wifi_signal
name: "Main Bath WiFi Strength"
update_interval: 300s
- platform: uptime
name: Main Bath Uptime
- platform: dallas
address: 0x070218313278FF28
name: Main Bathroom Temp

 

Capacitive Touch Buttons:

Amazon: https://amzn.to/2SH85L5

AliExpress: http://s.click.aliexpress.com/e/bWyM9Jpm

Banggood: https://drzzs.com/CapTouchButtons

 

PIR Sensor:

Banggood – https://drzzs.com/BruhPIR

Amazon – https://amzn.to/2EiUJi5

AliExpress – http://s.click.aliexpress.com/e/cfginXC8

 

Dallas Temperature Sensor:

Banggood: https://drzzs.com/DallasTemp

Amazon: https://amzn.to/2LQzJor

AliExpress: http://s.click.aliexpress.com/e/ci6SKE0Y

 

Resistor pack:

AliExpress: http://s.click.aliexpress.com/e/b0S4CMlE

Amazon: https://amzn.to/2LJ3xmM

Banggood: https://drzzs.com/Resistors