TapHome

Xiaomi 1T (Valetudo)

Packet Parser → HTTP
Submitted by
Last updated: 03. 2026
Xiaomi 1T (Valetudo)

The Xiaomi Mijia 1T (STYTJ02ZHM) is a robot vacuum-mop manufactured by Dreame and sold under the Xiaomi brand. This template requires Valetudo — 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.

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 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.

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:

StatusValueDescription
Docked0Robot is on the charging dock
Cleaning1Active cleaning cycle
Returning2Navigating back to the dock
Paused3Cleaning paused
Idle4Not cleaning, not docked
Unknown9Unrecognized 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

Xiaomi 1T (Valetudo) Module
Custom Variables

Xiaomi 1T (Valetudo)

Read (module)
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: %

Battery Level

Read input level
PARSEJSON(state, "$[?(@.__class == 'BatteryStateAttribute')].level") / 100
Home Push Button
action

Home

Write button state
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

Triggers an audible beep on the robot to help find it

action

Locate

Write button state
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
action

Pause

Write button state
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
action

Start

Write button state
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 · ???

Vacuum Status

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

switch(status,
"docked", 0,
"cleaning", 1,
"returning", 2,
"paused", 3,
"idle", 4,
9);
Stop Push Button
action

Stop

Write button state
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.

Sources