Automower Binding (G2)

Maybe a solution is to retrieve the position if an error occurs. So we should get into any limits and get a hint where to search in case of an error

I think always retrieving the position would automatically let you know the last position when an error occurs, so no additional logic would be required; and we could simply discard the retrieved positions if they are only required for locating the device.

I didn’t look into the logic behind the array of waypoints but assuming they are recorded in certain time intervals would also provide a pretty neat coverage over possibly longer timeframes (as required by the quota of API requests).
Maybe I should simply tape a mobile phone with GPS to the mower at some point and match a separate GPS tracking to the output of a few API requests while the mower is active… this might also provide some practical data to determine the deviation from the actual position.

2 Likes

Actually I did take a stab at it and it seems to work fine so far.
I’ve actually added now 50 channels for all waypoints.

If anyone is interested the changes are available here: GitHub - bern77/openhab-addons at bern77-gps

I’m also happy to share the JAR.

1 Like

Hi,
thanks for doing this enhancements! :grinning:
Can you share how you display the waypoints? My Items are empty.
That’s how I try to implement the Waypoint.

String      AutomowerWayPoint1  "Waypoint 1 [%s]"   <movecontrol>   (Automower, DB) { channel="automower:automower:mybridge2:myAutomower:position01" }

Happy for your suggestions!

br. Christian

Please use Location as the item type, then it should work.

1 Like

And in the channel please use positions#position01

1 Like

Hello bern77,

thanks for your help!!! :smiley: Working great!

Does anyone have a suggestion how to display the way, indicated by the waypoints?

Br. Christian

Hello Christian,
the Grafana PlugIn TrackMap can do this. But for this you need latitude and longitude separately. With openhab an influxdb the location is stored as a comma separated value.
Perhaps there is a suitable query that extracts latitude or longitude from the stored coordinates. Unfortunately, I have not yet been able to do this with the help of the documentation.
A few ideas regarding path visualization can be found here.

Does anyone have an idea or solution for openhab, influxdb and TrackMap?

I get this from the binding now and then.

2021-08-26 15:50:34.394 [ERROR] [oauth2client.internal.OAuthConnector] - grant type refresh_token to URL https://api.authentication.husqvarnagroup.dev/v1/oauth2/token failed with error code invalid_grant, description Failed to find token
2021-08-26 15:50:34.400 [WARN ] [ternal.bridge.AutomowerBridgeHandler] - Unable to fetch automowers: Rest call failed: statusCode=-1, message=Unable to authenticate

Only way to fix it is to delete the thing and recreate it with a new identifier.

What can this be?

Hi Sven,
got it! I use Grafana and InfluxDB. I seperate the values with string manipulation in Latitude und Longitude and set up a Dashboard with the following Select statements:

SELECT mean("value") FROM "MowerWayPoint1Lat" WHERE ("item" = 'MowerWayPoint1Lat') AND $timeFilter GROUP BY time($__interval) fill(null)
SELECT mean("value") FROM "MowerWayPoint1Long" WHERE ("item" = 'MowerWayPoint1Long') AND $timeFilter GROUP BY time($__interval) fill(null)

Then I implement a link to a rendered image in my sitemap which is refreshed every 10 seconds.
br. Christian

Hi All,
just found that the value for the calendar start time (which is in minutes after midnight) is already reflecting the correct time zone. Therefore it always shows a difference of two hours for me (due to timezone handling). On the other side timezone handling is necessary during the day. No clue how to handle this in a correct way. Is there a different state when waiting for the next calendar based start which we can use for the decission to do timezone handling or not?

br. Christian

My modifications work quite well for me, so I’ve now created a PR for them (see https://github.com/openhab/openhab-addons/pull/11323).

@markus_pfleger, I’m curious about your inputs / concerns and more than happy to discuss.

Thanks,
Bernhard

I just got the same problem last week. It has been working fine for several weeks and now it’s not able to connect. Is there a know issue?

I’m running openHAB 3.3.0.M6

I tied to install the Binding and the Bridge but without success.
My bridge is red…
I am using the official 3.2.0 build from openhab.
Is there a hint to get the bridge online?
Or could it be that this is a Husquarna problem???

brgds

Hulli

Hello Frank,

I think it has to do with this issue:

br. Tobi

Hello,

Does this binding still work?
I Got a key and secret on the Husqvarna website but i get an error

Any idea?

Hi @jpcolin,

the binding does work for me. Can you share some logs?

Best, Lui

Same here, works fine. Did you try refreshing/renewing the keys?

I tried, same error.

Is this correct the http://localhost?

where can i find those?