home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
71.82k stars 30.08k forks source link

Aranet4 v1.4.16 recognized as "version lower than v1.2.0" #116467

Closed Nikkulin3 closed 4 months ago

Nikkulin3 commented 5 months ago

The problem

Trying to add my new aranet4 do home assistant is not working. It claims an old version for aranet4 but the aranet app tells me otherwise

Aranet4 Version: v1.4.16 (as in aranet app) aranet app aranet integration response

What version of Home Assistant Core has the issue?

2024.4.4

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant OS

Integration causing the issue

Aranet

Link to integration documentation on our website

https://www.home-assistant.io/integrations/aranet

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

home-assistant[bot] commented 5 months ago

Hey there @aschmitz, @thecode, @anrijs, mind taking a look at this issue as it has been labeled with an integration (aranet) you are listed as a code owner for? Thanks!

Code owner commands Code owners of `aranet` can trigger bot actions by commenting: - `@home-assistant close` Closes the issue. - `@home-assistant rename Awesome new title` Renames the issue. - `@home-assistant reopen` Reopen the issue. - `@home-assistant unassign aranet` Removes the current integration label and assignees on the issue, add the integration domain after the command. - `@home-assistant add-label needs-more-information` Add a label (needs-more-information, problem in dependency, problem in custom component) to the issue. - `@home-assistant remove-label needs-more-information` Remove a label (needs-more-information, problem in dependency, problem in custom component) on the issue.

(message by CodeOwnersMention)


aranet documentation aranet source (message by IssueLinks)

thecode commented 5 months ago

I think you have the same issue as https://github.com/home-assistant/core/issues/115602 but you identified the root cause. @Anrijs FYI

Anrijs commented 5 months ago

I am not able to reproduce this at the moment, but i have got some ideas. What hardware are You using? How are bluetooth advertisements received?

thecode commented 5 months ago

@Nikkulin3 (and others that want to provide a log with the advertisements sent by your devices)

Please add the following to configuration.yaml, restart home assistant, try to add a device or wait for a update from an existing device and attach the log.

logger:
  default: info
  logs:
    homeassistant.components.bluetooth: debug

Note: it is better to drag the log into the comment (which will add it as an attachment) and not copy paste as it is hard to read logs in GitHub.

Thanks

Nikkulin3 commented 5 months ago

Thanks for the quick reply!

Hardware: Raspberry Pi 4-64 4GB using the on-board bluetooth. fyi: I'm connecting some Govee BLE devices with bluetooth for temp/humidity and reading data from them successfully. The Aranets Bluetooth MAC-Address is E2:5C:41:DD:43:DA. (see log / image) image

For the log, I cleared everything from boot, then tried adding the device again. The log is the cat .. | grep homeassistant.components.bluetooth-version. I think that's what you asked... ha-bluetooth.log

@Anrijs I don't know what you mean with "How are bluetooth advertisements received?" but I hope the log clears that up for you.

thecode commented 5 months ago

Thanks @Nikkulin3.

@Anrijs from his log:

2024-04-30 21:26:17.387 DEBUG (MainThread) [homeassistant.components.bluetooth] Rediscovered adapters: {'hci0': {'address': 'DC:A6:32:5B:71:C6', 'sw_version': 'homeassistant', 'hw_version': 'usb:v1D6Bp0246d0548', 'passive_scan': True, 'manufacturer': 'Raspberry Pi Trading Ltd', 'product': None, 'vendor_id': None, 'product_id': None}}

Advertisements received by standard PI Bluetooth adapter (using passive scan, no device name)

The log contains all advertisements from his device, I believe they can be injected offline to understand the problem.

Anrijs commented 5 months ago

I might have found the issue, but someone will need to check if fix works. Try upgrading aranet4 to aranet4==2.3.4b1

Nikkulin3 commented 5 months ago

Not sure how to access pip from within the home assistant os. On my PC, the current version aranet4==2.3.3 connects with the aranet device, which is unexpected and makes things hard to debug for me.

Anrijs commented 5 months ago

See https://github.com/home-assistant/core/issues/115602#issuecomment-2068011995 But instead of aranet4==2.2.2, use aranet4==2.3.4b1

Nikkulin3 commented 4 months ago

I am unable to find the file /usr/src/homeassistant/homeassistant/components/aranet/manifest.json on my HA-OS file system nor any folder named aranet or aranet4 while searching /. Neither with ssh addon or portainer addon+console ingress. A more elaborate explanation of what shell into home assistant container means exactly (which container? how?) would probably help. I am probably looking in the wrong places.

Anrijs commented 4 months ago

You can shell into container by running docker exec -t -i homeassistant /bin/bash

Nikkulin3 commented 4 months ago

Thanks. I was first looking for pip/docker access in the SSH connection (where no docker or pip exists) and in the portainer addon. Solution: the container "homeassistant" is explicitly hidden in portainer settings. Anyways...

Previously installed version was 2.3.3, I can confirm the command aranetctl --scan does work in the container.

Then I installed via pip install aranet4==2.3.4b1. The manual scan worked (--scan) but not the integration/adding of a device. Once I did a reboot, I was able to install the device without a problem. This is great and all, but what confuses me is the following: After the reboot, in the docker container, the pip show aranet4 command shows the old 2.3.3 version and not the new one. Is this expected behavior?

Any other tests I can do?

thecode commented 4 months ago

Then I installed via pip install aranet4==2.3.4b1.

Don't use pip install, edit the manifest as explained https://github.com/home-assistant/core/issues/115602#issuecomment-2068011995 via sed or manual edit the file, after restart the container (core) to install the updated dependency.

pip show aranet4 command shows the old 2.3.3 version and not the new one. Is this expected behavior?

This is because HA will reinstall the dependency according to the manifest.

thecode commented 4 months ago

Fixed by https://github.com/home-assistant/core/pull/117738