How to Make Smart Home a couple of hours
Do It Yourself A Life / / December 19, 2019
Not long ago, notorious Leonid Kaganov in his blog talked about how to gratify the soul of the hardcore DIY-box. If you want your hack and more benefited in your same house, described below system for remote control of light in the house - an excellent lesson for the weekend. The idea of a smart home is here, and realize it is not expensive!
Well, you know, I'm a fan of the idea of "smart home", the first diploma electronics and so sometimes miss a soldering iron. Today, therefore, I tell you interesting and useful things. Readers diary - electronics companies from Belarus "NOOTEHNIKA" sent me several electronic switches that I immediately began to throw out all over the apartment. This is a series of electronic devices that the Belarusian electronics ahead of the price / quality of Chinese development.
The idea is to include (or regulate) light remotely from the special panels, which can be pasted anywhere without wires. And somewhere near the lamp is installed in a hidden place a small box-switching actuator.
The devices are supplied in boxes of such a design:
Pultik looks. In the pictures it considers Stas and drove to visit a musician Kostya Arbenin. The remote can be pasted anywhere in the apartment - there is a lithium battery, enough for years:
Switch itself - it is a small box with antenkoy and four wires: two in the network, two to the light bulb. The picture shows a switch for incandescent lamps SN111-500 - up to 500W (there are 5000Vt), it adjusts the brightness. Superficially similar, but plastic (without aluminum side) - switches for fluorescent lamps. Science Physics leaves no possibility to adjust the brightness of fluorescent lamps, but they can just turn on or off.
The first task that I decided in the house - it is an additional arrangement of the light switch in the bathroom for four Stas. Because standard switches in the houses of the Soviet bookmarks for unclear reasons, placed on such height that the light does not turn the child, but only to run and scream, "Mom, Dad, I turn on the light in bath ":
Our standard three-key switches are convenient in that they held within the socket, so there is much to turn the switching unit. Connect, configure:
Setting up is easy. Detailed instructions will not quote, but the point is that you should press the button inconspicuous (compression of the body) and go to the console binding regimen. A similar button on the remote and there. Any console can be assigned to any device, not just one. All together it still allows you to set the scenario, such as the remote at the front door, switch on / off at once all the lights in the apartment. Binding devices independent of the energy disruption and continue for years. What is a "script"? Let's say you have all the rooms are equipped with electronic switches and door panel PU212 (or pocket keychain PN313). There is a button "script". Install the light in the right state - the kitchen is on, off in the bathroom, deduce in the room the average brightness level, and then hold the button the script a few seconds (until the lights are not blink). Now, when he comes home in the evening, in the darkness, you can still push the door with the remote scenario button (or at the door in the hallway), and the light at all locations will be so, as it should.
Once strapped remote - and everything pushes the device into the slot (fortunately for standard three-key switches, such a gap is).
Dear Stanislav Leonidovich! Since you are a small yet growing, we have made you a single light switch in the bathroom (you guessed it, I simply connected in parallel with the corresponding key). Choose, Stanislav, where you will be easier to stick it to himself turn on the lights? The child chooses... to stick in the bathroom itself. I honestly tried to explain to him that this is not the best place (although I've seen in my life, and so on). I explain: it is better to hang on the outside, so as not to run into the darkness and look for the touch switch. But Stanislav Leonidovich was adamant: I want, said in a bath here, and only here. I find touch, and as darkness - so I'm not afraid of it! Proud. Well - it's yours. The opinion of the young man respect:
The next task - Equipment chandeliers. The chandelier I have long standing energy saving, and the light can be gradually reduced, adding even a small light bulb, mignon. Run in the light of 200 volts and set the two switches. One fluorescent, it will turn on and off them. The other - for incandescent lamps, it will adjust the brightness of the EP:
Boards can now be glued to any convenient place (and even duplicate), forgetting all the problems of wires like a bad dream. And we still have NooLite and portable version of the console - Keychain:
By the way, the range of a large - enough to manage the apartment or office. During the experiments, I went with the remote control for a couple of floors above, but worked from there. Because he was in slippers, above shove was too lazy, so that the exact radius of the I do not know, but one thing is clear - it is quite sufficient. Inside all of these pieces is quite clever shemka. It deals not only with the inclusion of blunt, but still remembers the state and makes other minor services. For example, you unscrewed the brightness to the minimum (all extinguished), and then all turned off (off - a special button, each time not to re-adjust brightness). But the next time some brightness to give you? What you set in last time - complete darkness? So it will be unclear, it turns on the light or not. Therefore, in this case, still the light is switched on for at least - to show that it is at a minimum. In this simple example, we can see that the creators have thought through a lot of small things.
Price for "Remote + switch" on average, a little less than 1000 rublesThat is very nice for such a thing. I remind the manufacturers' websites: http://noo.com.by.
Cons - not found. There's a bit unusual delay of half a second: you pressed the button, and the light is not turned on at the same moment. But it's a question of habit. Similarly, a matter of habit themselves sensor switches. And here I would have offered the developers think of a series of circuit breakers with a different design. Not to mention the color, shape, it would make sense to do a series of switches with more ergonomic buttons. Still, flat sensors without running a finger - a style of high-tech. And perhaps many housewives and householders prefer convex convenient buttons that would significantly pressed or clicked. And of course adjust the brightness would make sense to do (as the design option) not two buttons, and a large comfortable wheel. But it is so idea.
PS: Developers, by the way, tell you a secret that is now being prepared USB-console model, working on the computer. And I of course immediately hands itch to carry out long-held dream - voice control.
USB-breaker until the sale yet, but I wondered what in the world is for voice recognition. And I found a Google release the API, through which collected while playing music on-demand system. For example, if you say "Music Autumn", the system will get into my music archive, there will choose all the songs with the word "fall" in the title and start playing them. Working! Last night, the whole day I am talking to the microphone. However, from a distance of several meters from the microphone notebook disassemble it ceases to Google. And does a lot of errors. For example, I did not manage to get him to play a song with the word "spring" - he translated as "auto" and ran to the playlist does not Once all the tracks with the words "Automatic", "bus", and 2000, but the tracks from the folder "author's song and chanson," which turned out to be quite unbearable. It was bad, and the English language. Of course, I realize that my accent is terrible, but to identify «Jesus Christ Superstar» as a "prostitute" - yes you, Google, ultraboundary scoffer. Who cares, I experimented with this yesterday, below skriptik (for Linux). I really hope that in the next five years the voice recognition will be actively improved and USB-breakers will be used;)
Speech Recognition The bottom line is that Google has some API ' https://www.google.com/speech-api/…’, to which the POST method you can send the audio clip of a special format, and in return (json) to get recognized words. Actually, our task - to recognize the sound of the silence, convert it to an audio file to send to Google, receive and process the response. To begin with I found in Linux desired applets:
sudo apt-get install sox flac php5-curl php5-cli
Doing such a basic file voice.sh, it makes all the operations and launches player xmms:
#! / Bin / bash
while [true]; do
rec -c 1 -r voice.wav silence 16000 1 3 0.3% 1 0.3% 3
flac -f -s voice.wav -o voice.flac
play voice.flac
text = `php google.php`
echo 'Google:' $ text
res = `php music.php $ text`
echo $ text $ res >> log.txt
if [ "$ res" = "OK"]; then xmms list.m3u; fi
done
But support. The program google.php sends Google voice.flac file and obtains the recognized response:
#! / Usr / bin / php
'@ Voice.flac'));
curl_setopt ($ ch, CURLOPT_URL,
' https://www.google.com/speech-api/v1/recognize? xjerr = 1 & client = chromium & lang = ru-RU ');
curl_setopt ($ ch, CURLOPT_HTTPHEADER, array ( 'Content-Type: audio / x-flac; rate = 16000 '));
curl_setopt ($ ch, CURLOPT_RETURNTRANSFER, 1); $ R = curl_exec ($ ch); curl_close ($ ch);
$ Json = json_decode ($ r, true);
if (empty ($ json [ 'hypotheses'] [0] [ 'utterance'])) die ( '');
die ($ json [ 'hypotheses'] [0] [ 'utterance']);
?>
The program music.php (after the hassle of encoding) looks, whether in the text of the first word "music", and if so, is looking for the right words among the music files in the archive in the name of the playlist:
#! / Usr / bin / php