Vacuum mqtt setup

Hi all

upgraded to 2024.2.1 and trying to setup my vacuum

My old setup, in mqtt.yaml file, was:

vacuum:
   - name: "Jarvis"
     supported_features:
       - turn_on
       - turn_off
       - pause
       - stop
       - battery
       - status
       - locate
       - clean_spot
       - send_command
     command_topic: "neato/command"
     battery_level_topic: "neato/state"
     battery_level_template: >
       {% if value_json.battery_level is defined %}
         {{ value_json.battery_level | default }}
       {% endif %}
     charging_topic: "neato/state"
     charging_template: "{{ value_json.charging | default }}"
     cleaning_topic: "neato/state"
     cleaning_template: "{{ value_json.cleaning | default }}"
     docked_topic: "neato/state"
     docked_template: "{{ value_json.docked | default }}"
     send_command_topic: 'neato/send_command'
     availability_topic: "neato/available"
     payload_available: "online"
     payload_not_available: "offline"

now I’m trying this:

vacuum:
    - name: "Jarvis"
      unique_id: "367788909898766545"
      object_id: "jarvis"
      schema: state
      availability:
        topic: "neato/available"
        payload_available: "online"
        payload_not_available: "offline"      
      supported_features:
        - start
        - stop
        - pause
        - battery
        - locate
        - clean_spot
      command_topic: "neato/command"
      send_command_topic: 'neato/send_command'
      payload_start: "start"
      payload_stop: "stop"
      payload_clean_spot: "clean_spot"
      payload_locate: "locate"

but state and battery level aren’t available because of the mqtt playlod

neato/state

{"battery_level":"90","charging":true,"docked":true,"cleaning":false}

I was thinking about creating 2 sensors, one for battery_level and one for the state (docked and charging, docked, cleaning) and use them in 2 automations, publishing their values ona new mqtt topic and using it for the configuration, but I’m open to other advices.

TIA

ok, searching here I found a viable solution

just created a new automation and set the state_topic in my configuration

- alias: mqtt_neatostate
  description: "responds to neato state message from vacuum with right syntax"
  trigger:
    - platform: mqtt
      topic: neato/state
  action:
    - service: mqtt.publish
      data:
        topic: neato/vacuumstate
        payload: >
          {"battery_level":{{trigger.payload_json.battery_level}},"state": {% if trigger.payload_json.docked==true   %} "docked" {% elif trigger.payload_json.cleaning==true %} "cleaning" {% else %} "idle" {% endif %}}

now my Jarvis is working again