Bosch Indego

Hi @all,

i recently found out that there is an api for the bosch indego lawn mower which was also integrated in an openhab binding.

Is there a component in hass to make use of this?

Source:


Cheers

2 Likes

Hi, I am also looking for this…

I will create a component for this if I find some time :slight_smile:

3 Likes

you the man!

I am happy to help where I can, but I would not know where to start…

Otherwise, testing etc… Just give me a shout

any updates here?

would be good to get one in before the summer! Although my mower broke after about 4 months of usage… grrr, has to get a new pcb under wattanty… still bummed…

is there any updates regarding this?

Hi,

sorry for my very late reply. I created a small python script to test the connection to the Bosch API and it is working fine so far.

Creating a Component for Home Assistant should be very easy for the developers. Any volunteers to create one? I will provide the code for authentication and a sample on how to read the status and set the state to mow / pause / returnToDock.

Cheers,
iMarkus

Hi,

I am not a developer but can have a go if you paste your work to date here?

Thanks

Sure, just use your Indegos serial, app username and password. This script reads the status and is able to send “mow”, “pause” and “returnToDock” (just uncomment the according lines).

Here you can find a full documentation of the API and status codes.

import json
import requests
from requests.auth import HTTPBasicAuth

serial = '123456789'
username = '[email protected]'
password = 'password'
api_url = 'https://api.indego.iot.bosch-si.com/api/v1/'
HTTP_HEADER_CONTENT_TYPE = 'Content-type'
CONTENT_TYPE_JSON = 'application/json'

header = {HTTP_HEADER_CONTENT_TYPE: CONTENT_TYPE_JSON}
body = {'device': '', 'os_type': 'Android', 'os_version': '4.0', 'dvc_manuf': 'unknown', 'dvc_type': 'unknown'}
jsonBody = json.dumps(body)

response = requests.post(api_url + 'authenticate', data=jsonBody, headers=header, auth=HTTPBasicAuth(username, password), timeout=30)

print(response.content)
print(response.status_code)

data = json.loads(response.content)
print(data)
contextId = data['contextId']
print(contextId)

header = {HTTP_HEADER_CONTENT_TYPE: CONTENT_TYPE_JSON, 'x-im-context-id': contextId}

response = requests.get(api_url + 'alms/' + serial + '/state', headers=header, timeout=30)

print(response.content)
print(response.status_code)

header = {HTTP_HEADER_CONTENT_TYPE: CONTENT_TYPE_JSON, 'x-im-context-id': contextId}

#body = {'state': 'mow'}
#body = {'state': 'pause'}
body = {'state': 'returnToDock'}
jsonBody = json.dumps(body)
response = requests.put(api_url + 'alms/' + serial + '/state', data=jsonBody, headers=header, timeout=30)

print(response.content)
print(response.status_code)

response = requests.delete(api_url + 'authenticate', headers=header, timeout=30)

print(response.status_code)

I managed to create a component for the indego. Currently it is still in development but reading the state is already possible :slight_smile:

image

3 Likes

Hi @all,

I recently sold my Indego but want to share my latest custom component I made.

Github

Best regards,
iMarkus

1 Like

Hi,

I am sorry you sold yours. Was it giving you problems? Anyway, I just wanted to check. I assume when you say in the docs on github:

Add new platform to your configuration.yaml

- platform: indego
  host: api.indego.iot.bosch-si.com
  port: 443
  username: !secret indego_username
  password: !secret indego_password
  id: !secret indego_id

That this is under the Sensors?

Also, where would you add this part:

Finally add your new sensor called indego_state:

sensor.indego_state

Thanks very much for this.

Incidentally, I have now finally received my replacement 350 connect (yesterday) after my original apparently “blew the circuit board” in March after only 3 months… best robot lawnmower in terms of performance (love the stripes) customer service is appaling, and well hopefully this one lasts…

Thanks again for all your hard work on this…

same question

HI, this is the error in my logs:

Error while setting up platform indego

Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/homeassistant/helpers/entity_platform.py", line 129, in _async_setup_platform
    SLOW_SETUP_MAX_WAIT, loop=hass.loop)
  File "/usr/local/lib/python3.6/asyncio/tasks.py", line 358, in wait_for
    return fut.result()
  File "/usr/local/lib/python3.6/concurrent/futures/thread.py", line 56, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/config/custom_components/sensor/indego.py", line 63, in setup_platform
    api_url=url, username=username, password=password, serial=serial)
  File "/config/custom_components/sensor/indego.py", line 202, in __init__
    _LOGGER.debug("JSON Response: %s", self.login.json())
  File "/usr/local/lib/python3.6/site-packages/requests/models.py", line 896, in json
    return complexjson.loads(self.text, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/simplejson/__init__.py", line 518, in loads
    return _default_decoder.decode(s)
  File "/usr/local/lib/python3.6/site-packages/simplejson/decoder.py", line 370, in decode
    obj, end = self.raw_decode(s)
  File "/usr/local/lib/python3.6/site-packages/simplejson/decoder.py", line 400, in raw_decode
    return self.scan_once(s, idx=_w(s, idx).end())
simplejson.errors.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

ohh… got it work. but as i understand there is no possibility yet to send commands to mower?

Hi,

@typeonegative can you elaborate? thanks

i just added this under sensors:

- platform: indego
  host: api.indego.iot.bosch-si.com
  port: 443
  username: !secret indego_username
  password: !secret indego_password
  id: !secret indego_id

copied indego.py to config/custom_components/sensor
restart and after that i had sensor.indego_state under dev-state

indego

When you signed in to the app, did you create an account directly or use facebook or a 3rd party service?

I have a feeling my error is down to the authentication…

i just added this and it worked for me.
I however did add the wrong password first time (just spelling error) and got a similar error message as you have here. sadly i fixed it and deleted the log so dont have the exakt error anymore to compare.
But i would guess you have authentication error.
I created my indego account in the app first time just with mail and password.

Not really a answer to your question, only some input. Hope it helps somhow