Page 2 of 2

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

Posted: Wednesday 28 June 2023 22:47
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?

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

Posted: Tuesday 04 July 2023 9:57
by thomasbaetge
Error in your config file.
Typo or wrong path?

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

Posted: Wednesday 05 July 2023 15:13
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 :!:

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

Posted: Wednesday 05 July 2023 16:36
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;)