360 S6 vacuum robot

Someone please create an integration for 360 S6 :pray:

3 Likes

I currently call an alexa routine to make it work, and i use vibration sensors to know if someone called them in a different way.

it’s for roborock s7, another brand

I connected my s6 to Google Home and integrated the Google assistant sdk to my home assistant.
Now I can start, stop and return to home by the Google Home API.
It works like I say “ok Google, start cleaner” but not with my voice with a command like “start cleaner”

Hmmm… Yeah actually i did that too.
The downside is that you can’t get any status what so ever.
Its just fire and hope it works.

To get status you can install GitHub - tronikos/google_assistant_sdk_custom: Custom integration of Google Assistant SDK

1 Like

Just ordered a 360 S10 - is there a complete guide on how to get the unit into Home Assistant? Or at least what main steps and setups would be required?

I will try to set it up Im allready halfway there. When I have it, I write down how i did that and share it with you. :+1:t2::grin:

Okay so i hope i can explain it well.

If not, don’t hesitate to tell me it’s not working.:smiley:

The Custom Google SDK integration [tronikos] mentioned above can not only send questions in text form but also retrieve the answers from google assistant.
I tried to work with that and i must say after a bit of tinkering it works pretty good.

So here is how i did it:

1st. You need those 2 Integrations:

grafik
the one on the right you can get from the official integrations the one on the left is the one [tronikos] mentioned above.
Install it according to the instruction in those 2 URLs:

Official → “Google Assistant SDK - Home Assistant”
Custom → “GitHub - tronikos/google_assistant_sdk_custom: Patches Google Assistant SDK integration to allow getting responses from commands to Google Assistant.”

First the Official then the Custom one!

Spoiler :smiley: : For the Custom one you need to add the repository given in the Github URL to HACS.

When you have configured them both…

2nd. Helper and Automation:

Go to Settings → Devices & Services → Helper
There, create a “Text” Helper.
Only change the Name to something like “vacuumstatus” and leave everything default.

Ok when you did this, go to
Settings → Automation & Scenes → Create New automation

Go to the 3 Dots on the right corner and “Edit in YAML”
Copy the whole Automation in there and replace what i marked with → !!!REPLACE!!!
You can STRG + F and search for it in the Automation Text.

alias: "360 Vaccum: status"
description: Gets the status of an 360 Robot via Google Custom SDK
trigger:
  - platform: time_pattern
    minutes: "10"
    id: time
  - platform: event
    event_type: google_assistant_sdk_custom_event
    event_data:
      request:  !!!!REPLACE!!!! *What is the Status of the Vaccum*(In your set Google SDK language)
    id: status
condition: []
action:
  - choose:
      - conditions:
          - condition: trigger
            id: time
        sequence:
          - service: google_assistant_sdk.send_text_command
            data:
              command: !!!!REPLACE!!!! *What is the Status of the Vaccum*(In your set Google SDK language)
      - conditions:
          - condition: trigger
            id: status
        sequence:
          - service: input_text.set_value
            data:
              value: "{{ trigger.event.data.response }}"
            target:
              entity_id:  !!!!REPLACE!!!! input_text.YOUR_Text_Helper
mode: queued
max: 10

Ok, when you did that, your Text Helper is updating every 10 Minutes with the Vacuum Status.
You can also trigger the update manually, I show you how.

3rd: Make a GUI

Go to the Dashboard and make a new card where ever you like.
Choose manual and copy this into the card:

Don’t forget to replace what I marked with → !!!REPLACE!!!

