📜 ⬆️ ⬇️

Smart Home with Yandex.Alisa

Hello! I want to talk about how one little girl wanted to play Alice's skills, integrate into the “smart home” of the cool product MySmartFlat, which obstacles stood in the way, and in general, what is it like to be a programmer girl?

Creating a skill is easy. For 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. We thought with colleagues and decided to try Alice. And also there is a column. And everything is very cool.

I love php (who would not say anything), but there is no documentation. It turned out to be easier to figure out. Thank God I work where there is already the necessary secure servers and everything else, because although a programmer, I didn’t want to understand the installation of certificates, etc. Sometimes the female inside takes its own ... But now is not about that. Here there is on hands the necessary webhuk, and the head on shoulders. Everything needed.
')
Webhuk - a script where all user requests fly, which processes and manages, gives the answer.

I started trivially trying to indulge in the light (our platform has an API, and I also didn’t need to understand how all this happens in hardware. The only thing having a technical education was to use the skills of handling relays, controllers, etc.) The whole difficulty lay in a tactful, correct and diverse approach to what the user says and wants. The further, the more into 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 "cut in", etc. Having considered a bunch of options, having received dozens of feedbacks, as a result - a cool, full-fledged skill, 20 thousand lines of code to control lighting, temperature, leak protection systems, household appliances, etc. Especially cool with the use of the station - you do not need to press anything at all and open it. It is 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 lights in a certain room and even certain channels, if there are several of them in the device, talk about the climate in the room and adjust the temperature of the air and the floor, focusing on the data from the device. I can even make the music louder and switch the channel on the TV.




Over the course of time, our application, our entire platform has been modernized, and users have the opportunity in the application to change the names of all their devices, the loads on the relays, and others. My head was boiling, because a new task arose, and with its back to me - how should Alice understand what the user wants to include? Suppose the device in the application is called MIRROR LIGHT, and Alice says: "Alice, turn on the lights 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 up enough to file artificial intelligence, and I taught her to ask the user and memorize.


In general, it would all be even cooler if it were not for:
1. Using Yandex.Station is not very, as it turned out, convenient. In the skill you are, while interacting. Ie: "Alice, start the skill ... turn on the light, turn off ...", etc. It takes 30 seconds, and you are silent - op, and you are no longer in skill. And again it is necessary: ​​“Alice, launch the skill ...”. Yes, much easier and faster to click on the button in the application.

2. It is necessary to optimize your server settings, phrase processing and everything else so that the script is processed and gives an answer in no more than 1.5 seconds. Otherwise, Alice says: “Sorry, the skill is not responding” and flies out of it. All anything, but I had to tinker a lot, because many devices, requests to the database and management. But the problem is solved.

Yandex has promised to make life better for smart home developers, and they respond adequately and quickly to all requests and questions.

In spite of all the pitfalls, voice control makes it possible to visually see and understand what this is all for. All IoT!

Source: https://habr.com/ru/post/449600/


All Articles