Athom Homey app to control any Husqvarna Automower equipped with Automower Connect. Note that this does NOT include the limited Automower Connect@Home Bluetooth variant
Register for a (free) account on Husqvarna developer portal. !!IMPORTANT!! You must use the same login as when you login to the Automower Connect Mobile app! More information here: Husqvarna Developer Portal
Create an âapplicationâ in the Husqvarna developer portal and choose to âconnectâ it to âAuthenticationâ and âAutomower Connectâ APIs. You must enter a redirect-url but it is not used by the homey app so enter any valid url (eg. https://whatever/redirect). Copy the AppKey and AppSecret, you need them later.
Install the Homey app
Configure credentials (appkey and appsecret) in Homey App settings. Do NOT need to enter username and password, they are present only for backward compatibility.
Press Save changes and close the window.
Add mower as an device in Homey
Now you can use triggers, conditions or actions in your flows or see its status in the device overview.
Consider using you PC browser in favor of a mobile device as copy/pasting can be a hassle sometimes. Click configure here My Homey
As described above you should only fill fields AppKey and AppSecret
Polling and Rate limitations
The Husqvarna API currently has an rate limit of 10,000 calls per month and account. By default this app poll the Husqvarna API every 10 minutes. You can change this in app settings. The flow actions work independent of the polling.
Since version 1.3.5 you can control the polling using the app action/then-flow-card âPollâ. Using this you can set âPolling enabledâ to No and control this in detail.
1.0.1 minor changes during Athom certification. Updated flow card titles, app image, description, readme
1.0.0 first version available for testing in the Homey Community Store
1.1.0 - Added new error codes from Husqvarna. Added âNext startâ capability that displays the scheduled next start. (this version never reached âlive statusâ and was only available in test)
1.2.0 - Added support for Husqvarna Auth API changes. Added auth token caching. New improved multiple mower support. (Thanks to TheodorStorm for his contribution!)
1.2.1 - Minor bugfix to support Homey Pro Early 2023 model
1.3.5 â Bugfixes
â Action âPauseâ now send the correct command to the mower (bugfix)
â Trigger âErrorCode changedâ now handled correctly which fixes side effects on other triggers also (bugfix).
â Fixed minor issue changing the polling settings (bugfix).
â Removed unnecessary API login which could cause errors requiring a restart during setup (bugfix). â New features:
â Added 37 new error codes from Husqvarna.
â Added whitespace removal in App configuration credentials dialogue. Could potentially help when copy/pasting credentials on mobile app.
â Added capability âInactive reasonâ recently added by Husqvarna to the mower status.
â Added trigger âInactive Reason changedâ.
â Added flow token errorcode description to trigger âError code changedâ. Eg. in addition to getting errorcode 2 you now can get the âNo loop signalâ description.
â Added action âPollâ that will update status independent of the built-in interval-based polling, which allow control of polling from a flow. You can basically disable the built in polling interval and create your own homey based.
â Added trigger âLast position changedâ including tokens with latitude and longitude of last known position.
â Added 4 new âLast positionâ condition flow cards for comparing current position (latitude/longitude) with a value. As these can be used independent of any trigger they could allow potential new cool flows.
1.4.2 Features Added
â Geopositioning Condition Flow Card âLast Position is Inside Any Polygonâ. A new geopositioning condition flow card has been introduced, enabling conditional checks against an array of polygons. This feature allows flows to determine if the mower is located within specific areas of your garden. Polygons should be created as GeoJSON structures and passed as an argument to the condition. Changes
â Errorcode capability now support unknown errorcodes needed when Husqvarna add new ones between releases. Bugfixes
â Improved handling when adding missing capabilities.
Iâm still on firmware 4.2.0 version on Homey, so I wonât be testing until a stable v5 is released. But Iâll definitely use this app.
At the moment I have my Automower connected via IFTTT that pauses my mowing schedule when the temperature reaches 4 degrees C or lower. Should be easy to build that into a flow with this app.
Perhaps premature or over-demandingâŠMy wish is to have a GPS-position trigger of the Husqvarna 430x.
I have three main areas to mow and the 430x only has two connections for lead wires. For example, I want to make two guide wires switchable with a (Tasmota Sonoff 4ch) circuit and let Homey control it with a flow (GPS trigger) when the mower reaches one or another area.
Thx
Yes, its v5.0 only as that likely will be out soon. Actually i have been running the 5.0 RC releases for quite some time now with zero issues so far. Letâs hope for a release soon so that we can get you to test the Husqvarna app.
The (official) Husqvarna API does not currently provide access to the mower GPS-position. But i guess if you could find another way of getting the position into Homey or maybe some other way of triggering when it enters a specific area it could be done.
Iâve tested the Husqvarna Automower Connect app ver1.0.1 with my 430X mower. Starting via a Homey flow mowing ( command resume) works, but the other commands did not work ( for testing: polling interval 1 minute). So pauze, park gave no reaction.
Once given the start mowing via Homey the original Husqvarna app did not work anymore.
That sounds strange that one command works and not another. The polling-interval is only related to updating the status in the Homey app. If you send command âparkâ it send that to the Husqvarna API immediately regardless of the polling-interval. Also, using the mobile-Husqvarna app should not affect the Homey app at all. If i send park from on, the other will reflect this after x minutes. They both use the same API.
If you press test on a simple flow with âparkâ - do you get a red â!â next to the âparkâ action or is it green? If it is green then the Husqvarna API should have accepted it.
As soon as the spring is here and i get mine out on the lawn i will help you troubleshoot this
I discovered the problem.
If you use the command âparkâ in the Homey flow than the STATE is changed on the Husqvarna server into parked.
So in the Husqvarna app youâll see the mower is parked and so the park-button in not showed in the app. And so the given pard command will not result in a park action and the mower keeps mowing.
My advise:
Remove all STATe commands from the homey app.
Greetings and thanks for your efforts
I am not 100% sure i follow. If possible please describe in more detail on what you are trying to accomplish and what you are doing in both Homey and in the Husqvarna app. Could you do a screenshot? When you say that the state is changed to Parked i guess you mean the activity and not state right?
In the mean time it might help for me to explain some more on the Homey implementation.
The âactionsâ are separated from triggers and âdisplay of capabilitiesâ which both rely on the API-polling. You can use the actions even if you disable polling.
If you send an action (like âParkâ) the capability activity will (if polling is enabled) change to âGoing homeâ on the next poll followed by a âParkedâ x minutes after that. The capability state should not change, it should remain âIn operationâ the whole time. The triggers and capabilities are not updated based on the actions being done from the Homey app itself, they are only based on changes when polling the API.
The Homey app does not set âStateâ or âActivityâ in the Husqvarna API, that is not possible or allowed. It can only send âactionsâ to the API.
I have followed all the steps you posted but I canât connect to my mower.
I have the developer account on Husqvarna, however I have not used the same email address as my normal Husqvarna account. So I guess I need to connect the developer account to my normal user account, any ideas how to do that?
The way the Homey app integrates to the Husqvarna API (using Password Credentials grant) requires the account used to be your ânormalâ Automower Connect account as in the same account as the one you use in the Husqvarna mobile app.
I am not 100% sure but i do not think there is a way to delegate or connect another developer account with your Automower.
Thanks for the help, @BufferOverflow, I changed email address to a new provider so preferred to use my new one. But no hassle, used my old one now (same as my ânormalâ Automower account) and setup an account again.
I run into an error when adding the device to Homey though,
One thing that is easy to forget is to connect the two APIs (Authentication API, Automower Connect API) to your âHusqvarna Applicationâ. It is the â+ Connect new APIâ option i am thinking of.
If that was not is not it maybe a screenshot from both husqvarna developer portal and the Homey Husqvarna Application settings could help. Donât forget to obfuscate/hide any credentials.
If I run the test command curl -X POST -d "grant_type=password&client_id=<token>&username=<email>&password=<PASSWORD>" https://api.authentication.husqvarnagroup.dev/v1/oauth2/token on my raspberry pi it seems to get a valid response (not familiar with the language, but seems valid to me): {"access_token":"<xxxxxxxxx>","scope":"iam:read amc :api","expires_in":86399,"refresh_token":<xxxxxxxxxx>","provider":"husqvarna","user_id":"<xxxxxxx>
As you get the auth token you could try the API to get a list of your mower(s) back.
Use the PC browser to set the App settings allowing a better copy/paste experience than the mobile. Remove all settings and copy/paste them again. You need to enter husqvarna username (email), password and clientid/app-key. The secret is not used. This is the app-settings page Homey Developer Tools