I have long wanted, in addition to the smart home, a voice assistant who understands and speaks Russian. As a result, I decided to take a chance and take a raw new column of Yandex. Station with a young, but already much beloved, Alice. The first impression was great, but when I heard enough jokes and had a lot of talk, I began to learn the practical side of the column. I was most interested in the question of Alice’s interaction with the smart home.
To solve the above task, the Alice-HomeBridge service has been created, designed to communicate with the voice assistant of Yandex.Alice and various smart home control systems. Further, we will consider the HomeBridge configuration as examples of settings, but this approach is applicable for other systems such as Home Assistant , openHAB and others.
')
You can change or find out the state of the switches using a specially crafted GET request to the service.
In order for the service to interact with the voice assistant "Alice" the skill "Lazy Jimmy" is created.
Tell Alice: “Start the skill lazy Jimmy” and he will offer you to provide an activation code that you can find in your personal account .
After activation, you can change the state of your switches using the “Turn On” or “Turn Off” commands. For example, if you say “Turn on the Light”, the state of the “Light” switch will change to positive. If you just say “Light”, the state of the switch will change to the opposite.
In order for the dialogue to sound more natural, there is the ability to create switches with more understandable names, for example, “With Utrechkom”, then you can tell Alice “Say Jimmy With Utrechkom” and the state of the switch will change.
It remains to configure the HomeBridge. For example, we will use the cmdswitch2 extension. Create a HomeKit switch with the name "Alice Button 1".
In order not to overload the server with excessive requests, set the interval parameter value for at least 2 seconds.
All is ready.
Now, if you say “Alice tell lazy Jimmy with a morning”, the “Alice Button 1” switch will change state. Here is a demonstration of how everything works in conjunction with customized HomeKit scripts:
PS Most smart home control systems, such as HomeKit, support scripting. You can create a script that you would like to use in a certain situation, for example, when you wake up and assign it a call to the “Turn On Switch” event.
PS My service is just developing and, to put it mildly, is far from ideal. But Alice refuses to accept some phrases from time to time. For example, she perfectly conveys the skill phrase "Turn on the light", but the phrase "Good morning" will not pass. I hope Yandex knows about the problem and will soon fix it. Waiting for your comments.