38 KiB
title | category | order |
---|---|---|
MQTT | Integrations | 20 |
MQTT integration
To make your robot talk to your MQTT broker and integrate with home automation software, such as but not limited to Home Assistant, openHAB and Node-RED, configure MQTT via Valetudo's web interface (Connectivity → MQTT connectivity). On this page you can also find the exact topic to which to send commands to or from.
Autodiscovery
See the specific integration pages for instructions on how to set up autodiscovery for your home automation software platform:
Other home automation software that follows the Homie convention should also be able to automatically discover your Valetudo instance.
Map
Note that, in order to view the map provided over MQTT, you additionally need I Can't Believe It's Not Valetudo to generate PNG maps. You can then configure it to serve the PNG map over HTTP for openHAB and other software, or install the Lovelace Valetudo Card Map for Home Assistant.
Custom integrations
If you're planning to use one of the home automation platforms listed above, this is all you need to know to get started.
If you're instead planning to do something more custom, in this document you will find a reference to all MQTT topics
provided by this software. Values such as <TOPIC PREFIX>
and <IDENTIFIER>
are those configured in the MQTT
settings page.
{% include alert.html type="tip" content="It is recommended to leave Homie autodiscovery enabled, even if you're not planning to use it, if you want to develop custom integrations or access the MQTT topics directly: the Homie protocol is very readable and self-documenting. It will provide additional context and information on how to use specific APIs.
Homie autodiscovery info is best viewed with something like MQTT Explorer. " %}
Table of contents
- Robot
- Capabilities
- Auto Empty Dock Manual Trigger (
AutoEmptyDockManualTriggerCapability
) - Basic control (
BasicControlCapability
) - Consumables monitoring (
ConsumableMonitoringCapability
) - Current Statistics (
CurrentStatisticsCapability
) - Fan control (
FanSpeedControlCapability
) - Go to location (
GoToLocationCapability
) - Locate (
LocateCapability
) - Lock Keys (
KeyLockCapability
) - Mode control (
OperationModeControlCapability
) - Obstacle Avoidance (
ObstacleAvoidanceControlCapability
) - Segment cleaning (
MapSegmentationCapability
) - Speaker volume control (
SpeakerVolumeControlCapability
) - Total Statistics (
TotalStatisticsCapability
) - Water control (
WaterUsageControlCapability
) - Wi-Fi configuration (
WifiConfigurationCapability
) - Zone cleaning (
ZoneCleaningCapability
)
- Auto Empty Dock Manual Trigger (
- Map data
- Status
- Valetudo Events
- Capabilities
State attributes index
- AttachmentStateAttribute
- BatteryStateAttribute
- ConsumableStateAttribute
- PresetSelectionStateAttribute
- StatusStateAttribute
Home Assistant components index
- Battery level (
sensor.mqtt
) - Consumable (minutes) (
sensor.mqtt
) - Consumable (percent) (
sensor.mqtt
) - Current Statistics Area (
sensor.mqtt
) - Current Statistics Time (
sensor.mqtt
) - Dust bin attachment (
binary_sensor.mqtt
) - Error (
sensor.mqtt
) - Events (
sensor.mqtt
) - Fan (
select.mqtt
) - Lock Keys (
switch.mqtt
) - Map data (
camera.mqtt
) - Map segments (
sensor.mqtt
) - Mode (
select.mqtt
) - Mop attachment (
binary_sensor.mqtt
) - Obstacle Avoidance (
switch.mqtt
) - Play locate sound (
button.mqtt
) - Reset Consumable (
button.mqtt
) - Reset Consumable (
button.mqtt
) - Speaker volume (
number.mqtt
) - Status Flag (
sensor.mqtt
) - Total Statistics Area (
sensor.mqtt
) - Total Statistics Count (
sensor.mqtt
) - Total Statistics Time (
sensor.mqtt
) - Trigger Auto Empty Dock (
button.mqtt
) - Vacuum (
vacuum.mqtt
) - Water (
select.mqtt
) - Water tank attachment (
binary_sensor.mqtt
) - Wi-Fi configuration (
sensor.mqtt
)
MQTT API reference
Robot
Device
Home Assistant components controlled by this device:
Capabilities
Auto Empty Dock Manual Trigger (AutoEmptyDockManualTriggerCapability
)
Node, capability: AutoEmptyDockManualTriggerCapability
Auto Empty Dock Manual Trigger (trigger
)
Property, command, not retained
- Command topic:
<TOPIC PREFIX>/<IDENTIFIER>/AutoEmptyDockManualTriggerCapability/trigger/set
- Command response topic:
<TOPIC PREFIX>/<IDENTIFIER>/AutoEmptyDockManualTriggerCapability/trigger
- Data type: enum (allowed payloads:
PERFORM
)
Home Assistant components controlled by this property:
- Trigger Auto Empty Dock (
button.mqtt
)
Basic control (BasicControlCapability
)
Node, capability: BasicControlCapability
Operation (operation
)
Property, command, not retained
- Command topic:
<TOPIC PREFIX>/<IDENTIFIER>/BasicControlCapability/operation/set
- Command response topic:
<TOPIC PREFIX>/<IDENTIFIER>/BasicControlCapability/operation
- Data type: enum (allowed payloads:
START
,STOP
,PAUSE
,HOME
)
Consumables monitoring (ConsumableMonitoringCapability
)
Node, capability: ConsumableMonitoringCapability
Note: This is an optional exposed capability handle and thus will only be available via MQTT if enabled in the Valetudo configuration.
{% include alert.html type="warning" content="Some information contained in this document may not be exactly what is sent or expected by actual robots, since different vendors have different implementations. Refer to the table below.
|------+--------|
What | Reason |
---|---|
Properties | Consumables depend on the robot model. |
Property datatype and units | Some robots send consumables as remaining time, others send them as endurance percent remaining. |
------+-------- |
" %}
Status attributes managed by this node:
- ConsumableStateAttribute
Consumable (minutes) (<CONSUMABLE-MINUTES>
)
Property, readable, retained
This handle returns the consumable remaining endurance time as an int representing seconds remaining.
- Read topic:
<TOPIC PREFIX>/<IDENTIFIER>/ConsumableMonitoringCapability/<CONSUMABLE-MINUTES>
- Data type: integer
Sample value:
29520
Home Assistant components controlled by this property:
- Consumable (minutes) (
sensor.mqtt
)
Reset the consumable (<CONSUMABLE-MINUTES>/reset
)
Property, command, not retained
- Command topic:
<TOPIC PREFIX>/<IDENTIFIER>/ConsumableMonitoringCapability/<CONSUMABLE-MINUTES>/reset/set
- Command response topic:
<TOPIC PREFIX>/<IDENTIFIER>/ConsumableMonitoringCapability/<CONSUMABLE-MINUTES>/reset
- Data type: enum (allowed payloads:
PERFORM
)
Home Assistant components controlled by this property:
- Reset Consumable (
button.mqtt
)
Consumable (percent) (<CONSUMABLE-PERCENT>
)
Property, readable, retained
This handle returns the consumable remaining endurance percentage.
- Read topic:
<TOPIC PREFIX>/<IDENTIFIER>/ConsumableMonitoringCapability/<CONSUMABLE-PERCENT>
- Data type: integer percentage (range: 0 to 100, unit: %)
Sample value:
59
Home Assistant components controlled by this property:
- Consumable (percent) (
sensor.mqtt
)
Reset the consumable (<CONSUMABLE-PERCENT>/reset
)
Property, command, not retained
- Command topic:
<TOPIC PREFIX>/<IDENTIFIER>/ConsumableMonitoringCapability/<CONSUMABLE-PERCENT>/reset/set
- Command response topic:
<TOPIC PREFIX>/<IDENTIFIER>/ConsumableMonitoringCapability/<CONSUMABLE-PERCENT>/reset
- Data type: enum (allowed payloads:
PERFORM
)
Home Assistant components controlled by this property:
- Reset Consumable (
button.mqtt
)
Current Statistics (CurrentStatisticsCapability
)
Node, capability: CurrentStatisticsCapability
Note: This is an optional exposed capability handle and thus will only be available via MQTT if enabled in the Valetudo configuration.
{% include alert.html type="warning" content="Some information contained in this document may not be exactly what is sent or expected by actual robots, since different vendors have different implementations. Refer to the table below.
|------+--------|
What | Reason |
---|---|
Properties | Available statistics depend on the robot model. |
------+-------- |
" %}
Current Statistics Area (area
)
Property, readable, retained
- Read topic:
<TOPIC PREFIX>/<IDENTIFIER>/CurrentStatisticsCapability/area
- Data type: integer (unit: cm²)
Sample value:
630000
Home Assistant components controlled by this property:
- Current Statistics Area (
sensor.mqtt
)
Current Statistics Time (time
)
Property, readable, retained
This handle returns the current statistics time in seconds
- Read topic:
<TOPIC PREFIX>/<IDENTIFIER>/CurrentStatisticsCapability/time
- Data type: integer (unit: seconds)
Sample value:
1440
Home Assistant components controlled by this property:
- Current Statistics Time (
sensor.mqtt
)
Fan control (FanSpeedControlCapability
)
Node, capability: FanSpeedControlCapability
Status attributes managed by this node:
- PresetSelectionStateAttribute
Fan (preset
)
Property, readable, settable, retained
This handle allows setting the fan. It accepts the preset payloads specified in $format
or in the HAss json attributes.
- Read topic:
<TOPIC PREFIX>/<IDENTIFIER>/FanSpeedControlCapability/preset
- Set topic:
<TOPIC PREFIX>/<IDENTIFIER>/FanSpeedControlCapability/preset/set
- Data type: enum (allowed payloads:
off
,min
,low
,medium
,high
,turbo
,max
)
{% include alert.html type="warning" content="Some information contained in this document may not be exactly what is sent or expected by actual robots, since different vendors have different implementations. Refer to the table below.
|------+--------|
What | Reason |
---|---|
Enum payloads | Different robot models have different fan presets. Always check $format /json_attributes during startup. |
------+-------- |
" %}
Sample value:
max
Home Assistant components controlled by this property:
- Fan (
select.mqtt
)
Go to location (GoToLocationCapability
)
Node, capability: GoToLocationCapability
Go to location (go
)
Property, command, not retained
This handle accepts a JSON object identical to the one used by the REST API.
Simply use the Map in the Valetudo UI, place the GoTo marker and then long-press the button that would start the action.
This will open a modal containing the copy-pasteable payload.
Sample payload:
{
"coordinates": {
"x": 50,
"y": 50
}
}
- Command topic:
<TOPIC PREFIX>/<IDENTIFIER>/GoToLocationCapability/go/set
- Command response topic:
<TOPIC PREFIX>/<IDENTIFIER>/GoToLocationCapability/go
- Data type: string (format:
same json as the REST interface
)
Lock Keys (KeyLockCapability
)
Node, capability: KeyLockCapability
Note: This is an optional exposed capability handle and thus will only be available via MQTT if enabled in the Valetudo configuration.
Lock Keys (enabled
)
Property, readable, settable, retained
- Read topic:
<TOPIC PREFIX>/<IDENTIFIER>/KeyLockCapability/enabled
- Set topic:
<TOPIC PREFIX>/<IDENTIFIER>/KeyLockCapability/enabled/set
- Data type: enum (allowed payloads:
ON
,OFF
)
Sample value:
OFF
Home Assistant components controlled by this property:
- Lock Keys (
switch.mqtt
)
Locate (LocateCapability
)
Node, capability: LocateCapability
Locate (locate
)
Property, command, not retained
- Command topic:
<TOPIC PREFIX>/<IDENTIFIER>/LocateCapability/locate/set
- Command response topic:
<TOPIC PREFIX>/<IDENTIFIER>/LocateCapability/locate
- Data type: enum (allowed payloads:
PERFORM
)
Home Assistant components controlled by this property:
- Play locate sound (
button.mqtt
)
Segment cleaning (MapSegmentationCapability
)
Node, capability: MapSegmentationCapability
Clean segments (clean
)
Property, command, not retained
This handle accepts a JSON object identical to the one used by the REST API.
Simply use the Map in the Valetudo UI, select the desired segments and iterations and then long-press the button that would start the action.
This will open a modal containing the copy-pasteable payload.
Sample payload:
{
"segment_ids": [
"20",
"18",
"16"
],
"iterations": 2,
"customOrder": true
}
- Command topic:
<TOPIC PREFIX>/<IDENTIFIER>/MapSegmentationCapability/clean/set
- Command response topic:
<TOPIC PREFIX>/<IDENTIFIER>/MapSegmentationCapability/clean
- Data type: string (format:
same json as the REST interface
)
Obstacle Avoidance (ObstacleAvoidanceControlCapability
)
Node, capability: ObstacleAvoidanceControlCapability
Note: This is an optional exposed capability handle and thus will only be available via MQTT if enabled in the Valetudo configuration.
Obstacle Avoidance (enabled
)
Property, readable, settable, retained
- Read topic:
<TOPIC PREFIX>/<IDENTIFIER>/ObstacleAvoidanceControlCapability/enabled
- Set topic:
<TOPIC PREFIX>/<IDENTIFIER>/ObstacleAvoidanceControlCapability/enabled/set
- Data type: enum (allowed payloads:
ON
,OFF
)
Sample value:
ON
Home Assistant components controlled by this property:
- Obstacle Avoidance (
switch.mqtt
)
Mode control (OperationModeControlCapability
)
Node, capability: OperationModeControlCapability
Status attributes managed by this node:
- PresetSelectionStateAttribute
Mode (preset
)
Property, readable, settable, retained
This handle allows setting the mode. It accepts the preset payloads specified in $format
or in the HAss json attributes.
- Read topic:
<TOPIC PREFIX>/<IDENTIFIER>/OperationModeControlCapability/preset
- Set topic:
<TOPIC PREFIX>/<IDENTIFIER>/OperationModeControlCapability/preset/set
- Data type: enum (allowed payloads:
mop
,vacuum
,vacuum_and_mop
)
{% include alert.html type="warning" content="Some information contained in this document may not be exactly what is sent or expected by actual robots, since different vendors have different implementations. Refer to the table below.
|------+--------|
What | Reason |
---|---|
Enum payloads | Different robot models have different mode presets. Always check $format /json_attributes during startup. |
------+-------- |
" %}
Sample value:
vacuum
Home Assistant components controlled by this property:
- Mode (
select.mqtt
)
Speaker volume control (SpeakerVolumeControlCapability
)
Node, capability: SpeakerVolumeControlCapability
Note: This is an optional exposed capability handle and thus will only be available via MQTT if enabled in the Valetudo configuration.
Speaker volume (value
)
Property, readable, settable, retained
This handle returns the current speaker volume
- Read topic:
<TOPIC PREFIX>/<IDENTIFIER>/SpeakerVolumeControlCapability/value
- Set topic:
<TOPIC PREFIX>/<IDENTIFIER>/SpeakerVolumeControlCapability/value/set
- Data type: integer (range: 0 to 100)
Sample value:
80
Home Assistant components controlled by this property:
- Speaker volume (
number.mqtt
)
Total Statistics (TotalStatisticsCapability
)
Node, capability: TotalStatisticsCapability
Note: This is an optional exposed capability handle and thus will only be available via MQTT if enabled in the Valetudo configuration.
{% include alert.html type="warning" content="Some information contained in this document may not be exactly what is sent or expected by actual robots, since different vendors have different implementations. Refer to the table below.
|------+--------|
What | Reason |
---|---|
Properties | Available statistics depend on the robot model. |
------+-------- |
" %}
Total Statistics Area (area
)
Property, readable, retained
- Read topic:
<TOPIC PREFIX>/<IDENTIFIER>/TotalStatisticsCapability/area
- Data type: integer (unit: cm²)
Sample value:
3150000
Home Assistant components controlled by this property:
- Total Statistics Area (
sensor.mqtt
)
Total Statistics Count (count
)
Property, readable, retained
- Read topic:
<TOPIC PREFIX>/<IDENTIFIER>/TotalStatisticsCapability/count
- Data type: integer (unit: #)
Sample value:
5
Home Assistant components controlled by this property:
- Total Statistics Count (
sensor.mqtt
)
Total Statistics Time (time
)
Property, readable, retained
This handle returns the total statistics time in seconds
- Read topic:
<TOPIC PREFIX>/<IDENTIFIER>/TotalStatisticsCapability/time
- Data type: integer (unit: seconds)
Sample value:
7200
Home Assistant components controlled by this property:
- Total Statistics Time (
sensor.mqtt
)
Water control (WaterUsageControlCapability
)
Node, capability: WaterUsageControlCapability
Status attributes managed by this node:
- PresetSelectionStateAttribute
Water (preset
)
Property, readable, settable, retained
This handle allows setting the water. It accepts the preset payloads specified in $format
or in the HAss json attributes.
- Read topic:
<TOPIC PREFIX>/<IDENTIFIER>/WaterUsageControlCapability/preset
- Set topic:
<TOPIC PREFIX>/<IDENTIFIER>/WaterUsageControlCapability/preset/set
- Data type: enum (allowed payloads:
off
,min
,low
,medium
,high
,max
)
{% include alert.html type="warning" content="Some information contained in this document may not be exactly what is sent or expected by actual robots, since different vendors have different implementations. Refer to the table below.
|------+--------|
What | Reason |
---|---|
Enum payloads | Different robot models have different water presets. Always check $format /json_attributes during startup. |
------+-------- |
" %}
Sample value:
min
Home Assistant components controlled by this property:
- Water (
select.mqtt
)
Wi-Fi configuration (WifiConfigurationCapability
)
Node, capability: WifiConfigurationCapability
Home Assistant components controlled by this node:
- Wi-Fi configuration (
sensor.mqtt
)
Frequency (frequency
)
Property, readable, retained
Sample value:
2.4ghz
IP addresses (ips
)
Property, readable, retained
Sample value:
192.168.100.100,fe80::1ff:fe23:4567:890a,fdff:ffff:ffff:ffff:ffff:ffff:ffff:ffff
Signal (signal
)
Property, readable, retained
- Read topic:
<TOPIC PREFIX>/<IDENTIFIER>/WifiConfigurationCapability/signal
- Data type: integer (unit: dBm)
Sample value:
-54
Wireless network (ssid
)
Property, readable, retained
Sample value:
Valetudo Wi-Fi
Zone cleaning (ZoneCleaningCapability
)
Node, capability: ZoneCleaningCapability
Start zoned cleaning (start
)
Property, command, not retained
This handle accepts a JSON object identical to the one used by the REST API.
Simply use the Map in the Valetudo UI, create the desired zones, select the desired iterations and then long-press the button that would start the action.
This will open a modal containing the copy-pasteable payload.
Sample payload:
{
"zones": [
{
"points": {
"pA": {
"x": 50,
"y": 50
},
"pB": {
"x": 100,
"y": 50
},
"pC": {
"x": 100,
"y": 100
},
"pD": {
"x": 50,
"y": 100
}
}
}
],
"iterations": 1
}
- Command topic:
<TOPIC PREFIX>/<IDENTIFIER>/ZoneCleaningCapability/start/set
- Command response topic:
<TOPIC PREFIX>/<IDENTIFIER>/ZoneCleaningCapability/start
- Data type: string (format:
same json as the REST interface
)
Map data
Node
This handle groups access to map data. It is only enabled if provideMapData
is enabled in the MQTT config.
Map (map
)
Property, readable, retained
This handle is only enabled if interfaces.homie.addICBINVMapProperty
is enabled in the config. It does not actually provide map data, it only adds a Homie autodiscovery property so that 'I Can't Believe It's Not Valetudo' can publish its map within the robot's topics and be autodetected by clients.
ICBINV should be configured so that it publishes the map to this topic.
Raw map data (map-data
)
Property, readable, retained
Raw map data for Home Assistant (map-data-hass
)
Property, readable, retained
This handle is added automatically if Home Assistant autodiscovery is enabled. It provides a map embedded in a PNG image that recommends installing the Valetudo Lovelace card.
Home Assistant components controlled by this property:
- Map data (
camera.mqtt
)
Map segments (segments
)
Property, readable, retained
This property contains a JSON mapping of segment IDs to segment names.
Sample value:
{
"16": "Hallway",
"18": "Bathroom",
"20": "Kitchen"
}
Home Assistant components controlled by this property:
- Map segments (
sensor.mqtt
)
Valetudo Events
Node
Events (valetudo_events
)
Property, readable, retained
This property contains all raised and not yet processed ValetudoEvents.
Sample value:
{
"6ac59c61-349b-4c18-9e4f-f89be959ba19": {
"__class": "ErrorStateValetudoEvent",
"metaData": {},
"id": "6ac59c61-349b-4c18-9e4f-f89be959ba19",
"timestamp": "2024-02-14T19:35:20.283Z",
"processed": false,
"message": "This is an error message"
},
"pending_map_change": {
"__class": "PendingMapChangeValetudoEvent",
"metaData": {},
"id": "pending_map_change",
"timestamp": "2024-02-14T19:35:20.283Z",
"processed": false
},
"mop_attachment_reminder": {
"__class": "MopAttachmentReminderValetudoEvent",
"metaData": {},
"id": "mop_attachment_reminder",
"timestamp": "2024-02-14T19:35:20.283Z",
"processed": false
},
"e8061d9a-a8d8-4438-8186-600eeee456f9": {
"__class": "DustBinFullValetudoEvent",
"metaData": {},
"id": "e8061d9a-a8d8-4438-8186-600eeee456f9",
"timestamp": "2024-02-14T19:35:20.283Z",
"processed": false
}
}
Home Assistant components controlled by this property:
- Events (
sensor.mqtt
)
Interact with Events (valetudo_events/interact
)
Property, command, not retained
Note that the interaction payload is event-specific, but for most use-cases, the example should be sufficient.
Sample payload for a dismissible event (e.g. an ErrorStateValetudoEvent):
{
"id": "b89bd27c-5563-4cfd-87df-2f23e8bbeef7",
"interaction": "ok"
}
- Command topic:
<TOPIC PREFIX>/<IDENTIFIER>/ValetudoEvents/valetudo_events/interact/set
- Command response topic:
<TOPIC PREFIX>/<IDENTIFIER>/ValetudoEvents/valetudo_events/interact
- Data type: string (JSON)
Status
Attachment state (AttachmentStateAttribute
)
Node
Status attributes managed by this node:
- AttachmentStateAttribute
Dust bin (dustbin
)
Property, readable, retained
This handle reports whether the dust bin attachment is installed.
Sample value:
true
Home Assistant components controlled by this property:
- Dust bin attachment (
binary_sensor.mqtt
)
Mop (mop
)
Property, readable, retained
This handle reports whether the mop attachment is installed.
Sample value:
false
Home Assistant components controlled by this property:
- Mop attachment (
binary_sensor.mqtt
)
Water tank (watertank
)
Property, readable, retained
This handle reports whether the water tank attachment is installed.
Sample value:
true
Home Assistant components controlled by this property:
- Water tank attachment (
binary_sensor.mqtt
)
Battery state (BatteryStateAttribute
)
Node
Status attributes managed by this node:
- BatteryStateAttribute
Battery level (level
)
Property, readable, retained
- Read topic:
<TOPIC PREFIX>/<IDENTIFIER>/BatteryStateAttribute/level
- Data type: integer percentage (unit: %)
Sample value:
42
Home Assistant components controlled by this property:
- Battery level (
sensor.mqtt
)
Battery status (status
)
Property, readable, retained
- Read topic:
<TOPIC PREFIX>/<IDENTIFIER>/BatteryStateAttribute/status
- Data type: enum (allowed payloads:
none
,charging
,discharging
,charged
)
Sample value:
charging
Vacuum status (StatusStateAttribute
)
Node
Status attributes managed by this node:
- StatusStateAttribute
Home Assistant components controlled by this node:
Robot Error (error
)
Property, readable, retained
This property contains the current ValetudoRobotError (if any)
Sample value:
{
"severity": {
"kind": "none",
"level": "none"
},
"subsystem": "none",
"message": ""
}
Error description (error_description
)
Property, readable, retained
Sample value:
No error
Status flag (flag
)
Property, readable, retained
- Read topic:
<TOPIC PREFIX>/<IDENTIFIER>/StatusStateAttribute/flag
- Data type: enum (allowed payloads:
none
,zone
,segment
,spot
,target
,resumable
,mapping
)
Sample value:
segment
Home Assistant components controlled by this property:
- Status Flag (
sensor.mqtt
)
Status (status
)
Property, readable, retained
- Read topic:
<TOPIC PREFIX>/<IDENTIFIER>/StatusStateAttribute/status
- Data type: enum (allowed payloads:
error
,docked
,idle
,returning
,cleaning
,paused
,manual_control
,moving
)
Sample value:
cleaning