Voice control of the smart home on the Z-wave via Siri
The idea to control the smart home with the help of voice commands was born a long time ago. And in some systems one way or another it is implemented. Siri is a good and convenient voice assistant for iPhone owners. Understands human speech, comfortable. But due to the closed protocol, it is not used for voice control of “smart” devices. It’s good that Apple has HomeKit, a kind of “tunnel” for receiving commands from Siri smart devices.
In this article I will describe the process of installing and configuring a gateway for Siri to interact with home automation devices and will talk about some features of different versions. My main controller of a smart home is Vera3. Manages respectively any Audio / Video components and Z-wave devices. Well, the "magic wand" will be the VeraHomeKitBridge Node-JS app. Below I will write why I chose this particular application. We download archive from GitHub'a. It is necessary to deploy all this somewhere. I have a virtualka for this. Who does not keep the server at home, you can use the Raspberry Pi for this case. ')
Installation process A brief installation manual is on the project page. I recommend additionally using the instructions of the neighboring project on GitHub (in my opinion it is more understandable). I will not completely copy the commands here. Go through the points:
Install the necessary packages: nodejs, npm, git-core, libnss-mdns, libavahi-compat-libdnssd-dev .
We copy in lib / HAP-NodeJS. We download it as a separate archive from here .
Install plugins to work with the application.
Rule config.json. Enter the IP address of the Vera controller, and you can also change the PIN code on your own.
We are trying to start the application using the node app.js command.
It is advisable to immediately install the latest version of nodejs. I have installed version 0.10.29 from the standard Debian repositories. This caused the error “error: 'REPLACE_INVALID_UTF8' is not a member of ...” something to say about it. Connect another repository and install from there.
Even in the process of launching errors will arise about the missing plugins. We put:
npm install _
Another error may be "... invalid ELF header". To make it work, you need to go to lib / HAP-NodeJS and make
npm rebuild
As a result, it should: successfully start the Homekit for Vera and automatically pick up the scenes and switches that the controller sees. If this happened - half the job done. Further, if there are no errors, you can start the application in the background with the command:
forever start app.js
pre-installing the plugin
npm install forever
This should be done, of course, making sure that you are in the VeraHomeKitBridge directory.
Now we set up HomeKit on the iPhone Install the Insteon + application. If desired, you can choose other paid counterparts. The main thing that they worked with HomeKit. Turn on in the Settings -> Privacy -> HomeKit program that you installed. In the iCloud settings you need to create a keychain. Go to the program Insteon +. We do Add Device. She then looks for an accessory compatible with HomeKit. We have a running service running HAP-NodeJS, which should be on the same local network as the iPhone. We find one accessory and add. Enter the PIN code, which is specified in config.json. The first time adding lasts about a minute. If everything went well, then all the actuators and scenes from Faith will be visible in Insteon + and will even work on pressing. But I have an application from Vera. I can switch there too. Insteon + is needed for voice control. To do this, in the application settings, select Edit Device. Select the device and go to the "Siri control". There it is necessary to enter the human name of the actuator or script. For example, if it is a lighting relay, then call it a “light bulb” or “light.” In general, "light" - Siri has a more general concept. So try to make specific names: iron, kettle, TV, heated floor ... By expanding the devices in the application by room, you can give the commands: “Turn on the lights in the kitchen” Siri “sees” the names of the rooms. Even in the device settings, you can specify its type. Now there is Light and Fan. Maybe other types will be added in the future. Now it is possible to indicate for the lighting relay that this is exactly the light. Then the device will respond to “Turn on the light in the kitchen” and will not respond if its type is Fan. Below in the video I will demonstrate voice control. But I do not have so many devices to show all the options for voice control. So far, only the principle of action. And then only with the expansion of devices and functionality Insteon +.
As I wrote earlier, you can work through scenes. This gives us the opportunity to manage almost everything that is available in the Faith interface. Scenes are all visible in the app and are available with voice commands. Therefore, you can control the receiver or TV, creating 2 scenes - on and off the receiver. In Vera, the scene should be called Receiver - On and Receiver - Off. Then you can give commands to "Turn on the receiver" and "Turn off the receiver", and not "Turn on the receiver" and "Turn off the receiver", respectively.
What else? HomeKit opens the door to voice control of almost any home automation. For this there is a broader concept - homebridge. Where it is possible to push automation of other manufacturers. After rustling all the same GitHub, you can find control mechanisms for other controllers and platforms: WeMo, PhilipsHue ... I came across a plugin for Vera almost a year ago, and during that time it advanced to the best. I will highlight some features: If you look at the code, you can see that the interaction occurs through the http protocol. It works faster than analogs. All devices are added immediately as a single accessory. If desired, you can expand the entire system up and down.
Some lyrics or translation difficulties Here I’ll dwell on the commands for Siri. If the device name is not explicitly entered, Siri climbs to the Internet at your request, and does not give a command to this device. And the team, it happens, understands differently. Sometimes you need to "Turn on ...", but "Turn off ..." Otherwise, the query "Turn off the warm floor", for example, will search the Internet for a request on how to turn off the warm floor. There are common commands like "Turn on the lights in ...", "Turn on everything in ...", "Drop the curtains." There is a command to "Close", "Open." But in my case, this command did not work with hydrolos. He described the device as "water" and as "faucet". The command "Close the tap in the toilet" stubbornly does not see the device. Although the room "Toilet" defines. A bit of a paradoxical situation: I call the skid "iron", I give the command "Turn on the iron" - it blocks the water. I call "water", "tap" - it climbs on the Internet to look for how to close the tap. In general, with the closure, it seems to me, this bundle works only with certain devices such as locks. But then it should be appropriately described in the type of device. And then the command "Close the front door" Siri understands correctly.
The video shows the principle of operation. The water overlap works from a relay, which in HomeKit could not be described as a skid or tap.
In general, use, try on other devices how it works and improve the voice control of home automation.