MQTT Vacuum (Tasmota/Eufy Robovac 30c)

Hi,
I really have a hard time understanding how to define my vacuum over mqtt using the state method (as opposed to legacy).

the vacuum supports four states (commands): 0=auto(on), 1=30min, 2=spot, 3=edges
for these I need to send to …/cmnd/vac/TuyaEnum1

for home i need to send 1 to …/cmnd/vac/Power2
for locate i need to send 1 to …/cmnd/vac/Power3
for stop i need to send 0 to …/cmnd/vac/Power1

I could set payload_clean_spot to 2 and payload_return_to_base 1 etc. but
how do I change the command_topic /cmnd/vac/Power2 and /cmnd/vac/TuyaEnum1 ?

thanks!

Still hoping for a better answer but as far as I can tell HA’s configuration.yaml doesn’t support this kind of flexibility in state/command mapping. So until somebody comes up with a better solution I’ve worked around it by mapping command_topic,fan_speed all to the same mqtt event topic, and setting the individual payload to the commands… and then mapping each payload back to the corresponding command on the robovac… not very elegant but it works. ;-/

still looking for a way to add “edges” mode into state any ideas?

# vacuum robovac 30c tasmota
# see also https://templates.blakadder.com/eufy_robovac_30C.html
mqtt:
  vacuum:
    - name: "Weufy"
      schema: state
      availability:
        topic: "tasmota/tele/weufy/LWT"
        payload_available: "Online"
        payload_not_available: "Offline"      
      supported_features:
        - start
        - stop
        - pause
        - return_home
        - battery
        - locate
        - clean_spot
        - fan_speed
        # - send_command
      command_topic: "tasmota/cmnd/weufy/event"
      #cannot switch command topics mapping to events and remapping via rules
        #TuyaMCU 11,2
        #WebButton1 Start/Stop
        #TuyaMCU 12,101
        #WebButton2 Home
        #TuyaMCU 13,103
        #WebButton3 Find
        #TuyaMCU 61,5 -> map enum1 to mode
        #TuyaEnumList 1,3 -> set mode range 0...4 (0=auto, 1=30min, 2=spot, 3=edges) -- also triggers power
        #TuyaMCU 62,102 -> map enum2 to fanspeed
        #TuyaEnumList 2,2 ->  fanspeed?? 0..2 ? where's is 3?
      payload_start: "start"
      # ON EVENT#start DO TuyaEnum1 0 ENDON     
      # auto mode / alternatively could use Power1
      payload_stop: "stop"
      # ON EVENT#stop DO Power1 0 ENDON     
      payload_clean_spot: "clean_spot"
      # ON EVENT#clean_spot DO TuyaEnum1 2 ENDON 
      payload_locate: "locate"
      # ON EVENT#locate DO Power3 1 ENDON 
      # no command to stop locating? switch off after 5s
      # ON EVENT#locate DO Backlog Power3 1; Delay 50; Power3 0 ENDON
      payload_return_to_base: "return_to_base"
#      payload_return_home: "return_home"
      # docs are inconsistent let's try both - return_home unknown err
      # ON EVENT#return_to_base DO Power2 1 ENDON 
#      # ON EVENT#return_home DO Power2 1 ENDON 
      # could use this, but then fan speeds are literally 0 1 2
      #set_fan_speed_topic: "tasmota/cmnd/weufy/TuyaEnum2"
      #fan_speed_list:
      #  - 0
      #  - 1
      #  - 2
      set_fan_speed_topic: "tasmota/cmnd/weufy/event"
      fan_speed_list:
        - low
        - medium
        - high
      # not sure of these do anything when not "on" (i.e. while cleaning)  
      # ON EVENT#low DO TuyaEnum2 0 ENDON
      # ON EVENT#medium DO TuyaEnum2 1 ENDON
      # ON EVENT#high DO TuyaEnum2 3 ENDON

# megarule: start                           stop                            clean_spot                               locate (auto switch off)                                      return_to_base                               fan low                         fan medium                          fan high                                 
# Rule3 ON EVENT#start DO TuyaEnum1 0 ENDON ON EVENT#stop DO Power1 0 ENDON ON EVENT#clean_spot DO TuyaEnum1 2 ENDON ON EVENT#locate DO Backlog Power3 1; Delay 50; Power3 0 ENDON ON EVENT#return_to_base DO Power2 1 ENDON ON EVENT#low DO TuyaEnum2 0 ENDON ON EVENT#medium DO TuyaEnum2 1 ENDON ON EVENT#high DO TuyaEnum2 2 ENDON
# Rule3 1

state and feedback could probably be handled via rules as well, but i think i’ve spent enough time working around HA. let’s do some vacuuming!

Thank you for posting this… a trail of bread crumbs for me to follow. I have a Roomba 860 that is excellent, but it will be less than functional if I don’t convert over to state/schema very soon.

thanks for the thanks.
TBH I had already forgotten I had written this. :wink: