FAQ - Can you show us your full set up?
Below is one of my bathrooms. I will show all my controllers (ESP32), sensors, setting along with the settings for my sensor light as it all works together. I will try an document as much as possible for you. If you need more information just let us know. It is a big read so maybe make yourself a coffee first.
NOTE: I am waiting on some parts as they have just been released and I am updating my systems. When I receive them I will update this post, so if your interested then maybe check back in in a few weeks.
The Controller And Sensors
All the items are from m5stack. I have spare controllers and sensors if they need to be replaced ASAP.
ATOM Lite ESP32 IoT Development Kit
ENV III Unit with Temperature Humidity Air Pressure Sensor
Dlight Unit - Ambient Light Sensor
PIR Motion Sensor
ATOMIC PortABC Extension Base
I2C Hub 1 to 6 Expansion Unit
The Bathroom
Below is one of my bathrooms. Note, the linear slot diffuser directly above the shower head, this is critical for the automation to work correctly. It is connected to my exhaust fan and sucks air over the sensor when the fan is ON. Inside this linear slot diffuser is my humidity sensor.
Below shows the LED lighting. They are separated into segments⊠the mirror, under the vanity and in the niche
Inside the linear slot diffuser the cable passes through into the cushion head. This cable is in the ceiling space where the ESP32 is plugged into mains power.
I have cut out one of the slots so the sensor finishes flush with the face of the linear slot diffuser. I also painted the cover of the sensor black to hide it and drilled some small holes in the other side of the sensor cover to allow for good airflow trough it.
Below is the sensor fitted to the linear slot diffuser.
Under the vanity is my LUX and motion sensor.
The code used in the ESP32 (atom light) and esphome
This is for the humidity sensor, temp sensor, LUX sensor, motion sensor, door sensor and the âManual Fan Switchâ.
## "#" = Item - "##" = Note - "###" = DEACTIVATED option
esphome:
name: bed2-ens
friendly_name: Bed 2 Ensuite
esp32:
board: m5stack-atom
framework:
type: arduino
# Enable logging
logger:
# Enable Home Assistant API
api:
encryption:
key: !secret encryption_key
# Over The Air Password (Stops somone on your network accessing files)
ota:
password: !secret esphome_secret
# Wifi Information
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
## Optional manual - Static IP
### manual_ip:
### static_ip: ?.?.?.?
### gateway: ?.?.?.?
### subnet: 255.255.255.0
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "bed2-ens"
password: !secret fallback_ap_password
# Captive Portal
## After 1 minute of unsuccessful WiFi connection attempts,
## the Atom Lite will start a WiFi hotspot (with the credentials from your fallback).
## Use your AP (Access Point WiFi) SSID & Password to connect then go to http://192.168.4.1/ in your browser.
captive_portal:
# This is for sensors plugged into I2C Hub 1 to 6 Expansion Unit - It can be tricky
i2c:
sda: 25
scl: 21
scan: true
sensor:
- platform: bh1750
name: "LUX Sensor"
address: 0x23
update_interval: 10s
- platform: sht3xd ## sht3xd is for a ENV III - sht4x is for a ENV IV
temperature:
name: "Bathroom Temperature"
id: bathroom_temperature
humidity:
name: "Bathroom Humidity"
id: bathroom_humidity
address: 0x44
update_interval: 60s
- platform: qmp6988 ## qmp6988 is for a ENV III - bmp280 is for a ENV IV
pressure:
name: "Bathroom Pressure"
address: 0x70 ## 0x70 is for a ENV III - 0x76 is for a ENV IV
update_interval: 60s
iir_filter: 2x
# This is for the physical switch on the wall and to allow for control in a HA dashboard
switch:
- platform: gpio
pin: GPIO23
id: bathroom_manual_control
name: "Bathroom Fan - Manual Control" # Link to the binary sensor below
icon: "mdi:fan-clock"
# The physical switch on the wall
binary_sensor:
- platform: gpio
pin:
number: GPIO33 ## Wire from this pin to the push button on the wall and back to ground on esp32
inverted: true
mode:
input: true
pullup: true
name: "Bathroom Fan - Bypass Wall Button"
icon: "mdi:gesture-tap-button"
on_press: ## on_press is for a push button switch. on_state is for a toggle switch. Choose on_state or on_press for the type of wall switch you have, you can only use one or the other.
then:
- switch.toggle:
id: bathroom_manual_control # Link back to the switch above
filters:
- delayed_on: 10ms
# For a motion sensor in bathroom
- platform: gpio
pin: GPIO19
name: "Motion Sensor"
device_class: motion
## You can add another "gpio" on pin 32. This can be used for a door contact sensor.
## I am not using a door contact sensor it is just there to show you how to use it if you require one.
## For me I am using this pin for another motion sensor located in the WIR to turn on lights.
- platform: gpio
pin: GPIO32
name: "Bathroom Door"
device_class: door
The Bathroom Humidity Exhaust Fan Blueprint Settings
Below are the main sensor settings for the automation. I dont have a fan with different speeds so nothing is entered into the 2 âInput - Fan Speedâ selections. If you have a fan with different speeds then you would enter them in here. I do use the âMaximum Humidityâ in the settings so I have entered in my humidity sensor into âInput - Bathroom Humidity Sensorâ.
Below are the main settings. I refer these setting as âSummer Modeâ but the are not labelled like that as it is just easer to read this way.
Below is to enable winter mode. I use it but you donât have to use it as it is an option.
Below are the winter settings.
Below are the light settings. I dont use them as I use my Sensor Light blueprint to control the lights with the âAutomation Link Optionâ.
Below is the manual fan switch settings. This is the switch I created in the ESP32 code and wired to a physical switch on the wall.
Below is the âAutomation Linkâ settings. This will be referred to later when showing my sensor light set up. I have set this to 2 minutes. This allow us to dry ourselves before the motion sensor is able to detect motion again once we move to the other side of the glass shower screen. I have created a toggle helper for this.
I have entered in a by-pass but realy donât use it now we have developed the manual fan switch.
The Sensor Light Blueprint Settings
Click here for my Sensor Light blueprint.
Below is the main settings. Trigger is the motion sensor under the vanity and in the ESP32. You can see my 3 LED lights entered in. The main light is controlled manually as we use the LED light most of the time and only turn ON the main lights when needed.
The light settings
The by-pass settings. This is where the automation link in the bathroom humidity exhaust fan blueprint controls and takes over this automation disabling it. I have selected to turn the lights ON as this allows it to work without ever knowing anything is happening. Note the by-pass time delay of 1 minute. This allows for when the by-pass is turned OFF for us to trigger this automation again before turning OFF the lights.
Sun options, donât use them in this automation.
This is the LUX sensor under the vanity and in the ESP32. Selected âYESâ as this sensor is affected by the lights.
Time options, donât use them in this automation.
Device tracker, donât use them in this automation.
Night Light main input settings.
Night lights, light settings for lower softer lights at night.
Night light conditions. 2 iPhones used to enable the night lights when they are in do not disturb.
And that is it . If you got this far you have done well
Hope this helps you set up your automations
Enjoy
Blacky
Back to FAQ: Click Here