Switches for control in a smart home

Today I again had a bad light in the corridor, in order to control it, I have a wired switch from the zero line. I bought a switch with three buttons, but I really use one, because I immediately had only a single-wire circuit for turning on the light.

I automated turning on the light using a motion sensor from Xiaomi, it stands near the front door. I also use the door opening sensor, this is not a Zigbee sensor, the 433 megahertz sensor works on the radio frequency, when opening the door, I check whether movement was recorded on the motion sensor, if there was no movement for a long time, then when opening the door, the light in the corridor turns on. Further, if there was no movement, then after a minute the light turns off.

Several times I have already made remote control of the corridor light, this is convenient when I want to turn on the light from another room or when I want to turn it off, if for some reason the light does not turn off. Sometimes it happens that the motion sensor for some reason does not detect people, or the signal simply did not pass to the smart home server, and in this case, too, the light in the corridor is triggered and turned on, which is not very convenient.

To control the light, I use wireless switches, most of them are switches operating at a radio frequency of 433 megahertz, they are quite cheap and work for a very long time on a single battery. There are several switches that use a 12 volt battery and there are several other switches that run on a CR 2032 battery.

Switches that I bought earlier and which are powered by a 12 volt battery. They have an additional useful function-multiple keystrokes, in which case the signal is sent for different combinations, this is if I have a three-button switch, then each button and all combinations of keystrokes, 1-2, 2-3, 1-3 or all at once. Thus, it turns out that about 7 different scenarios can be performed, which is quite convenient.

A wi-fi switch is installed in the corridor, it has another option, it can pair with a switch operating at a frequency of 433 megahertz, I bought them in pairs they have the same white design, I tied the wireless switch to the switch in the corridor, so you can turn on and off the light much faster, because the 433MHz switch does not use any gateways, does not use wi-fi and zigbee, it connects directly to the switch installed in the corridor, and the switch in the corridor when triggered already gives its status to the smart home system, this way I know exactly what triggered turning the light on or off and what state the light is in right now.

In principle, you can bind any switch that operates at a frequency of 433 megahertz, it can be keyfobs if available, or it can simply transmit a signal directly from the smart home system. For example, I use a universal gateway that I made based on esp8266, it uses a 433MHz transmitter and also has a receiver, and there is also an infrared receiver so that you can control it using a regular infrared remote control. This way I can just send a 433MHz signal to a switch in the corridor and it works instantly without any delay.

I also have several switches that work with the zigbee protocol, I bought them quite a long time ago, but I didn't like them, the main problem is that for some unknown reason these switches sometimes lose connection with the Zigbee stick and start trying to connect for a very long time and continuously and blink the LEDs and quickly drain the battery, since the battery cr2032, then of course it lasts only for a short time, I have one switch worked for several days, the other for about a month. I don't have a Tuya gateway and haven't tried flashing them. But it looks like the problem is more hardware.

I recently bought another similar switch for a trial from another manufacturer, the diagram showed that it was made more correctly, there is a chance that it will work longer. It also uses a CR 2032 battery, I connected this switch, there have already been several cases when communication with the zigbee stick disappeared, this switch does not blink for a long time with LEDs, it only blinked for about a few seconds and then went into standby mode, so it certainly does not drain the battery and still works.

In these switches, there is a plus in that each button can be used in different ways, there are several modes: single tap, double tap and hold. Of course, these switches do not work instantly, because they expect either a double tap or a hold. A typical switch uses a small delay of about 200 milliseconds, but this is not critical, and in principle, if these switches are used in scenarios, they work quite quickly.

I also use wireless buttons. I have a button from Xiaomi, it has several modes of operation, there are many more of them than the switch, that is, it is a single press, double, triple, and so on, supported in my opinion about 6 or seven clicks maximum. And there is also a hold that triggers and sends a signal that the hold has started, the hold has ended, and the time of the hold.

Of course, I tried using the hold time in the script. But this is almost impossible, because the processing is done at the software level of the stick and sometimes it happens, you can hold the button for 6 seconds, for example, and only show that the hold was two seconds.

I also have a dimmer from Yeelight on BLE for wireless control devices, I really liked the dimmer, the only thing that is very difficult to integrate with it is to install a special application for the MiHome ecosystem and get a key through it to control this dimmer via BLE, but when everything is already configured, it works quite well, it supports a lot of different functions are turning left to right, this is pressing, and pressing can also be sent as much as you want and I don't even know what the limit is. There is also the possibility of turning left to right when the button is pressed when the button is pressed, and when sent to the smart home system, the dimmer sends a signal showing how much it was turned and in principle this is very well and easily processed, and you can accurately understand even if the signal passes with a certain delay, about a second or two, but calculate how much the dimmer was turned and perform the correct action. The switch itself does not send a signal all the time, there is an LED that shows when the transmission occurs, that is, if I press the button several times, the transmission is actually performed only at the very end.

The switch takes quite far, I have a Raspberry smart home server in the next room, but it is located in a metal case, and even despite this, the switch works quite reliably. Now I have a dimmer used to control a smart lamp, this is an LED lamp on esp8266 and an LED matrix is used. The dimmer allows you to turn the lamp on and off, change the brightness of the lamp and change the operating modes of this lamp.

Automation in a smart home should be useful and create additional comfort, but sometimes everything goes wrong… The reasons for this, and how to configure everything, see on my channel.

You may also watch

Article By Alex

If you have any ideas on how to improve automation, make it more reliable, fast and useful, then you can leave a comment below. I will try to implement the proposals and tell you in the following videos.