Python plugin: Husqvarna automower

Python and python framework

Moderator: leecollings

Post Reply
Filip
Posts: 107
Joined: Thursday 03 November 2016 10:12
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Python plugin: Husqvarna automower

Post by Filip »

Just to inform you that I created a plugin for the Husqvarna automower. It makes use of the official Husqvarna API.
Code and information can be found at https://github.com/FilipDem/Domoticz-Hu ... wer-plugin.
Filip
User avatar
waltervl
Posts: 5741
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: Python plugin: Husqvarna automower

Post by waltervl »

Thanks for the plugin. I added it to the plugin list: https://www.domoticz.com/wiki/Plugins
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
MassassiOrder
Posts: 4
Joined: Wednesday 30 September 2020 9:35
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python plugin: Husqvarna automower

Post by MassassiOrder »

Very cool, thanks,

Do you also have a manual how to add it to Domoticz?
Filip
Posts: 107
Joined: Thursday 03 November 2016 10:12
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python plugin: Husqvarna automower

Post by Filip »

Hi,

this is available in https://www.domoticz.com/wiki/Using_Python_plugins.
Best way that you run the Husqvarna.py in as command line to see if you have all working before installing in Domoticz. This will be useful to be sure that all the required python libraries are installed.

Be aware that I have currently a ticket open at the CloudAPI Husqvarna helpdesk... There are unexpected http 403 errors. However these are not real authentication errors, but rather timeout on the Husqvarna Cloud. They are working to find a solution.
This is not really blocking, just annoying getting from time to time such errors in Domoticz.

Of course this requires a minimum of knowledge of python.

F
MassassiOrder
Posts: 4
Joined: Wednesday 30 September 2020 9:35
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python plugin: Husqvarna automower

Post by MassassiOrder »

Thanks for the info. I will manage.
Doudy
Posts: 246
Joined: Tuesday 09 August 2016 9:09
Target OS: -
Domoticz version:
Contact:

Re: Python plugin: Husqvarna automower

Post by Doudy »

Thank you for this info
RaspberryPi - RFLink - Zwave - WH2600
Domoticz : 2020.2 | Dashticz : V3.12 Master | dzvents : 3.0.2 | Python : 3.7.3
Filip
Posts: 107
Joined: Thursday 03 November 2016 10:12
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python plugin: Husqvarna automower

Post by Filip »

I have currently a new version in which I implemented a retry mechanism. It is currently under testing...
@MassassiOrder, @Doudy: if you are happy with the plugin, contributions are always welcome to compensate my investment of time.
Kind regards,
F
Doudy
Posts: 246
Joined: Tuesday 09 August 2016 9:09
Target OS: -
Domoticz version:
Contact:

Re: Python plugin: Husqvarna automower

Post by Doudy »

Hello,

I have an Automower 310 Mark II which communicates via bluetooth!
Is your plugin functional with this type of machine?

;)
RaspberryPi - RFLink - Zwave - WH2600
Domoticz : 2020.2 | Dashticz : V3.12 Master | dzvents : 3.0.2 | Python : 3.7.3
Filip
Posts: 107
Joined: Thursday 03 November 2016 10:12
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python plugin: Husqvarna automower

Post by Filip »

It uses the Husqvarna Cloud solution... So if your mower doesn't support the Husqvarna Cloud, it will not work.
Doudy
Posts: 246
Joined: Tuesday 09 August 2016 9:09
Target OS: -
Domoticz version:
Contact:

Re: Python plugin: Husqvarna automower

Post by Doudy »

👍
RaspberryPi - RFLink - Zwave - WH2600
Domoticz : 2020.2 | Dashticz : V3.12 Master | dzvents : 3.0.2 | Python : 3.7.3
Filip
Posts: 107
Joined: Thursday 03 November 2016 10:12
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python plugin: Husqvarna automower

Post by Filip »

Good new: 1) Husqvarna solved the problem with the authentication errors! So the plugin runs now stable without generating errors due to the Husqvarna Cloud problem. 2) A new version of the plugin is uploaded doing retries (this was initially a workaround for the Husqvarna problems, but is anyway useful).
This runs now since a while at my side successfully! Enjoy.
MassassiOrder
Posts: 4
Joined: Wednesday 30 September 2020 9:35
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python plugin: Husqvarna automower

Post by MassassiOrder »

Sorry I did not have time to install the plug in.

Do you also have a screenshot what you show in Domoticz?
MassassiOrder
Posts: 4
Joined: Wednesday 30 September 2020 9:35
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python plugin: Husqvarna automower

Post by MassassiOrder »

@Doudy
I seem to have a problem. I do not have a Husqvarna, but a Gardena. The API and log in is all the same, but I get an error retrieving data from the mower.
Error: Gardena: No Husvarna mowers available in the list.
Looks like its looking in an other list or so.

I did change one URL in your code to https://api.smart.gardena.dev/v1 (instead of Husvarna)
Are there any other links I need to change?
User avatar
madpatrick
Posts: 662
Joined: Monday 26 December 2016 12:17
Target OS: Linux
Domoticz version: 2024.7
Location: Netherlands
Contact:

Re: Python plugin: Husqvarna automower

Post by madpatrick »

Hi Fred,

The Cloud function for the Husqvarna and your plugin is that called "Automower® Connect" ?
https://www.husqvarna.com/nl/services/a ... r-connect/

I want to buy a Husqvarna, but the dealer is wll-known with hightech features like Domoticz
Thanks for your feedback !
-= HP server GEN11 =- OZW -=- Toon2 (rooted) -=- Domoticz v2024.7 -=- Dashticz v3.14b on Tab8" =-
Aandegrens
Posts: 23
Joined: Saturday 08 April 2017 19:36
Target OS: Windows
Domoticz version: 2020.2
Location: Netherlands
Contact:

Re: Python plugin: Husqvarna automower

Post by Aandegrens »

Hi Filip,

I was very happy to find your plugin but I can't get it working.
It's added to Domoticz and I see it in the hardware, but it is not showing any devices.
It is showing some logging in Domoticz.

When I run it in the commandlint I get the following error:

Code: Select all

C:\Windows\System32>python "C:\Program Files (x86)\Domoticz\plugin\Domoticz-Husqvarna-Automower-plugin\plugin.py"
Traceback (most recent call last):
  File "C:\Program Files (x86)\Domoticz\plugin\Domoticz-Husqvarna-Automower-plugin\plugin.py", line 41, in <module>
    from domoticz_tools import *
  File "C:\Program Files (x86)\Domoticz\plugin\Domoticz-Husqvarna-Automower-plugin\domoticz_tools.py", line 17, in <module>
    import Domoticz
ModuleNotFoundError: No module named 'Domoticz'
I really don't know what I have missed.

Any help would be appreciated.

Regards Frank
Filip
Posts: 107
Joined: Thursday 03 November 2016 10:12
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python plugin: Husqvarna automower

Post by Filip »

Hi, seems it cannot find the python library Domoticz. This should have come with the installation of Domoticz...
So i think it is rather a problem with the installation/setup of Domoticz than the plugin...
Have you already another python plugin running?
F
Aandegrens
Posts: 23
Joined: Saturday 08 April 2017 19:36
Target OS: Windows
Domoticz version: 2020.2
Location: Netherlands
Contact:

Re: Python plugin: Husqvarna automower

Post by Aandegrens »

Hi Filip,

no, this is the first plugin Im using.
I was going to upgrade to the newest stable version of Domoticz.
Let's see if that solves the issue.

Frank
Aandegrens
Posts: 23
Joined: Saturday 08 April 2017 19:36
Target OS: Windows
Domoticz version: 2020.2
Location: Netherlands
Contact:

Re: Python plugin: Husqvarna automower

Post by Aandegrens »

Hi Filip,
the hardware is added and I'm seeing the devices in the devicelist.
No errors in the logging anymore.
  • Husqvarna - Actions
  • Husqvarna - Run
  • Husqvarna - State
  • Husqvarna - Battery level
Are these the devices which should be visible?
They are updated so that all looks okay.

But....
I do not seem to get them visible in any tab. Not in the Switches and not in the Utilities overviews.
Very strange.
I did restart the pc and so Domoticz.

Any suggestions?

Frank
User avatar
waltervl
Posts: 5741
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: Python plugin: Husqvarna automower

Post by waltervl »

Aandegrens wrote: Friday 20 September 2024 9:51 But....
I do not seem to get them visible in any tab. Not in the Switches and not in the Utilities overviews.
Very strange.
I did restart the pc and so Domoticz.

Any suggestions?

Frank
Did you assign devices to users? Check menu Setup - Users if devices are assigned to the logged in user (normally an admin). For an admin this assigned devices list should be empty.

https://www.domoticz.com/wiki/User_Mana ... et_Devices
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
Aandegrens
Posts: 23
Joined: Saturday 08 April 2017 19:36
Target OS: Windows
Domoticz version: 2020.2
Location: Netherlands
Contact:

Re: Python plugin: Husqvarna automower

Post by Aandegrens »

Hi Waltervl,

I was still running the 2022.1 version.
I updated to the 2024.6 and a lot has changed between those 2 versions.
Great options have been added.

Thanks, they are visible now.

Frank
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest