Integrating our Bosch Indego lawnmower into Home Assistant

Well, following the posts on integrating IoT devices from our smart homes with Home Assistant, how could it be less to be able to control, know the status and make automations with our Bosh Indego lawnmower.

Vamos a utilizar 'Controller application and API for Bosch Indego Connect’ that we already saw In this post how to install and integrate with Grafana. On this occasion we will take advantage of this magnificent project to use an adapter that comes with it and will allow us to integrate it into Home Assistant thanks to the fact that it can talk through MQTT with our Broker. Being able to know the status or send commands through topics. We will have all this integrated with the rest of the devices in our house, in a simple interface and as you can imagine through automations we will be able to know when the cut begins, If it gets stuck, When did you just mow; and of course depending on whether it has rained/is going to rain, Well, let him go out and cut.

After installing it, we will lift the Indego adapter with MQTT indicating the file with the connection data. This adapter can be run from a Windows or a Linux, in my case I have it mounted on Linux, So if I want it to get up every time that machine starts up, We'll put him in a cron task:

@reboot /home/pi/indego/bin/IndegoMqttAdapter -c /home/pi/indego/IndegoMqttAdapterConfig.properties

And the IndegoMqttAdapterConfig.properties file would be this, each one of them corrects their access data to Indego (mail/password), and MQTT data:

# Base url of the Indego web service (if different from default)
# indego.mqtt.device.base-url=https://api.indego.iot.bosch-si.com/api/v1/
# Username for connecting to the Indego server (the same as in Indego app)

indego.mqtt.device.username=USUARIO_MAIL_DE_INDEGO
# Password for connecting to the Indego server (the same as in Indego app)
indego.mqtt.device.password=CONTRASEÑA_DE_INDEGO

# Connection to MQTT broker indego.mqtt.broker.connection=tcp://DIRECCION_IP_BROKER_MQTT:1883
# Unique id of this client indego.mqtt.broker.client-id=IndegoMqttAdapter
# Username for authenticating on the MQTT broker indego.mqtt.broker.username=USUARIO_MOSQUITTO
# Password for authenticating on the MQTT broker indego.mqtt.broker.password=CONTRASEÑA_MOSQUITTO
# Topic root (namespace) for Indego topics indego.mqtt.broker.topic-root=test/device/indego

# Specifies how often the Indego state is queried and the MQTT topics should be updated indego.mqtt.polling-interval-ms=30000

Cuando tengamos el servicio del adaptador ya corriendo en alguna máquina, ya podremos dar de alta nuestro cortacesped Bosch Indego en Home Assistant, ¿how? As usual, modificando el fichero configuration.yaml, We will add the following code in the sensors section:

sensor:
...
  - Platform: MQTT name: "Indego 350 - Energy status"
    state_topic: "test/device/indego/online"
    value_template: '{% if value == "Off" %}OFF{% else %}On{% endif %}'
    icon: mdi:car-battery

  - Platform: MQTT name: "Indego 350 - State"
    state_topic: "test/device/indego/stateMessage"
    icon: mdi:map-marker value_template: '{% if value == "Docked" %}At the base{% elif value == "Charging" %}Loading{% elif value == "Mowing" %}Mowing{% elif value == "Relocalising" %}Locating myself{% elif value == "Returning to dock" %}Coming home{% elif value == "Border cut" %}Trimming the edges{% elif value == "Idle in lawn" %}Idle in the garden{% elif value == "Unknown" %}Unknown{% elif value == "Pause" %}Slow{% elif value == "Returning to dock - Battery low" %}Low battery{% endif %}'

  - Platform: MQTT name: "Indego 350 - Mowed"
    state_topic: "test/device/indego/mowedPercent"
    unit_of_measurement: "%"
    icon: mdi:robot-mower

  - Platform: MQTT name: "Indego 350 - Last Mowing Time"
    state_topic: "test/device/indego/runtimeSessionOperationMins"
    icon: mdi:Shovel value_template: '{{ (value | float / 60) | round(2, "Ceil") }}'
    unit_of_measurement: "h"

  - Platform: MQTT name: "Indego 350 - Time worked"
    state_topic: "test/device/indego/runtimeTotalOperationMins"
    icon: mdi:value_template timer: '{{ (value | float / 60) | round(2, "Ceil") }}'
    unit_of_measurement: "h"

And after restarting Home Assistant and recharging the changes, we will be able to add a card with all these entities. In which we can see the energy status, The condition of the lawn mower (If it's at the base, Loading, Mowing, Ranking, Coming home, Trimming the edges, Idle in the garden/stuck, with low lateria… ), the percentage of the cut, The time of the last reap, total time worked… The last one I get with a mysql query to Hassio's DB.

By the way, If you want to add a card with 3 bellboy, a Play to start mowing, one Pause or another to finish the mowing, I leave you with this example:

cards:
  - entity: sensor.indego_350_estado hold_action:
      action: none icon: 'mdi:play'
    icon_height: 30Px name: To reap tap_action:
      action: call-service service: mqtt.publish service_data:
        Payload: MOW topic: test/device/indego/command type: entity-button
  - entity: sensor.indego_350_estado hold_action:
      action: none icon: 'mdi:pause'
    icon_height: 30Px name: Pause tap_action:
      action: call-service service: mqtt.publish service_data:
        Payload: PAUSE topic: test/device/indego/command type: entity-button
  - entity: sensor.indego_350_estado hold_action:
      action: none icon: 'mdi:home'
    icon_height: 30Px name: Home tap_action:
      action: call-service service: mqtt.publish service_data:
        Payload: RETURN topic: test/device/indego/command type: entity-button type: horizontal-stack

I leave you with this example of automation, so that it can go out to water at 6am if it hasn't rained or it's not going to rain, Of course, the part of detecting rain will depend on each one, you can use the AccuWeather integration.

This automation notifies us by Telegram message or by the speakers of the house that it begins to mow. The idea of this is in case we mow during the day and we want to warn that it is going to come out, So I don't catch 😉 you

And this latest automation will send us a Telegram message and notify us over the speakers that the Bosch Indego lawnmower has become stuck.

Hoping it has been useful to you, I send you a greeting to tod@s and as always thank you for sharing it on social networks.

Recommended Posts

Author

nheobug@bujarra.com
Autor del blog Bujarra.com Cualquier necesidad que tengas, Do not hesitate to contact me, I will try to help you whenever I can, Sharing is living ;) . Enjoy documents!!!