-
-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Thank you! #1
Comments
Thanks for sharing that! From a quick look at https://gitlab.com/nbrgmn/wall-e-esp8266-automower/-/blob/develop/Robomower_V0.8.pdf?ref_type=heads it does look like it might be helpful in decoding the requests/responses. Which is the main thing left to do here to support more features/commands |
I'm glad it can be useful. |
That's the plan! I've started to put together a HA component for the mower. I'm now waiting on a longer Ethernet cable to arrive so I can setup a ESPHome Bluetooth proxy near the mower |
PR submitted for initial support upstream: home-assistant/core#108326 |
Thank you!! While waiting for the PR to be accepted, do you think I can try it out? How can I import it? |
You can test it. If you apply this diff (custom components require a version) diff --git a/homeassistant/components/husqvarna_automower_ble/manifest.json b/homeassistant/components/husqvarna_automower_ble/manifest.json
index cb3ee2a502..bd7db5f1f1 100644
--- a/homeassistant/components/husqvarna_automower_ble/manifest.json
+++ b/homeassistant/components/husqvarna_automower_ble/manifest.json
@@ -12,5 +12,6 @@
"dependencies": ["bluetooth_adapters"],
"documentation": "https://www.home-assistant.io/integrations/???",
"iot_class": "local_polling",
- "requirements": ["automower-ble==0.1.14"]
+ "requirements": ["automower-ble==0.1.14"],
+ "version": "0.1.0"
} Then just rsync the entire You will also want to enable debug logging by adding this to your
Then just reboot. Let me know how it goes, I have only tested it on a 305 |
Ok, i installed the integration and I can get up to the configuration wizard. There I can see a blank textbox with no hints. I tried inserting the Bluetooth address but it gives me an unknown error. In the log I get this:
|
You need to insert the Bluetooth address in the box. I think I still need to provide strings which is why it's empty. Did you enable logging in the config? There should be more details then that |
Yes, I imagined that could have been the problem, but it's a minor thing.
Yes, I enabled it. I tried it again and found that missed an error:
Now I'm wandering: is the Bluetooth proxy via esphome supposed to work already? I took it for granted and tried it with the mower near an esp I already have in the garden (the server is in the basement...). |
I have had a range of issues with the ESPHome BLE proxy and BLE devices in the past. So this is what I have for the node in the backyard
Then the device page in HA has a It's the same thing I have to do for the official HA Gardena integration as well. I see the device connect in the ESPHome logs. You can check there to see if a connection is being made. Obviously make sure the mower is in range :) |
I'm now using your config, with the correct Bluetooth address
Now it takes a bit longer, but still results in an error:
|
You need to get a connection here. You should get something in the log saying it connected. I suspect the issue is that the mower isn't in pairing mode. I have updated the documentation here: home-assistant/home-assistant.io#30921 Basically make sure the mower is in pairing mode before doing this. For the 305 I need to power cycle the mower and trigger a connection in the first 3 minutes after startup. Also, try moving the node closer. The timeout while connecting is weird and coming directly from the HA Bluetooth stack. You should be able to connect to the mower even without my integration. Thanks for testing! You have helped me update the documentation already :) |
Hi! Sorry for the delay. I think I'm getting closer, but I'm still having issues connecting. This is the log from the ESPHome Node:
-------> Here I try to connect with the integration config flow submit button
This is the log from HomeAssistant: 1:
2:
I'm not sure how the 305 connects, but my 315 has a connection menu where I can start the pairing, but I found that your 3 mins method seems to work better for this: when the mower has been turned on for a long time, even if I go to the pairing menu, the esphome node can't find the mower. Instead, during the mower startup, it is discoverable (I see the same behaviour using nRF connect app on my android phone). With the husqvarna app, instead, the mower can be connected only when in pairing mode (from its menu), and I can connect to it using the 4 digits pin. Do you have any idea? I hope this information will be somewhat useful for the project |
This is coming from the ESP device. I don't think there is much I can do here. How far away are the two devices? You can try moving them closer together to see if that works.
This one is a good error! That
The 305 has the same setting. For me that menu option does nothing. The official app can not pair with the mower using that menu option. The only thing that works for me is the full reboot and then connect in the first 3 minutes. Even the official app with an Android phone held next to the mower took a few tries. So it might take a few goes. Try pulling the latest changes. I have been working to try and improve the connection reliability as I test more with my mower. Then just keep rebooting the mower and reload the integration until the husqvarna_automower_ble logs prints the Characteristics without any |
They are at less than a meter away from each other, I think this is not the problem
I tried, since I saw some commits, but I'm not sure how to do so. I downloaded the folder from your homeassistant/core fork, but I'm not sure it's the latest (commit name is still initial commit)
I will try, but I did so already a few times without success... |
I downloaded latest commit. Now I can finally finish the config flow and the integration entity is created... I see that now, as soon as the esp node connects to the mower, the bt logo appears on the mower display and doesn't disappear. Now the home assistant log reports:
I also tried to move the security level on the mower from medium to low, but it doesn't help. |
This means it is connected but not paired. You need to make sure the mower is in pair mode then reload the integration. I think you are missing some logs. You can SSH to the HA instance and run this? It will provide more logs and in an easier format cat ./config/home-assistant.log | grep mow |
Good question. I have decoded sending the PIN, the Python library supports providing it. But I have never needed to actually use it. You might need to the PIN to change some advanced settings (which we don't support). Currently everything works for me without using the PIN. My mower is set to low security. If we find out we need the PIN I can look at adding support for that |
|
Great! That is really helpful. The mower is connected and paired. The You can communicate with the mower as well, so it's mostly working. The issue is the mower model lookup in the Python code. It's using the wrong values. It worked for the 305 by coincidence. I have pushed a fix, if you update to the latest from my PR it should work for you |
I'm happy to help as much as I can!
I can finally confirm the integration setup works! Tomorrow I'll try to test it (it's 1am here, but I still wanted to try to connect). BTW, Just out of curiosity: do you think that it would be feasible to add some kind of ble beacon functionality to track the mower position in the garden in the future? |
Awesome! I'm glad it's working. This has helped narrow down a few bugs, so hopefully it helps this get merged I don't think it would be feasible to track the mower position via BLE. Looking at some existing features in HA like iBeacon we could probably detect a rough distance. But that isn't super useful. It would probably be easier to attach a GNSS device to the mower and use that instead |
About this: why don't you create a custom component with HACS requirements in the meanwhile? It's quite straightforward and it would help for having more testers I think.
You're right
It would be nice to find some way to keep an esp and/or the gnss powered/charged on board of the mower itself, I need to look inside and see if I find some 3v or 5v pins |
I really don't want to be maintaining an out of tree component. I have a few currently installed and I'm trying to get rid of them. I would like to get this upstream so that it can benefit the most number of users and be included in the HA infrastructure. I must admit I didn't realise that it would take so long just to get a response though. There are power pins somewhere :P The question is how easy are they to get to and then can you setup something in a secure and waterproof way. A little solar/battery node might be easier. Although I now have the mower house setup, so that probably won't work too well for me |
Have you had a chance to test this a bit more? |
Unfortunately not, I'm having some issues with the loop wire that is broken in multiple points (I hope the station is ok... Last spring I had to replace the board on the station since it fried during the winter). Now I have very little time, but I'll try to repair it ASAP. Then, I'll test it as much as I can. |
Aw no! I'm sorry to hear that No rush, I was just checking in |
Unfortunately the board was actually fried. After the setup with the new loop signal, the mower loses all its connections, and now I can't get it to connect to HA again... Tomorrow I could send you the logs again, if it's something useful. I also updated the integration to your latest commit. |
Urgh! That's a pain. If you send the logs I can investigate. Sometimes it does take a few tries to get a connection though |
I managed to connect to the mower. |
Great! Looking at your log I never see the mower send a "Mowing" activity. So the mower might not be connected when that happens. The connection is pretty unreliable. That seems to be an issue with Home Assistant. I have the same issue with other BLE devices. I'm not sure there is much I can do in the integration to improve that unfortunately. I have tried testing a few different approaches, and they don't seem to help too a lot. I can see you starting the mower in the logs. It looks like it works, but there is a strange exception in the Python code. I'll add more debug logs, so if it happens again hopefully we can see what's going on. |
Hi! Sorry for the late reply, but I really didn't have any chance to look at the mower integration. Did you have the time to update the project to get more debug instead? |
No worries. I have been slowly tweaking and updating things. The BLE connection is now as reliable as my other BLE connections. I'm still trying to improve it though |
I pulled latest commit, but I still have problems connecting to the mower. I attach latest logs. |
Do you mind opening the log, finding the line
and including the lines around it. Something is failing in the decode and I can't see what |
Ah, I see in the log it is |
Do you still need the logs you asked before?
Is there anything I can do about it? |
You need to put the mower into pair mode and then try again |
Hello I understood I have to download files to my HA instance. |
Once you have installed the component you can just add it like any other integration. You will need to specify the BLE address of the mower when setting up the integration |
Then just rsync the entire homeassistant/components/husqvarna_automower_ble directory from the PR to /root/homeassistant/custom_components/ on your HA instance |
I'm not able to rsync from github just that folder ... stuck with permissions. |
It's just like 6 files, you can create them manually and copy/paste them. I find this way faster than the other options |
Hello Alessandro, And this is the content of my homeassistant/custom_components/husqvarna_automower_ble folder The thing is, I cannot find the new integration: You said:
Where did you started the integration wizard? |
What does Did you add the version field to the manifest? |
Hello @alistair23
No, sorry, this is the first time I try to add a not-yet-release integration and I didn't know.
documentation says:
So, as you suggested here i added
so these are last lines of manifest.json now:
Now I can find the integration!!! Many thanks! Let's go! |
Hello, in home-assistant.log I found:
Is there any helpful log I could provide to investigate? I'm using a ZEXMTE 5.3 BT antenna, not an ESP, to connect to 305. |
Hi guys,
The fact is I don't have such a dir, because I have just python 3.9 (default version for Debian 11): I assumed an upgrade to Python 3.12 is required, so I installed Py 3.12 alongside 3.9.
Last 3 lines are the attempts I've done after Py upgrade. Since in previous messages there was this reference
I tried to see the content of such a dir: there is not a "automower_ble" folder yet. What should I try now? Thanks |
Can you open the log, find The grep for |
Hello @alistair23 Then I have installed PY3.12 and log has changed.
Anyhow I have
In my opinion they seem to be different. This is the full 2024-03-25_home-assistant.log.txt from the re-start. Many thanks |
The full log provides a lot more information
Which seems strange, that might be worth fixing. Your HA instance does see the mower, as I see these lines
But the connection fails with
Then you just get these messages
You might want to force a scan or discovery from the Bluetooth adapter before reloading the integration. |
This issue is getting a bit out of hand. I'm going to close this issue. If you are still having problems just open an separate issue. That way things are a little easier to track and manage |
I do agree: i will fix PyBluez first of all. |
Thanks for your work. I'm not sure if this can help, since it's more about the uart communication rather than the Bluetooth one, but I founded some resources some time ago, and they might be handy.
https://community.home-assistant.io/t/esphome-for-husqvarna-gardena/481903/1
The text was updated successfully, but these errors were encountered: