npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

homebridge-valetudo-xiaomi-vacuum

v0.3.2

Published

A Homebridge plugin for Xiaomi Vacuum Cleaner 1st gen (Mi Robot) and 2nd gen (Roborock S50), with Valetudo installed.

Downloads

32

Readme

homebridge-valetudo-xiaomi-vacuum

homebridge-valetudo-xiaomi-vacuum is a Homebridge plugin which you can use to control your Xiaomi Roborock vacuum that has Valetudo installed.

Installation

npm -g install homebridge-valetudo-xiaomi-vacuum

Configuration

An entry in config.json is needed.

Example:

{
    "accessory": "ValetudoXiaomiVacuum",
    "name": "<Accessory name, e.g. Vacuum>",
    "ip": "<Vacuum's ip address>"
}

Optionally, you can enable switches for controlling speed modes of the device by adding the power-control dictionary with default-speed and high-speed keys (both mandatory in that case), where the speed preset may be one of: quiet, balanced, turbo, and max.

For a mopping-capable vacuum (i.e. Gen 2 - S50/S55), a mop mode button can be also enabled using the mop-enabled option that is a true/false value. You can skip that option altogether - false will be the default.

Example:

{
    "accessory": "ValetudoXiaomiVacuum",
    "name": "Mo",
    "ip": "192.00.486.259",
    "power-control": {
        "default-speed": "quiet",
        "high-speed": "turbo",
        "mop-enabled": true
    }
}

Valetudo RE

If running your vacuum using Valetudo RE, legacy-mode needs to be set to true.

Example:

{
    "accessory": "ValetudoXiaomiVacuum",
    "name": "<Accessory name, e.g. Vacuum>",
    "ip": "<Vacuum's ip address>",
    "legacy-mode": true
}

Authentication

If your vacuum access is restricted with login and password, you need to add a authentication option with the value of <username>:<password> to device's config.

Example for when username and password are "admin" (not recommended!):

{
    "accessory": "ValetudoXiaomiVacuum",
    "name": "<Accessory name, e.g. Vacuum>",
    "ip": "<Vacuum's ip address>",
    "authentication": "admin:admin"
}

Compatibility

Tested on Roborock S50 with firmware v001748 and Valetudo 0.6.1.

Vacuum map in Home app

I played a little with an idea of setting up a HomeKit camera that grabs the generated Vacuum image and streams it as a video.

Here's how to achieve it:

  1. An mqtt broker running on a home server. hmq in my case.
  2. Vacuum set up to connect to said mqtt broker.
  3. I can't believe it's valetudo running on the camera server, with webserver enabled, running on port 3030.
  4. homebridge-camera-ffmpeg installed on the camera server's homebridge, properly configured.
  5. Camera added to Home.

homebridge-camera-ffmpeg config:

{
      "name": "Vacuum",
      "videoConfig": {
        "source": "-loop 1 -i http://localhost:3030/api/map/image",
        "videoFilter": "pad='ih*16/9:ih:(ow-iw)/2:(oh-ih)/2',scale=1920:1080",
        "maxFPS": 5
      }
}
  • -loop 1 sets up ffmpeg so it's constantly loading the generated png for each frame
  • pad filter is set up so it expands the generated png to an 16:9 aspect ratio image so it looks right in Home app, then it's scaled using scale down to 1920x1080
  • maxFPS set to a reasonable value; at 1 it was having hard time to start live streaming in Home app; at 5 it's instantaneous

Looks cool!