Segway Navimow

Hi,

Yes I’ll be happy to share my scripts and everything :blush:

The Google Assistant SDK Integration (the one that can successfully receive text responses from Google Assistant) is there:

The integration between Navimow and Google Assistant is very straightforward, IIRC you can trigger the linkage from the Navimow app itself. That part is easy really. Once it’s done, you’ll see the device in the Google Home app (which I had never used before that day) :grin:

You don’t need to use (not even launch) the Google Assistant app.

Definition of Navimow sensors triggered by a custom event (in configuration.yaml):

template:
(...)
  - trigger:
      platform: event
      event_type: set_navimow_i105_state
    sensor:
      - name: "Navimow i105: Battery level"
        unique_id: "navimow_i105_battery_level"
        device_class: battery
        state_class: measurement
        unit_of_measurement: "%"
        state: "{{ trigger.event.data.battery_level }}"

      - name: "Navimow i105: Status"
        unique_id: "navimow_i105_status"
        icon: "mdi:robot-mower"
        state: |
          {{
            {
              "is running": "Running",
              "isn't docked": "Running",
              "is paused": "Paused",
              "is docked": "Parked",
              "isn't running": "Parked"
            }[trigger.event.data.status] | default('unknown')
          }}

Automation to periodically poll Navimow data through Google Assistant API, and push them to the sensors through the custom event:

alias: "Navimow i105: Get state"
description: >-
  Notes:

  * Google Assistant API rate limit: 500 requests per 24 hours (seems to reset
  at 7:00am UTC).

  * Quota status:
  https://console.cloud.google.com/apis/api/embeddedassistant.googleapis.com/quotas?...
triggers:
  - trigger: time_pattern
    minutes: /5
  - trigger: homeassistant
    event: start
conditions:
  - condition: numeric_state
    entity_id: sun.sun
    attribute: elevation
    above: -15
actions:
  - action: google_assistant_sdk_custom.send_text_command
    metadata: {}
    data:
      command:
        - what is Navimow i105 battery level
        - what is Navimow i105 doing
    response_variable: result
  - event: set_navimow_i105_state
    event_data:
      battery_level: >-
        {{ result.responses[0].text | regex_replace(find='.* ([0-9]+)
        percent.*', replace='\\1', ignorecase=True) }}
      status: >-
        {{ result.responses[1].text | regex_replace(find='.*Navimow i 105
        (.*)\.', replace='\\1', ignorecase=True) }}
mode: restart

IMHO the only (slightly) annoying part is the step to enable Google Assistant SDK in Google Cloud Console - but it only needs to be done once, and the steps are rather well documented in Home Assistant’s documentation:

Feedback welcome :smiley:

6 Likes