Valetudo MQTT

Any idea why this isn’t working?

service: mqtt.publish
  topic: valetudo/vacuum/MapSegmentationCapability/clean/set
  payload: '3'

I can get the REST command to work properly but it only does zone cleanup which is something I have to define as a square for a room that’s not square. If I could use REST to pick a specific mapped out room that would work.

Nevermind. Got the REST command to work.

    url: 'http://your.vacuum.ip.address/api/v2/robot/capabilities/MapSegmentationCapability'
    method: 'put'
      accept: "*/*"
    content_type: "application/json"
    payload: '{"action":"start_segment_action",
    "segment_ids": ["your room ID number"],
    "iterations": 1,
    "customOrder": false}'

I found this when looking for a similar problem. Mine used to work and stopped recently (last Valetudo update?).
Then I found this Valetudo issue with .local addresses and changed mine to the IP, and it now works. Here’s what I send (script), based on the Valetudo MQTT docs.

  - service: mqtt.publish
      topic: valetudo/roborock/MapSegmentationCapability/clean/set
      payload: '{ "action": "start_segment_action", "segment_ids": [ "3" ], "iterations": 1, "customOrder": true }'

(The action part might be old as I don’t see it in the docs now. It works with or without it.