Lesson 5 Automation 2.0, Lesson 5, vector lighting control by sensors
Good afternoon, today I want to raise the topic of automation in the bathroom. This automation configuration was developed over the years, along the way of the idea and the need for use. Maybe someone will use some part of the lesson.
Let’s start a topic that will consist of the following sections:
- lighting;
- ventilation;
- towel warmer control.
Figure A shows a diagram of the device placement.
Figure A.
Devices in the bathroom:
1,2 - motion sensor;
3-opening sensor;
4,5-wireless switch;
6-smart socket (controls the towel warmer);
7,8- temperature (humidity) sensor;
9-exhaust fan (controlled by relay T1);
1,2 - Aqara smart lamp.
LIGHTING.
My bathroom lighting consists of two parts:
-main lighting;
-working lighting (turns on when needed).
Main lighting (lamp 2) is controlled by motion sensors (1,2) and opening sensor (3).
The main lamp is turned on by two methods.
The first is by the door (door sensor) + motion sensor (2);
“√1 Turn on main lamp 2”
WHEN (execute sequence)
- door open,
30 sec.
-there is motion (motion sensor 2)
iIF - lamp off (2)
THEN - turn on lamp (2)
Fig. 1
Note, to turn on the lamp by periods of the day (day, evening, morning), I used the method described in lesson 4, I will not repeat it.
The second - motion sensor (1):
“√2 Turn on the next lamp 2”
WHEN (any)
-there is movement (motion sensor 1)
iIF
- lamp (2) is off
THEN - turn on the lamp (2)
Fig2
For this automation, I used a modernized P2 motion sensor. I made the motion sensor a “perimeter control” of the door, limiting the “visibility” of the sensitive element (with masking tape) to the horizontal perimeter. I attached the sensor directly near the door, at the moment a person passes by it instantly triggers once (I set the sensitivity experimentally). This modernization helps to clearly track the crossing of the door and turn off the light instantly (I don’t like when there is a delay). Also, a cat lives in the bathroom (the cat’s bedroom), the light does not turn on when the cat moves.
Fig3,4,5 photo of the sensor.
“√1 Turn off standby lamp 2” (first automation)
WHEN (execute sequence)
-there is movement (motion sensor 1)
Pause10
-no movement for 1 minute (motion sensor 2)
iIF
- lamp on (2)
THEN - turn off lamp (2)
Fig6.
“√2 Turn off standby lamp 2” (second automation)
WHEN (execute sequence)
- door open (opening sensor 3)
Period 30 seconds - door closed (opening sensor 3)
Period 1min 10 sec
-No movement for 1 min (motion sensor 2)
iIF - lamp on (2)
THEN - turn off lamp (2)
Fig7.
Automation for false lighting in the bathroom of emergency execution (automation failure), switching off after 10 minutes.
“√3 Turn off the next lamp 2” (third automation)
WHEN (any)
- no movement for 30 minutes (motion sensor 2)
iIF - lamp (2) is on
THEN - turn off the lamp (2)
Fig.8
WORKING LIGHTING.
As a rule, in the bathroom there is enough regular lighting, but if necessary, you can turn on the lamp (1) using the wireless button (4). I use this lighting without time zones, mechanical On/Off from the button (4).
Fig. B. Bathroom switch
AUTOMATIC LIGHTING.
“On lamp 1”
WHEN (any)
- press button 1 (switch 4)
iIF
THEN
- On/Off lamp (1)
Fig. 9
For the forgetful, I also added a motion sensor for emergency shutdown of the lamp after 30 minutes.
WHEN (any)
- no movement for 30 minutes (motion sensor 2).
IF
THEN
- Off lamp (1)
Fig. 10
BATHROOM VENTILATION.
For this automation, I use an Aqara relay connected to the exhaust fan, the Aqara relay controls the humidity (temperature) sensors (7,8) and the wireless button 5.
Fig. B.
I placed one humidity/temperature sensor (sensor 8) in the shower, and the second sensor in the bathroom near the heated towel rail.
There are such automations: On the fan, if the humidity is higher than 90% on any sensor, turn on the exhaust fan, or turn it on manually (button 5).
In the IF conditions, choose any, this is in order to use two sensors.
Fig. 11
The automation of turning off the fan is triggered when the humidity reaches the specified parameter, 20 minutes after that. The shutdown delay is given so that the hood can be turned on for 20 minutes in manual mode. We turn on the hood, the humidity parameters are below the set, then there is a delay of 20 minutes before turning it off.
Fig.12.
TOWEL DRYER.
My towel dryer turns on on demand at night (the cheapest electricity). I programmed a four-button switch for four work zones (2,4,6,8 hours of operation), starting work at 11:00 p.m.
There are automations created for switching on according to time requirements, the automation is one-time, worked and turned off.
Fig. 13,14,15, 16
There is an automation that starts automations (13,14,15,16) from the buttons of the wireless (four-button) switch by pressing the corresponding button.
Fig. 17,18,19,20
To see that the automation has started, I turn On/Off the smart socket for 1 second for visual confirmation of the start.
An old-style switch for four channels, this is what it looks like near the towel dryer.
Figure 21
This concludes my lesson, if you have any questions, write to me. You can use certain elements from my example for your bathroom or other room.
Thank you for reading and sharing the topic (you can also share it on other platforms with a link to our forum).
To be continued.
Lesson 7. Automation 2.0, lesson 7. Controlling Aqara smart lamps using switches (wired and wireless)

























