"Smart home" with Yandex.Alisa

Hello! I want to talk about how one little girl wanted to learn Alice’s skills, integrate into the “smart home” of the cool MySmartFlat product, what barriers got in the way, and in general, what is it like to be a female programmer?

Creating a skill is easy. In half an hour you can implement a simple chat bot. And send for moderation. And even go through it.

IoT is a familiar thing for many now, and a cool addition to such complexes is voice control. My colleagues and I thought and decided to try Alice. And also there is a column. And everything is very cool.

I love php (whoever and what would not say), but there is no documentation. It turned out to be easier to understand. Thank God I work where there are already and the necessary secure servers and everything else, because although a programmer - but I didn’t really want to understand the installation of certificates, etc. Sometimes the female gut takes its toll ... But now is not about that. Here is the necessary webhook on hand, and a head on shoulders. Everything you need.

Webhook is a script where all user requests fly, which processes and manages, gives an answer.

I started trivially trying to indulge in light (our platform has an API, and I did not need to figure out how this all happens in hardware either. The only thing, having a technical background, was my skills in handling relays, controllers, etc.). All the complexity lay in the tactful, correct and diverse approach to what the user says and wants. The farther, the more in the wilds, especially when I realized that the way I see (and the way I would say) is completely different from what the user of our platform would say. I want to "Turn on the light", and the user to "cut", etc. After thinking about a bunch of options, getting dozens of feedbacks, as a result - a cool, full-fledged skill, in 20 thousand lines of code for controlling lighting, temperature, leakage protection systems, household appliances, etc. Especially cool using the station - no need to press and open anything at all. It’s enough to have at least one of our devices - and the skill “My apartment” will already be available.

I taught Alice to turn on / off the lighting in a certain room and even certain channels, if there are several in the device, talk about the climate in the room and adjust the temperature of the air and floor, focusing on the data from the device. I can even make music louder and switch the channel on the TV.




Over time, our application, our entire platform was modernized, and users have the opportunity in the application to change the names of all their devices, relay loads, and more. My head boiled because a new task has arisen and with my back to me - how should Alice understand what the user wants to include? Let's say the device in the application is called MIRROR LIGHT, and Alice says: "Alice, turn on the light in the bathroom." The user understands that he wants to turn on the backlight of the mirror, but what about me? My skill is not pumped enough to gash artificial intelligence, and I taught her to question the user and remember.


In general, all this would have been even cooler if not for:
1. Using Yandex.Stations is not very convenient, as it turned out. You are in the skill while interacting. That is: "Alice, launch the skill ... turn on the light, turn off ..." etc. 30 seconds pass, and you are silent - op, and you are no longer in the skill. And again: "Alice, launch the skill ...". Yes, it’s much easier and faster to click on the button in the application.

2. It is necessary to optimize your server settings, processing phrases, and everything else so that the script is processed and produces a response in no more than 1.5 s. Otherwise, Alice says: “Sorry, the skill is not responding” and flies out of it. Everything would be fine, but I had to tinker a lot, because many devices, queries to the database and management. But the problem is solvable.

Yandex has promised to make a better life for developers of smart homes, and they respond appropriately and quickly and answer all wishes and questions.

Despite all the pitfalls, voice control allows you to clearly see and understand why all this is necessary. IoT to all!

Also popular now: