Stihl Imow - Robotic lawn mower

Ok thanks. I thought you use nodered directly do get the values from the stihl imow. The only thing that´s from intrest for me is the gps position. I looking for a way to poll these informations to node red.

Background, i will kow in which area the mower operats that i can do different thinks on my smarthome depending on the position of the mower.

Hello @Red1 Could you explain how you added the iMow’s lat/long to a lovelace map card? Seems I am not clever enough…

I did as follows:
in a NodeRed call service node fill in “device_tracker” as the domain and “see” as the service.
With data: formatted as json as follows:

 {
     "dev_id": "Toon",
     "gps": [
         "{{states.sensor.toon_coordinatelatitude.state}}",
         "{{states.sensor.toon_coordinatelongitude.state}}"
     ]
 }

Toon is the name of my mower. Call the service node every 30-60 secs from a repeating timestamp node.
Then create a map card in Lovelace with the following yaml text:

type: map
entities: 
 - entity: device_tracker.toon
default_zoom: 20
dark_mode: false
title: Lokatie

I am sure you can create an automation to do exactly the same thing.

1 Like

Thanks. I was new to Automations … so it took me a while, but finally succeeded :slight_smile:

Below is my automations.yaml which I got when going through the Automation Editor in HA.

Note that I renamed my MI 622 PC in HA from the original 43900xxxx to imow.
This results in entity names being (e.g.) sensor.imow_coordinatelatitude instead of original sensor.43900xxxx_coordinatelatitude

- id: '1682936495728'
  alias: iMow Location Automation
  description: ''
  trigger:
  - platform: numeric_state
    entity_id: sensor.imow_coordinatelatitude
    above: -90
    below: 90
  - platform: numeric_state
    entity_id: sensor.imow_coordinatelongitude
    above: -180
    below: 180
  condition: []
  action:
  - service: device_tracker.see
    data:
      dev_id: imow
      gps: '{% set imow_lat = states(''sensor.imow_coordinatelatitude'') %} {% set
        imow_long = states(''sensor.imow_coordinatelongitude'') %} {{ ( imow_lat ,
        imow_long ) }} '
  mode: single

Hello,

after updating HA to 23.5.1 I got the following error:

2023-05-05 12:02:03.165 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration stihl_imow which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant

2023-05-05 12:03:04.304 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry Lawn Mower for stihl_imow

File “/config/custom_components/stihl_imow/init.py”, line 138, in async_setup_entry

Any idea how to fix it?

Best regards

I had an error loading this component. I noticed the server was down for maintenence for a while. Everything is normal now on this end. I have HA version 2023.5.1 installed.

Do you use the new HA Version 2023.5.x?

Version 2023.5.1

Mi looks normal only no update in the app en also no update in HA. Robot is mowing only app and HA shows docked.

Thanks.
I have still the error.

2023-05-06 00:49:00.003 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry Lawn Mower for stihl_imow

File “/config/custom_components/stihl_imow/init.py”, line 138, in async_setup_entry

2023-05-06 20:56:42.365 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry Lawn Mower for stihl_imow

File “/config/custom_components/stihl_imow/init.py”, line 138, in async_setup_entry

:cry:

I updated the legacy version to 0.1.4 which should address the issue about config _entry.

Hi Chris,

I am just getting into HA and have an imow 632RC and found your integration.

I have the integration set up, but it only finds 3 entities - battery level, state and blade operating time. am i doing something wrong? woudl love to be able to get the location data and control teh mower throguh HA if possible, like others seem able to do.

Any thoughts much appreciated.

Thanks for all your efforts in putting this together and getting to this point.
Best regards

Hello the intregration works very well. I love it

But I got a problem. I repair my Imow whit a new elektronic modul. But no the connection is gone. There is a question mark in the display.

Is there anyone who can help mee

Not really the place for electronics advice. But my ten cents: your mobile card does not get any power. Look for loose connection.

Any thoughts here much appreciated - what am i missing to get access to all of the entities like the GPS coordinates that others describe?

Many thanks in advance for any help!
Cheers

Hi Chris, long time ago we were testing your integration for iMow. I never did get the start mowing command to work for some reason on my 632C machine. I am learning a little python now, so I went back to the original python files that came in your Github store. Many of the commands that are listed in your python code in the ReadMe work like a charm. So I guess I installed correctly and I have set up the credentials correctly too. Even the return to docking command works:

await mower.intent(IMowActions.TO_DOCKING)

However, when I execute the START_MOWING command it fails to execute (“unprocessable entity”). I am trying different parameters, but not succeeding, in part because I do not exactly know which parameters to pass to mower.intent and what is the proper way to pass these. Can you please let me know? It would be nice if I could pick up on this again, because the App is now stuck too, for reasons on Stihl’s side. Sending commands from home assistant is now the only option. Many thanks for your help!!

Hi AR, if you enable the beta version of the integration in HACS you should find the entities. Maybe need to re-configure the integration in HA afterwards.

Hi Jan,
it seems you have to make sure that your action object used here in line 380 (https://github.com/ChrisHaPunkt/stihl-imow-webapi/blob/b4b11d17ec0c3919bc7ad55c17570f5cb25b7d3f/imow/api/init.py)
looks like the one you intercepted earlier within your app debugging.
If you enable debug logging the actual used action object should be printed out. Or you change the line into logging.info(…) in the imow-webapi code.

Hi Chris,
I have done more listening to the App traffic for my particular model 632C. This model needs a “startMowing” command, and does not recognise the command that is currently programmed “startMowingFromPoint”. In fact there is no such option in my App at all.

I have added START_MOWING_NOW to reference to “startMowing” in the IMowActions() class in api/ common/actions.py.

There are two ways to execute start mowing for the 632 model:

  1. With a default endtime, approximately 2 hours after current time at a 10 minute internal (00, 10, 20, 30, 40, 50) :
    The action_object looks like this: please note “startMowing” rather than “startMowingFromPoint”

{“actionName”:“startMowing”,“actionValue”:“16 digit externalid,2023-08-12 20:50”}

  1. With an endtime about 2 hours after now, and starttime a little later than now at a 10 minute interval:

{“actionName”:“startMowing”,“actionValue”:“16 digit externalid,2023-08-12 21:00,2023-08-12 19:00”}

I have started to experiment with this and have it working now for the test script.
The function call is:

await mower.intent(IMowActions.START_MOWING_NOW,0,'2023-08-14 14:00')

I have added a 0 as default startpoint, because the code in __init__.py refers to it. And I wanted to minimise the changes to it.

To make this work I needed to change two lines of code in imow/api/__init__.py:

In line 363 I eliminated the quotes around the 0: (I think the startpoint is an int not a str):

if "-" in str(duration) and startpoint == 0:

In line 370 I added some code to ensure the startpoint does not get added to the action_object, because it is not needed for the 632 model:

if imow_action == IMowActions.START_MOWING or imow_action == IMowActions.START_MOWING_NOW

This now works for my 632 model at least in the test script that you provided.
Next step is to figure out how this command can get entered into Home Assistant. That is a whole new ballgame for me.

This looks great! Can you share how you did it?