type: vertical-stack
cards:
  - type: markdown
    content: >-
      <ha-alert alert-type="info">{{ states('!!!!REPLACE!!!! input_text.YOUR_Text_Helper')
      }}</ha-alert>
    title: 360 Robot
  - square: true
    columns: 3
    type: grid
    cards:
      - show_name: true
        show_icon: true
        type: button
        tap_action:
          action: call-service
          service: google_assistant_sdk.send_text_command
          data:
            command: Start Vacuum Robot(In your set Google SDK language) !!!!REPLACE!!!!
          target: {}
        name: Start
        icon: mdi:play
        hold_action:
          action: none
        show_state: false
      - show_name: true
        show_icon: true
        type: button
        tap_action:
          action: call-service
          service: google_assistant_sdk.send_text_command
          data:
            command: Stop Vacuum Robot(In your set Google SDK language) !!!!REPLACE!!!!
          target: {}
        name: Stop
        icon: mdi:stop
        hold_action:
          action: none
      - show_name: true
        show_icon: true
        type: button
        tap_action:
          action: call-service
          service: google_assistant_sdk.send_text_command
          data:
            command: Vacuum Robot back to charging station(In your set Google SDK language) !!!!REPLACE!!!!
          target: {}
        icon: mdi:ev-station
        hold_action:
          action: none
        name: charge
      - show_name: true
        show_icon: true
        type: button
        tap_action:
          action: call-service
          service: google_assistant_sdk.send_text_command
          data:
            command: !!!!REPLACE!!!! with the same sentence you have defined in your automnation
          target: {}
        icon: mdi:sync
        name: get status

It should work now and look something like this.
grafik

Final Thoughts

It is way too complicated, and 360 should be ashamed of themselves for not just letting us use an API and make our own integration.
But it works pretty good! Sometimes it has a delay of up to 20 seconds or something, but I guess that’s ok for a robot vacuum.

Hope it works for you
Cheers :beers:

2 Likes

Ohh, this is great! Thanks a lot! I’ll let you know once I have set everything up :slight_smile:

1 Like

Quick question - I did not get the replace-part fully it seems. I’m able to get the commands running, stop and charge to work through the HA UI. But status just says “Unknown”.

I’m using en-US as my Google SDK language. Where do I find the “correct” things to put in :slight_smile:
i.e. for !!!REPLACE!!! What is the Status of the Vaccum(In your set Google SDK language)

There, you type in the question you want to get answered by Google Assistant.
It’s like you talk to it through your smartphone, just in typed words.
For Example: “What is my robot vacuum doing?”

The response gets written in your text helper.
Then you can see the text helpers content in your UI if you add it.

Did you run this automation, and looked into your text helper?

Hi @PatpaC thank you for the guide. I can control my two Yeedi Robots with this. But for some reason the Status does not automatically update after 10 minutes. I also tried changing to 1 minute, but still does not automatically update the status.

When I press “Get Status” button, it will then fetch me the update. Any idea how to resolve so it works automatically without pressing “Get Status” button?

Hi @jellytotz,
Yeah i think i know why. I did not make that one clear.

So in your automation under actions the text for the “google sdk send” should be the same as the one above in trigger “event google custom”.
Otherwise the command gets fired in actions via the google sdk but the automation never triggers the other path cause its not the same event/phrase it is listening on.

Nice to hear that it works so far for you :+1:t2::grin:

Thanks @PatpaC , but I’m still a bit confused. Let me share my code.

AUTOMATION

alias: Yeedi Upstairs status
description: Gets the status of Yeedi Upstairs via Google Custom SDK
trigger:
  - platform: time_pattern
    minutes: "10"
    id: time
  - platform: event
    event_type: google_assistant_sdk_custom_event
    event_data:
      request: Is Upstairs running?
    id: status
condition: []
action:
  - choose:
      - conditions:
          - condition: trigger
            id: time
        sequence:
          - service: google_assistant_sdk.send_text_command
            data:
              command: Is Upstairs running?
      - conditions:
          - condition: trigger
            id: status
        sequence:
          - service: input_text.set_value
            data:
              value: "{{ trigger.event.data.response }}"
            target:
              entity_id: input_text.vacuumstatus
mode: queued
max: 10

GUI

type: vertical-stack
cards:
  - type: markdown
    content: >-
      <ha-alert alert-type="info">{{ states('input_text.vacuumstatus')
      }}</ha-alert>
    title: Upstairs Vacuum
  - square: true
    columns: 4
    type: grid
    cards:
      - show_name: true
        show_icon: true
        type: button
        tap_action:
          action: call-service
          service: google_assistant_sdk.send_text_command
          data:
            command: Start Upstairs
          target: {}
        name: Start
        icon: mdi:play
        hold_action:
          action: none
        show_state: false
      - show_name: true
        show_icon: true
        type: button
        tap_action:
          action: call-service
          service: google_assistant_sdk.send_text_command
          data:
            command: Stop Upstairs
          target: {}
        name: Stop
        icon: mdi:stop
        hold_action:
          action: none
      - show_name: true
        show_icon: true
        type: button
        tap_action:
          action: call-service
          service: google_assistant_sdk.send_text_command
          data:
            command: Send Upstairs Home
          target: {}
        icon: mdi:ev-station
        hold_action:
          action: none
        name: charge
      - show_name: true
        show_icon: true
        type: button
        tap_action:
          action: call-service
          service: google_assistant_sdk.send_text_command
          data:
            command: Is Upstairs running?
          target: {}
        icon: mdi:sync
        name: get status

Hi :slight_smile: Sorry for answering that late…

So far I cannot see any problems.

Have you looked into the text helper?
You can do that via developer tools → state, or just open the entity dialog or history.
Have it ever updated your text helper?

You can troubleshoot by doing this:

Go to Automations and press Edit on the automation.
Trigger/Run the automation and go into traces.
It should be triggered 2 times, one right after the other.
grafik

In each of those, there is an executed blue marked Path.
One goes to the right and one goes to the left bottom.
grafikgrafik

The 1st is the request to Google Assistant and the second one is the response.
If you only got 1 there is something wrong with the way you catch the response from Google.

The thing is, your YAML code looks valid to me.
Maybe there is a problem with the custom Google SDK Integration.

Hope that helps bring you on the right path to solve your problem :smiley:

Oh, and I forgot to say that you can also look into changed variables in the second run, there should be the request and the response.

1 Like

Hi guys, for what it’s worth; using a S10 vacuum here.

I slightly adjusted the automation and in such a way that it will update the text field every time you press one of the four buttons. It helps me to see if the commands were parsed by Google Assistant correctly.

Code:

description: Gets the status of an 360 Robot via Google Custom SDK
trigger:
  - platform: time_pattern
    minutes: "10"
    id: time
  - platform: event
    event_type: google_assistant_sdk_custom_event
    event_data:
      request: What is the status of Vacuum 360 S10
    id: 360_status
  - platform: event
    event_type: google_assistant_sdk_custom_event
    event_data:
      request: Start Vacuum 360 S10
    id: 360_start
  - platform: event
    event_type: google_assistant_sdk_custom_event
    event_data:
      request: Stop Vacuum 360 S10
    id: 360_stop
  - platform: event
    event_type: google_assistant_sdk_custom_event
    event_data:
      request: Dock Vacuum 360 S10
    id: 360_dock
condition: []
action:
  - choose:
      - conditions:
          - condition: trigger
            id: time
        sequence:
          - service: google_assistant_sdk.send_text_command
            data:
              command: What is the status of Vacuum 360 S10
      - conditions:
          - condition: trigger
            id:
              - 360_status
              - 360_start
              - 360_stop
              - 360_dock
        sequence:
          - service: input_text.set_value
            data:
              value: "{{ trigger.event.data.response }}"
            target:
              entity_id: input_text.360_vacuum_helper
mode: queued
max: 10

I also used the stack-in-card custom card for a slightly more streamlined GUI element:

cards:
  - type: markdown
    content: >-
      <ha-alert alert-type="info">{{ states('input_text.360_vacuum_helper')
      }}</ha-alert>
    title: 360 Robot Vacuum
  - square: true
    columns: 4
    type: grid
    cards:
      - show_name: true
        show_icon: true
        type: button
        tap_action:
          action: call-service
          service: google_assistant_sdk.send_text_command
          data:
            command: Start Vacuum 360 S10
          target: {}
        name: Start
        icon: mdi:play
        show_state: false
      - show_name: true
        show_icon: true
        type: button
        tap_action:
          action: call-service
          service: google_assistant_sdk.send_text_command
          data:
            command: Stop Vacuum 360 S10
          target: {}
        name: Stop
        icon: mdi:stop
      - show_name: true
        show_icon: true
        type: button
        tap_action:
          action: call-service
          service: google_assistant_sdk.send_text_command
          data:
            command: Dock Vacuum 360 S10
          target: {}
        icon: mdi:ev-station
        name: Dock
      - show_name: true
        show_icon: true
        type: button
        tap_action:
          action: call-service
          service: google_assistant_sdk.send_text_command
          data:
            command: What is the status of Vacuum 360 S10
          target: {}
        icon: mdi:sync
        name: Get status

