Gardena mower control (domoticz-mqtt2-gardena)

Client tools or tools that can connect with Domoticz. Tools for Windows, iOS, Android, Linux etc.

Moderator: leecollings

espenf
Posts: 9
Joined: Tuesday 01 September 2015 21:21
Target OS: -
Domoticz version:
Contact:

Re: Gardena mower control (domoticz-mqtt2-gardena)

Post by espenf »

Hi,

I've tried dakarli's fork, but when trying to run gardena.py, it throws this:
Spoiler: show
Traceback (most recent call last):
File "gardena.py", line 29, in <module>
CLIENT_ID=configParser.get('Gardena', 'CLIENT_ID')
File "/usr/lib/python3.7/configparser.py", line 780, in get
d = self._unify_values(section, vars)
File "/usr/lib/python3.7/configparser.py", line 1146, in _unify_values
raise NoSectionError(section) from None
configparser.NoSectionError: No section: 'Gardena'
Any ideas?
thomasbaetge
Posts: 153
Joined: Wednesday 02 October 2019 11:47
Target OS: Linux
Domoticz version: 2023.1
Location: DE / BY / LT
Contact:

Re: Gardena mower control (domoticz-mqtt2-gardena)

Post by thomasbaetge »

Error in your config file.
Typo or wrong path?
espenf
Posts: 9
Joined: Tuesday 01 September 2015 21:21
Target OS: -
Domoticz version:
Contact:

Re: Gardena mower control (domoticz-mqtt2-gardena)

Post by espenf »

Thanks Thomas for pushing me a step further. I might have solved my issues now, but will include my actions for the next person in need:

In Gardena.py, the config file was referred to with a relative path to the parent folder. That caused problems. Corrected that to a static path with great success.

The next error that occured was this message: configparser.NoOptionError: No option 'api_key' in section: 'Gardena'
-Got that solved by adding that option to the cfg-file, with the same value as client_id.
I dont know if these two last errors is caused by a bug in the code or my behaviour, but "if it works it aint stupid"

Next error: AttributeError: module 'websocket' has no attribute 'enableTrace'
I've installed the websocket package, but you'll need the websocket client: pip install websocket-client

That seems to have fixed the connection to the API.

The last error i experienced was domoticz not updating devices from the MQTT-stream. Easily solved:
make sure the topic in your config-file is set to TOPIC=domoticz/in and not TOPIC=domoticz\in :!:
thomasbaetge
Posts: 153
Joined: Wednesday 02 October 2019 11:47
Target OS: Linux
Domoticz version: 2023.1
Location: DE / BY / LT
Contact:

Re: Gardena mower control (domoticz-mqtt2-gardena)

Post by thomasbaetge »

Glad you sorted that out :)

I just had a brief look at the code of this fork. I am curious if this runs stable over a period.
The websocket connection will be terminated from the server side every 120 minutes. From what I see, the ws thread then will simply be terminated, while the rest of the service (3 threads) will continue running (without connection).
Thus the service will be intact, but you won't get any more updates from your mower.
But like I said, I just had a brief look... I may be wrong;)
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests