Why link Marusya to Xiaomi ecosystem?
Marusya's voice assistant VK And Xiaomi's smart home ecosystem, two powerful tools that tandem can turn your apartment into a futuristic "home of the future." But how do you make them work together when there's no formal integration? From basic customization via Mi Home to advanced scenarios using Home Assistant and cloud bridges.
The main problem is that Xiaomi doesn't support Marousi directly, but there are workarounds: through Yandex IoT, third-party services like Nabu Casa, or even self-written scripts. We'll take everything from the simplest (for beginners) to the most complex (for automation enthusiasts), and it's important to understand that stability depends on the method you choose: somewhere you need constant access to the Internet, and somewhere you need a local server on the Raspberry Pi.
Before you start, check:
- π± You have the Mi Home app installed (version no lower than 6.5.400)
- π All Xiaomi devices are connected to the same Wi-Fi network (2.4 GHz is mandatory for most sensors!)
- π£οΈ Marusya activated in appendix VK or in a column (e.g, VK Capsule)
Method 1: Connecting via Yandex IoT (the easiest option)
This method is suitable for users who already have a Yandex account and a column with Alice (for example, Yandex Station). Since Marusya uses the same smart home platform as Alice, we can take this workaround. Importantly, the method works only with a limited list of Xiaomi devices that are officially supported by Yandex IoT.
Steps for connection:
- Open the Yandex app and go to the Smart Home section.
- Click Add Add the device β Other devices β Choose Xiaomi from the list.
- Sign in to your Mi Home account (use the same region as in the app!).
- Allow access to devices and wait for sync (can take up to 10 minutes).
Once successfully connected, the devices will appear in the Yandex app, and can now be controlled via Marusya using commands such as:
"Marusya, turn on the light in the living room" (if the lamp is called "Light of the living room") "Marusya, show the temperature in the kitchen" (for the Aqara Temperature Sensor)
What Xiaomi devices are supported by Yandex IoT?
| Xiaomi device | Support for Yandex IoT | Example of a team for Marousi |
|---|---|---|
| Yeelight Color | β Yes. | "Marusya, make the light 50% blue." |
| Mi Smart Plug | β Yes. | "Marusya, turn off the socket in the bathroom" |
| Aqara Door Sensor | β No. | β |
| Mi Robot Vacuum | β οΈ Partially (only basic commands) | "Marusya, start cleaning up" |
π‘
If your device doesnβt show up in Yandex IoT, try changing the region in Mi Home to βRussiaβ or βChinaβ (depending on the model). β Settings β Region and restart the application.
Method 2: Use Home Assistant to Integrate
For those who want full control of all Xiaomi devices without the limitations of Yandex IoT, the best solution is Home Assistant, an open platform for smart homes. This method takes longer to set up, but gives access to ALL Xiaomi devices, including those that are not officially supported, plus you can create complex automations that Marusya will run with voice.
Minimum requirements for launch:
- π₯οΈ Computer or Raspberry Pi (Pi 4 with recommended) 4GB RAM)
- π Stable Internet connection (for cloud integrations)
- π§ Basic knowledge of working with YAML-configurable
Step-by-step:
- Install Home Assistant on your device (instruction: home-assistant.io).
- In configuration.yaml, add integration with Xiaomi Mi Home: mi_home: username:!secret mi_home_username password:!secret mi_home_password gateways: - key: YOUR_GATEWAY_KEY Where YOUR_GATEWAY_KEY β This is your hub key (you can find it in Mi Home by clicking on three dots at the gateway). β General settings β Key key).
- Restart Home Assistant and check that the devices have appeared in the control panel.
- Install the Home Assistant Cloud add-on (to connect with Marusay) or configure Nabu Casa (paid but reliable).
Add integration Xiaomi Mi Home|Set up the lock key|Check the appearance of devices in DAshboard|Install Home Assistant Cloud or Nabu Casa|Link the account VK Home Assistant-->
Once set up, you can control the devices via Marusya using natural language, such as:
Marusya, run the script "Leaving to work" (if Home Assistant created a script with this name) "Marusya, show the cameras from the street" (if connected cameras Xiaomi Mi Home Camera).
π‘
Home Assistant allows you to bypass the limitations of Yandex IoT and connect ANY Xiaomi devices, including Aqara sensors, robot vacuum cleaners and even informal firmware. However, stable operation will require constant access to the server (local or cloud).
Method 3: Cloud Bridges (ioBroker)
If installing Home Assistant seems too complicated, cloud-based bridge services like Nabu Casa or ioBroker will be the alternative, mediating between Mi Home and Marusay, transferring commands from one format to another, and the main advantage is that you donβt have to keep your server, but there are also downsides: dependence on third-party services and possible delays in execution of commands.
Nabu Casa (paid, $5/Message: The official cloud service for Home Assistant:
- π Connect to your Home Assistant from anywhere in the world
- π€ Integration with Google Assistant and Alexa (and indirectly with Marusay)
- π± Mobile management application
To connect him to Marusya:
- Sign up for nabucasa.com and connect your Home Assistant.
- In Home Assistant settings, add Google Assistant or Alexa integration.
- Link this account to Marusya via in-app skills VK.
ioBroker (free) is a more flexible alternative, but requires customization.
- Install ioBroker on your server or Raspberry Pi.
- Add mihome and vkontakte adapters through the Admin Panel.
- Set up a connection between Xiaomi devices and your account VK.
Nabu Casa is easier to set up, but it is paid.
ioBroker is free, but requires JavaScript knowledge for complex scripts.
You can start with a free Nabu Casa period (1 month) for testing).-->
Common mistakes and their solutions
Even when following instructions, users often encounter problems, and here are the most common ones and how to fix them:
| Mistake. | Reason. | Decision |
|---|---|---|
| Devices are not displayed in Yandex IoT | Incompatible model or incorrect region in Mi Home | Change region to "Russia" in the Mi Home settings and reconnect your account |
| Marusia doesn't recognize commands | Disparity between device names in Yandex and Mi Home | Rename devices to Mi Home using only Latin and spaces |
| Home Assistant doesnβt see Xiaomi gateway | Wrong gateway key or firewall lock | Check the key in Mi Home and turn off the firewall for 5 minutes for the test |
| Delays in execution of commands (more than 5 seconds) | Nabu Casa (Cloud Bridge) or Slow Internet | Go to local management via Home Assistant or check network speed |
Pay special attention to safety:
β οΈ Note: When using cloud bridges (such as Nabu Casa), your data is transferred through third-party servers to minimize risks: π Enable two-factor authentication in your Mi Home account and VK. π« Do not use the same password for different services. π‘οΈ Update your Home Assistant and ioBroker adapters regularly.
If after all the manipulations, the devices did not appear in Marus, check:
- πΆ Internet connection stability (Wi-Fi problems are a common cause of failures).
- π± Device firmware version (update via Mi Home if available).
- π Time synchronization on Xiaomi gateway (incorrect time blocks communication with the cloud).
Advanced scenarios: automation with Marusay
Just turning on the lights is just the tip of the iceberg, and with Home Assistant or ioBroker, you can create complex scenarios that Marusya will run with her voice, for example:
Example 1: The Movie Theatre scenario
- Marusya turns off the main lights.
- Includes Yeelight backlight at 10% brightness with warm light.
- Lowering the Aqara Curtain blinds.
- Turns on the Mi TV. TV and launches the Netflix app.
To do this, you need to create a script in Home Assistant:
alias: Cinema
sequence:
- service: light.turn_off
target:
entity_id: light.gostinaya
- service: light.turn_on
target:
entity_id: light.podsvetka
data:
brightness_pct: 10
color_temp: 400
- service: cover.close_cover
target:
entity_id: cover.zhalyzi
- service: media_player.turn_on
target:
entity_id: media_player.mi_tv
- service: media_player.select_source
target:
entity_id: media_player.mi_tv
data:
source: NetflixThen in Marus, you just have to say, "Marusya, launch the script for the Cinema."
Example 2: A smart alarm clock
A scenario could:
- π Smoothly increase the brightness of Yeelight lamps 30 minutes before waking up.
- β Turn on the Mi Smart Kettle coffee maker.
- π» Run your favorite radio station on a column.
- π Report weather and schedule for the day.
This will require integration with Google Calendar and time-stimulation of triggers.
How to test scripts before voice control?
Alternative methods: IFTTT and local scripts
If none of the above methods are suitable, you can use IFTTT (If This Then That) or local scripts in Python, which are less reliable, but sometimes save in unusual situations.
IFTTT for Xiaomi and Marousi:
- Create an applet with a trigger VK Marusia (voice team).
- Select Mi Home as an action and specify the device/command.
- Limitation: IFTTT Supports only basic commands (on/off, color change).
β οΈ Attention: Free version IFTTT It limits the number of applets (3 pieces.
Local scripts in Python:
You can use the python-miio library to automate it, and you can use the Yeelight lamp control script as an example.
from miio import Yeelight
ip = "192.168.1.100" # IP of your lamp
token = "YOUR_LAMP_TOKEN" #Token from Mi Home
lamp = Yeelight(ip, token)
lamp.on()
lamp.set_brightness(50)For Marusya to run this script, you will need:
- Place the script on an always-on device (e.g., Raspberry Pi).
- Set up a web server (such as Flask) that will receive commands from Marousi via Webhooks.
- Link webhook to skill in VK.
These methods will be suitable for experienced users who are ready to understand code, for most tasks, Home Assistant or Yandex IoT will be enough.