Screenshot 2023-07-30 122805

I went a bit crazy and tried to build a State for the robot as it is easier to use a state in conditions and such.

Here’s the template helper for it (name: sensor.360_state):

{% if "paused" in states("input_text.360_vacuum_helper") or "stopping" in states("input_text.360_vacuum_helper") or "isn't docked" in states("input_text.360_vacuum_helper") %}
Paused
{% elif "starting" in states("input_text.360_vacuum_helper") %}
Running
{% elif "docking" in states("input_text.360_vacuum_helper") %}
Docking
{% elif "docked" in states("input_text.360_vacuum_helper") %}
Docked
{% else %}
{{ states("input_text.360_vacuum_helper") }}
{% endif %}

I also changed the automation a bit to know if the vacuum cleaner is docked if the state is paused.
I query for the status every minute as long as the state is docking, otherwise I don’t ask google assistant for status updates.

alias: CLEANING_Control_Robob
description: Gets the status of an 360 Robot via Google Custom SDK
trigger:
  - platform: time_pattern
    minutes: /1
    id: time
  - platform: event
    event_type: google_assistant_sdk_custom_event
    event_data:
      request: What is the status of Robob?
    id: 360_status
  - platform: event
    event_type: google_assistant_sdk_custom_event
    event_data:
      request: Is Robob docked?
    id: 360_status_docked
  - platform: event
    event_type: google_assistant_sdk_custom_event
    event_data:
      request: Start Robob
    id: 360_start
  - platform: event
    event_type: google_assistant_sdk_custom_event
    event_data:
      request: Stop Robob
    id: 360_stop
  - platform: event
    event_type: google_assistant_sdk_custom_event
    event_data:
      request: Dock Robob
    id: 360_dock
condition: []
action:
  - choose:
      - conditions:
          - condition: trigger
            id: time
          - condition: state
            entity_id: sensor.360_state
            state: Docking
            for:
              hours: 0
              minutes: 0
              seconds: 10
        sequence:
          - service: google_assistant_sdk.send_text_command
            data:
              command: What is the status of Robob?
      - conditions:
          - condition: trigger
            id:
              - 360_status
              - 360_status_docked
              - 360_start
              - 360_stop
              - 360_dock
        sequence:
          - service: input_text.set_value
            data:
              value: "{{ trigger.event.data.response }}"
            target:
              entity_id: input_text.360_vacuum_helper
          - condition: template
            value_template: "{{ trigger.event.data.response == \"Robob is paused.\" }}"
          - service: google_assistant_sdk.send_text_command
            data:
              command: Is Robob docked?
mode: queued
max: 10

In my UI I use conditions to show buttons based on the state if the Robot.

type: entities
entities:
  - type: custom:template-entity-row
    name: State
    state: '{{ states(''sensor.360_state'') }}'
    icon: fapro:broom
  - type: conditional
    conditions:
      - entity: sensor.360_state
        state_not: Running
      - entity: sensor.360_state
        state_not: Docking
    row:
      type: button
      icon: ' '
      name: ' '
      action_name: Start
      tap_action:
        action: call-service
        service: google_assistant_sdk.send_text_command
        data:
          command: Start Robob
        target: {}
  - type: conditional
    conditions:
      - entity: sensor.360_state
        state_not: Paused
      - entity: sensor.360_state
        state_not: Docking
      - entity: sensor.360_state
        state_not: Docked
    row:
      type: button
      icon: ' '
      name: ' '
      action_name: Pause
      tap_action:
        action: call-service
        service: google_assistant_sdk.send_text_command
        data:
          command: Stop Robob
        target: {}
  - type: conditional
    conditions:
      - entity: sensor.360_state
        state_not: Docking
      - entity: sensor.360_state
        state_not: Docked
    row:
      type: button
      icon: ' '
      name: ' '
      action_name: Dock
      tap_action:
        action: call-service
        service: google_assistant_sdk.send_text_command
        data:
          command: Dock Robob
title: Robob (S6 360 Vacuum)

Screenshot of UI:
image

do i need a google assistant for this ?