---
title: "Xiaomi 1T (Valetudo)"
description: "Xiaomi Mijia 1T robot vacuum with Valetudo firmware in TapHome over its local REST API: battery, cleaning status, start, pause, stop, dock and locate."
url: "https://taphome.com/en/compatibility/valetudo-xiaomi-1t/"
language: en
lastmod: 2026-03-28
generator: hugo
ai:
  topics: ["http","other","robot-vacuum","valetudo","wifi"]
  questions: ["How to integrate a Valetudo robot vacuum with TapHome?","What does the Xiaomi 1T Valetudo TapHome template control?","How to connect Xiaomi 1T via HTTP to TapHome?","Why does the vacuum status show unknown in TapHome?","What is Valetudo and how does it work with TapHome?","How to check the battery level of a Valetudo vacuum in TapHome?"]
---

# Xiaomi 1T (Valetudo)

Communication: Packet Parser → HTTP

- [Valetudo — Open-Source Cloud Replacement](https://valetudo.cloud/)
- [Valetudo Supported Robots](https://valetudo.cloud/pages/general/supported-robots.html)

> Network address
> 
> TapHome reaches this device at the address entered on import. Give the device a fixed address — an IP reservation in the router, or its mDNS name if it supports one — otherwise the integration stops working when the router changes the address.
> 
> [Network Preparation](https://taphome.com/en/docs/setup/network-preparation/)

## Integration guide

The Xiaomi Mijia 1T (STYTJ02ZHM) is a robot vacuum-mop manufactured by Dreame and sold under the Xiaomi brand. This template requires [Valetudo](https://valetudo.cloud/) — an open-source firmware that replaces the manufacturer's cloud dependency with a local HTTP API. Once Valetudo is installed on the robot, TapHome communicates directly with the Valetudo REST API v2 on the local network. No cloud connection or authentication is required.

The template provides battery monitoring, a multi-value status indicator, and push-button controls for starting, pausing, stopping, and docking the vacuum. A locate function triggers an audible beep to help find the robot.

> [!WARNING]
> Valetudo must be installed on the robot before this template can be used. The template communicates with the Valetudo HTTP API, not with Xiaomi's cloud services. Rooting the Xiaomi 1T requires a 3.3 V USB-to-UART adapter and a Dreame Breakout PCB — see the [Valetudo supported robots page](https://valetudo.cloud/pages/general/supported-robots.html) for detailed instructions.

## Configuration

During template import, enter the robot's IP address on the local network (the default placeholder is `192.168.0.1`). The Valetudo REST API listens on port 80 with no authentication.

Since Valetudo does not expose an mDNS hostname, assign a static IP address or a DHCP reservation to the robot to prevent the address from changing after a network restart.

> [!TIP]
> Open `http://<robot-ip>/swagger/` in a browser to explore all available Valetudo API endpoints interactively. This is useful for verifying connectivity and inspecting the robot's current state.

## Device capabilities

### Battery level

The template reads the battery state of charge from the `/api/v2/robot/state/attributes` response. It parses `BatteryStateAttribute.level` (reported as 0–100) and divides by 100 to produce a 0.0–1.0 range for TapHome. The value updates every 2.5 seconds.

### Vacuum status

A multi-value switch displays the current operating state of the robot. The template parses `StatusStateAttribute.value` from the state attributes response and maps it to an integer index:

| Status | Value | Description |
|--------|-------|-------------|
| Docked | 0 | Robot is on the charging dock |
| Cleaning | 1 | Active cleaning cycle |
| Returning | 2 | Navigating back to the dock |
| Paused | 3 | Cleaning paused |
| Idle | 4 | Not cleaning, not docked |
| Unknown | 9 | Unrecognized status |

The Valetudo API can also report `error`, `manual_control`, and `moving` statuses — these are not individually mapped and will display as "Unknown" (value 9).

### Vacuum controls

Four push-button devices control the vacuum through the `BasicControlCapability` endpoint:

- **Start** — begins a full cleaning cycle
- **Pause** — pauses the current cleaning operation
- **Stop** — stops the current cleaning operation
- **Home** — sends the robot back to the charging dock

Each button sends a `PUT` request to `/api/v2/robot/capabilities/BasicControlCapability` with the corresponding action.

### Locate

The Locate button triggers an audible sound on the robot via the `LocateCapability` endpoint. This is useful for finding the robot when it is stuck or in an unexpected location.

### Additional capabilities

The Valetudo API exposes several capabilities not currently implemented in the template: fan speed control (suction power presets), water usage control (mopping intensity), zone cleaning, go-to-location, map snapshots, consumable monitoring (filter, brushes, sensors), speaker volume, do-not-disturb scheduling, charging status, and WiFi signal strength. These can be added in a future template update.

## Troubleshooting

### Device not responding

1. Verify the robot is powered on, connected to Wi-Fi, and has a valid IP address
2. Open `http://<robot-ip>/` in a browser — if the Valetudo web interface loads, the API is reachable
3. Check that TapHome and the robot are on the same network or VLAN
4. Confirm that Valetudo is running — if the robot was factory-reset, Valetudo may need to be reinstalled

### Status shows "Unknown" (???)

The template maps five statuses (docked, cleaning, returning, paused, idle). If the robot reports `error`, `manual_control`, or `moving`, the status will show as "Unknown" (value 9). This is expected behavior — the unmapped statuses occur during edge cases such as manual RC control or error recovery.

### Battery level reads zero

1. Confirm Valetudo is running and the API responds at `/api/v2/robot/state/attributes`
2. Check that the response contains a `BatteryStateAttribute` entry with a non-zero `level` value
3. If the robot was recently rebooted, wait for the first state poll to complete

## Available devices 7

These devices appear in TapHome after import.

Xiaomi 1T (Valetudo) Module

Custom Variables

Read (module)

```taphome
VAR response := SENDHTTPREQUEST("/api/v2/robot/state/attributes");
IF response.IsSuccess
 state := response.Content;
ELSE
 ADDERROR(response.StatusCode + " (" + response.ReasonPhrase + ")");
END
```

Battery Level Analog Input Read-only

Battery state of charge — percentage of remaining energy (0–100%)

numeric Unit: %

Read input level

```taphome
PARSEJSON(state, "$[?(@.__class == 'BatteryStateAttribute')].level") / 100
```

Home Push Button Read and write

action

Write button state

```taphome
VAR response := SENDHTTPREQUEST("/api/v2/robot/capabilities/BasicControlCapability", "PUT", "{\"action\": \"home\"}", "accept: */*", "Content-Type: application/json");
IF response.IsSuccess
 var res := response.Content;
ELSE
 ADDERROR(response.StatusCode + " (" + response.ReasonPhrase + ")");
END
```

Locate Push Button Read and write

Triggers an audible beep on the robot to help find it

action

Write button state

```taphome
VAR response := SENDHTTPREQUEST("/api/v2/robot/capabilities/LocateCapability", "PUT", "{\"action\": \"locate\"}", "accept: */*", "Content-Type: application/json");
IF response.IsSuccess
 var res := response.Content;
ELSE
 ADDERROR(response.StatusCode + " (" + response.ReasonPhrase + ")");
END
```

Pause Push Button Read and write

action

Write button state

```taphome
VAR response := SENDHTTPREQUEST("/api/v2/robot/capabilities/BasicControlCapability", "PUT", "{\"action\": \"pause\"}", "accept: */*", "Content-Type: application/json");
IF response.IsSuccess
 var res := response.Content;
ELSE
 ADDERROR(response.StatusCode + " (" + response.ReasonPhrase + ")");
END
```

Start Push Button Read and write

action

Write button state

```taphome
VAR response := SENDHTTPREQUEST("/api/v2/robot/capabilities/BasicControlCapability", "PUT", "{\"action\": \"start\"}", "accept: */*", "Content-Type: application/json");
IF response.IsSuccess
 var res := response.Content;
ELSE
 ADDERROR(response.StatusCode + " (" + response.ReasonPhrase + ")");
END
```

Vacuum Status Multi-value Switch Read-only

Current operating state — Docked, Cleaning, Returning, Paused, Idle, or Unknown

enum mapped

Values / States: Docked · Cleaning · Returning · Paused · Idle · ???

Read switch state

```taphome
var status := PARSEJSON(state, "$[?(@.__class == 'StatusStateAttribute')].value");

switch(status,
"docked", 0,
"cleaning", 1,
"returning", 2,
"paused", 3,
"idle", 4,
9);
```

Stop Push Button Read and write

action

Write button state

```taphome
VAR response := SENDHTTPREQUEST("/api/v2/robot/capabilities/BasicControlCapability", "PUT", "{\"action\": \"stop\"}", "accept: */*", "Content-Type: application/json");
IF response.IsSuccess
 var res := response.Content;
ELSE
 ADDERROR(response.StatusCode + " (" + response.ReasonPhrase + ")");
END
```

**Connection:** Packet Parser → HTTP

Possible improvements (10)

- Fan speed control — Set suction power level (low, medium, high, max). Available via PUT with preset value.
- Water usage control — Set mopping water flow level (low, medium, high). Available on models with mopping support.
- Map snapshot — Retrieve current map as PNG image. Available via GET.
- Zone cleaning — Start cleaning of specific zones defined by coordinates.
- Go to location — Send robot to specific coordinates on the map.
- Consumable monitoring — Read remaining life of filter, main brush, side brush, and sensor. Percentage or hours remaining.
- Charging status — Battery charging state (charging, discharging, charged). Available in state attributes alongside battery level.
- Speaker volume — Set robot speaker volume level (0-100).
- Do not disturb — Enable/disable DND mode with start/end time.
- WiFi signal strength — WiFi RSSI and signal quality. Available in state attributes response.

## Import parameters

Enter these values when you import the XML.

| Asked in the app | Default       |
|------------------|---------------|
| IP address       | `192.168.0.1` |

## Sources

- Valetudo Capabilities Overview
  
  [valetudo.cloud](https://valetudo.cloud/pages/usage/capabilities-overview.html) 2026-03-28
- Valetudo MQTT API Reference
  
  [valetudo.cloud](https://valetudo.cloud/pages/integrations/mqtt.html) 2026-03-28
- Valetudo REST API Overview (DeepWiki)
  
  [deepwiki.com](https://deepwiki.com/Hypfer/Valetudo) 2026-03-28
- Valetudo Supported Robots — Xiaomi 1T
  
  [valetudo.cloud](https://valetudo.cloud/pages/general/supported-robots.html) 2026-03-28

## Related Documentation

- [Packet Parser Integration](https://taphome.com/en/compatibility/packet-parser-guide/)
- [Packet Parser (HTTP, TCP, UDP, FTP, MQTT)](https://taphome.com/en/docs/integration/packet-parser/)
- [Packet parser functions](https://taphome.com/en/docs/script/packet-parser/)
- [Parsing functions](https://taphome.com/en/docs/script/parsing-functions/)

