elupus / gardena-bluetooth Goto Github PK
View Code? Open in Web Editor NEWGardena Bluetooth Python Module
License: MIT License
Gardena Bluetooth Python Module
License: MIT License
Hi, thanks for the integration!
I tried to set it up using home assistant (core) and immediately get to a note that says "No devices found on the network". So I tried to connect using this module directly.
Using python3 -m gardena_bluetooth scan
I find a device with a Husqvarna service.
I then tried to connect using python3 -m gardena_bluetooth connect
, this leads to the asyncio.exceptions.CancelledError
exception.
Is there something else I could try? I tried factory resetting a few times. Connecting using the official Gardena Bluetooth app works and I also did a firmware update to Firmware 1.7.23.29 today.
Connecting to: xx:xx:xx:xx:xx:xx
Traceback (most recent call last):
File "/srv/homeassistant/lib/python3.11/site-packages/bleak/backends/bluezdbus/client.py", line 204, in connect
reply = await self._bus.call(
^^^^^^^^^^^^^^^^^^^^^
File "/srv/homeassistant/lib/python3.11/site-packages/dbus_fast/aio/message_bus.py", line 370, in call
await future
asyncio.exceptions.CancelledError
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "<frozen runpy>", line 198, in _run_module_as_main
File "<frozen runpy>", line 88, in _run_code
File "/srv/homeassistant/lib/python3.11/site-packages/gardena_bluetooth/__main__.py", line 71, in <module>
main()
File "/srv/homeassistant/lib/python3.11/site-packages/asyncclick/core.py", line 1157, in __call__
return anyio.run(self._main, main, args, kwargs, **opts)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/srv/homeassistant/lib/python3.11/site-packages/anyio/_core/_eventloop.py", line 70, in run
return asynclib.run(func, *args, **backend_options)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/srv/homeassistant/lib/python3.11/site-packages/anyio/_backends/_asyncio.py", line 292, in run
return native_run(wrapper(), debug=debug)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/asyncio/runners.py", line 190, in run
return runner.run(main)
^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/asyncio/runners.py", line 118, in run
return self._loop.run_until_complete(task)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/asyncio/base_events.py", line 653, in run_until_complete
return future.result()
^^^^^^^^^^^^^^^
File "/srv/homeassistant/lib/python3.11/site-packages/anyio/_backends/_asyncio.py", line 287, in wrapper
return await func(*args)
^^^^^^^^^^^^^^^^^
File "/srv/homeassistant/lib/python3.11/site-packages/asyncclick/core.py", line 1160, in _main
return await main(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/srv/homeassistant/lib/python3.11/site-packages/asyncclick/core.py", line 1076, in main
rv = await self.invoke(ctx)
^^^^^^^^^^^^^^^^^^^^^^
File "/srv/homeassistant/lib/python3.11/site-packages/asyncclick/core.py", line 1687, in invoke
return await _process_result(await sub_ctx.command.invoke(sub_ctx))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/srv/homeassistant/lib/python3.11/site-packages/asyncclick/core.py", line 1434, in invoke
return await ctx.invoke(self.callback, **ctx.params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/srv/homeassistant/lib/python3.11/site-packages/asyncclick/core.py", line 780, in invoke
rv = await rv
^^^^^^^^
File "/srv/homeassistant/lib/python3.11/site-packages/gardena_bluetooth/__main__.py", line 44, in connect
async with BleakClient(address, timeout=20) as client:
File "/srv/homeassistant/lib/python3.11/site-packages/bleak/__init__.py", line 491, in __aenter__
await self.connect()
File "/srv/homeassistant/lib/python3.11/site-packages/bleak/__init__.py", line 531, in connect
return await self._backend.connect(**kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/srv/homeassistant/lib/python3.11/site-packages/bleak/backends/bluezdbus/client.py", line 141, in connect
async with async_timeout(timeout):
File "/usr/lib/python3.11/asyncio/timeouts.py", line 111, in __aexit__
raise TimeoutError from exc_val
TimeoutError
Edit:
Sorry about the missing info โ it's a Gardena Water Control Bluetooth and I'm trying to connect directly from a raspberry pi 4 running ubuntu.
I have a few bluetooth sensors integrated already with home assistant which work kinda well which made me wonder. Thanks for the quick answer, I'll try out a few more connections. But it should not be necessary to connect first using the python script, correct? It "should" work directly from home assistant? Thanks!
Thanks for your effort with this upcoming integration. I am shopping for a robot lawn mower (I know this is only for water control right now).
Gardena smart system is a bit confusing. Will this integration work with the water control unit that can be setup and controlled via Bluetooth only, or is the smart system hub also needed?
From Gardena: "Unfortunately, here in NZ & AU, the smart technology in the Robotic Lawnmowers runs off the same digital radio signals used by Police force and Military."
I am hoping that I could help you to add lawn mower control to this integration at a later date. I have not yet purchased a lawn mower, HA integration is part of my wish list for a device.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.