Skip to content
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

Readings become unavailable all the time (and then come back). #109499

Closed
galmok opened this issue Feb 3, 2024 · 63 comments
Closed

Readings become unavailable all the time (and then come back). #109499

galmok opened this issue Feb 3, 2024 · 63 comments

Comments

@galmok
Copy link

galmok commented Feb 3, 2024

The problem

The logged readings are not continuous. This means the devices keep becoming unavailable and then come back.
Can we please have an option that prevents logging when the device is unavailable? That would save spare and be more useful.

What version of Home Assistant Core has the issue?

core-2024.1.6

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant Container

Integration causing the issue

Airthings BLE

Link to integration documentation on our website

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

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
Copy link

home-assistant bot commented Feb 3, 2024

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

Code owner commands

Code owners of airthings_ble 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 airthings_ble 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)


airthings_ble documentation
airthings_ble source
(message by IssueLinks)

@v1kke
Copy link

v1kke commented Feb 4, 2024

I have this same issue. From beginning of February or so the integration started to be very unreliable and the sensor values update only by soft booting or sometimes not even then, and sometimes recovering randomly for a moment.

Core
2024.1.6
Supervisor
2023.12.1
Operating System
11.4
Frontend
20240104.0

@v1kke
Copy link

v1kke commented Feb 4, 2024

Here is some sample data showing how the data is breaking. It was alright until end of Jan, but then it started this glitching.
image

@galmok
Copy link
Author

galmok commented Feb 4, 2024

Here is some sample data showing how the data is breaking. It was alright until end of Jan, but then it started this glitching. image

The intermittent logging to the right is what I see. I don't get the long pauses, though.

To me it seems that the integration logs failed readings, which don't really makes sense to me.

@v1kke
Copy link

v1kke commented Feb 4, 2024

Here is some sample data showing how the data is breaking. It was alright until end of Jan, but then it started this glitching. image

The intermittent logging to the right is what I see. I don't get the long pauses, though.

To me it seems that the integration logs failed readings, which don't really makes sense to me.

Correct, the long pauses are not really relevant in this scope. The long pauses are caused by my attempts to reboot and solve the issue, but I had hard time to get the integration to provide any data for a while. Anyway the relevant samples are the beginning where the integration operated normally and the later part which is clearly very fragmented.

@estofira
Copy link

estofira commented Feb 5, 2024

After updating to 2024.1.6 i'v got the same behaviour.
Arting is randomly (not)available.

@nrm94ee330
Copy link

same for me as well. keep going unavailable way too many times.. I have three airthings wave plus.. and each of them goes of randomly unavailable...

@sdaltons1
Copy link

Same issue here. I was really starting to worry about my setup haha.

@cturra
Copy link

cturra commented Feb 7, 2024

i have been observing the same, running:

  • core: 2024.1.6
  • supervisor: 2024.01.1
  • operating system: 11.5

here you can see how frequent my drops are over the past 24 hours...

Screenshot 2024-02-07 at 11 48 33

i reviewed the home-assistant.log, but nothing jumps out to me here. no exceptions are logged that i can see.

@Legrand5382
Copy link

Same for me here, keep dropping and sometime it come back for 30min or so then drop again, reboot will bring it back for a short time.

@AntoninSlovacek
Copy link

AntoninSlovacek commented Feb 8, 2024

The same issue here. But noticed it some time ago already. Now running latest versions.
By any chance, can this be somehow effected by other integrations? Matter? Zigbee?
OR: update on AirThings side?

@estofira
Copy link

estofira commented Feb 8, 2024

Everything is possible, but probably all of us started to have these problems after installing 2024.1.6, which had and airthing-ble update in it...

@nrm94ee330
Copy link

nrm94ee330 commented Feb 8, 2024 via email

@jac2424
Copy link

jac2424 commented Feb 9, 2024

Have been having same issue for couple of weeks now as well. Entities go unavailable and back multiple times a day.

@def1149
Copy link

def1149 commented Feb 10, 2024

Now all my Wave+ data entries have gone unavailable. I hadn't done anything.
The Aithing Wave+ is a nice device but the BT integration has been problematic for months ... complete garbage

@SuppleCowChunks
Copy link

This has been getting worse. After the first issue in 2024.1.6 I downgraded back to 2024.1.4 and it was all good. When a new core update shows up I give it a try and if it still doesn't work I go back to 2024.1.4. However, now 2024.1.4 no longer works. The device goes to unavailable and occasionally the integration has issues initializing and will fail.

Core - 2024.1.4
Supervisor - 2024.01.1
Operating System - 11.5
Frontend - 20240104.0

@mwaterbu
Copy link

About every 15 minutes, my Wave+ disconnects for ~5 minutes. This is highly annoying, and breaks some automations that use the unavailable state (ex. to detect a dead battery).

@roblamoreaux
Copy link

It seems to me that the Airthings device updates less frequently than the timeout that makes the entity be marked as unknown. It would be nice if this timeout could be set longer for the Airthings Integration.

@Matss0n
Copy link

Matss0n commented Feb 14, 2024

image

Same thing happened for me with 2024.1.6 update.
No need to reload but sensor becomes "unavailable" frequently

@cturra
Copy link

cturra commented Feb 14, 2024

following up that i am seeing the same unavailable behaviour described in my last comment after upgrading core to 2024.2.1 from 2024.1.6.

@staleand
Copy link

Have this exact issue as well.

@AntoninSlovacek
Copy link

I updated everything I could. Not only restarted HA, but power cycled my HA device. Took fresh batteries for the Airthings Wave+, placed it just next to each other. And it works just fine now!

@peregrines2
Copy link

I tried the same. Brand new batteries & power cycling ... problem still persists with dropouts multiple times per hour :(

@jac2424
Copy link

jac2424 commented Feb 21, 2024

I updated everything I could. Not only restarted HA, but power cycled my HA device. Took fresh batteries for the Airthings Wave+, placed it just next to each other. And it works just fine now!

I did the same but still have issues. The frequency of the drops seem to have reduced a bit with recent home assistant release but still happens.

@AntoninSlovacek
Copy link

Update on SW on the AirThings Wave side? Distance reduction? Just thinking out loud....

@jac2424
Copy link

jac2424 commented Feb 21, 2024

Update on SW on the AirThings Wave side? Distance reduction? Just thinking out loud....

No changes other than newer version of home assistant, not sure if any auto firmware updates happened in the background on the Airthings.

@LaStrada
Copy link
Member

Update on SW on the AirThings Wave side? Distance reduction? Just thinking out loud....

No changes other than newer version of home assistant, not sure if any auto firmware updates happened in the background on the Airthings.

For BLE connected devices you will see a message in the Airthings app you need to click on. No messages in the app = newest version.

@def1149
Copy link

def1149 commented Feb 21, 2024

What? New version of what?

@jac2424
Copy link

jac2424 commented Feb 21, 2024

What? New version of what?

https://www.home-assistant.io/blog/2024/02/07/release-20242/

@jac2424
Copy link

jac2424 commented Feb 27, 2024

Received an Home Assistant OS and Core update yesterday and the issue seems to have gotten slightly worse again (similar to frequency of drops from few weeks ago where integration showed in unavailable hourly). Up till yesterday’s update, the frequency of unavailability had dropped off to only few times a day.

@estofira
Copy link

estofira commented Mar 2, 2024

For now it is cca permanently unavailable, and only after reboot working for a few minutes

@AllenBurgett
Copy link

After experiencing frequent disconnects with my Wave+ for a couple of weeks, I disabled the Bluetooth interface in Home Assistant and switched to a Bluetooth proxy on an ESP32. It has been rock solid since then.

@rsiv, mind walking through what you did for this exactly? I'm using Bluetooth Proxy, but my connectivity is still horrid (9/13 of my devices are randomly unavailable). I haven't done anything to disable my Bluetooth interface and I'm starting question whether my Bluetooth Proxy is actually doing anything.

Would be great to hear exactly what you did 🙂

@Legrand5382
Copy link

I also now use esp32 proxy and the connection stay connect much longer but still disconnect and reconnect every 1-2 hours.

@rsiv
Copy link
Contributor

rsiv commented Mar 10, 2024

@AllenBurgett I configured an esp32 with:

bluetooth_proxy:
  active: true

Then I disabled the bluetooth adapter in Settings > Integrations > Bluetooth > Integration Entries > Disable.
I have a Wave+ and about 10 Govee thermometers, all very stable with a single esp32 proxy. I have an automation that notifies me if my Wave+ becomes unavailable/unknown and I had just one disconnect in the past two weeks that resolved on its own.

Depending on your house size and layout, you might need more than one proxy to cover all the devices.
Try bringing all the devices near the proxy for a couple of days and see if they stay connected.

@AllenBurgett
Copy link

@AllenBurgett I configured an esp32 with:

bluetooth_proxy:
  active: true

Then I disabled the bluetooth adapter in Settings > Integrations > Bluetooth > Integration Entries > Disable. I have a Wave+ and about 10 Govee thermometers, all very stable with a single esp32 proxy. I have an automation that notifies me if my Wave+ becomes unavailable/unknown and I had just one disconnect in the past two weeks that resolved on its own.

Depending on your house size and layout, you might need more than one proxy to cover all the devices. Try bringing all the devices near the proxy for a couple of days and see if they stay connected.

Seems like my Bluetooth integration was the only thing actually reading any of my devices. When I disabled it, I lost all updates from my Airthings. I've started going around the house and power cycling all of my bluetooth proxies. I'm now getting readings across the board! So, apparently my proxies were just borked.

Thanks for giving me a troubleshooting path!

@LaStrada
Copy link
Member

LaStrada commented Mar 10, 2024

A bit off topic, but you can add a restart button to your ESPHome nodes:
https://esphome.io/components/button/restart.html

@roblamoreaux
Copy link

I noticed the other day that there are a lot of USB Bluetooth adapters that are marked as frequently dropping connection in the Home Assistant integration documentation(https://www.home-assistant.io/integrations/bluetooth/). None of mine were on the list of fast connecting ones so I ordered a $7 one to see if that helps. In the mean time I replaced that location with an esp32 bluetooth proxy which so far is much better.

@jac2424
Copy link

jac2424 commented Mar 11, 2024

I noticed the other day that there are a lot of USB Bluetooth adapters that are marked as frequently dropping connection in the Home Assistant integration documentation(https://www.home-assistant.io/integrations/bluetooth/). None of mine were on the list of fast connecting ones so I ordered a $7 one to see if that helps. In the mean time I replaced that location with an esp32 bluetooth proxy which so far is much better.

I have couple of other Bluetooth sensors being monitored by home assistant including one outside passed a brick wall and one floor down which have no connectivity issues which leads me to believe it’s a Airthings integration issue rather than Bluetooth stack or hardware issue.

@AllenBurgett
Copy link

AllenBurgett commented Mar 11, 2024

I noticed the other day that there are a lot of USB Bluetooth adapters that are marked as frequently dropping connection in the Home Assistant integration documentation(https://www.home-assistant.io/integrations/bluetooth/). None of mine were on the list of fast connecting ones so I ordered a $7 one to see if that helps. In the mean time I replaced that location with an esp32 bluetooth proxy which so far is much better.

I have couple of other Bluetooth sensors being monitored by home assistant including one outside passed a brick wall and one floor down which have no connectivity issues which leads me to believe it’s a Airthings integration issue rather than Bluetooth stack or hardware issue.

Mine was definitely mostly an issue with my proxies. However, I'm still seeing some go unavailable, but they're mostly being cleaned up by my reloader automation. So, I would agree that there still seems to be something wrong with the Airthings integration.

Screenshot_20240311-121536

The first part of the graph is before restarting my proxies, the 100% is when I shut down the Bluetooth integration. It's been mostly zero since I restarted the proxies.

@def1149
Copy link

def1149 commented Mar 12, 2024

Any estimate on when a new integration will drop?

@zacs
Copy link

zacs commented Mar 14, 2024

After experiencing frequent disconnects with my Wave+ for a couple of weeks, I disabled the Bluetooth interface in Home Assistant and switched to a Bluetooth proxy on an ESP32. It has been rock solid since then.

Thanks for this. I've had GL-S10 bluetooth proxies for a while now, and for some reason I thought the Bluetooth integration itself needed to also be enabled. All my Airthings have been a disaster since 2024.2. But just disabling the Bluetooth integration (using an internal radio on a micro PC that sits in a metal rack....) got them all back on immediately. Thank you!

@jac2424
Copy link

jac2424 commented Mar 15, 2024

Issue still happening with latest Home assistant 2024.3 release that contained update for Airthings integration.

@JesusSanchezLopez
Copy link

JesusSanchezLopez commented Mar 16, 2024

I have same issue. The issue starts appearing with upgrade to Home Assistant Core 2024.1.6 or newer and issue still exists with HA Core 2024.3.1. Last working version is HA Core 2024.1.5.

Issue can be reliably recreated by upgrading to anything newer than 2024.1.5 and issue is resolved when downgrading to 2024.1.5 or older.

This is not an Airthings firmware, distance or battery issue. Only solution is to stay on HA Core 2024.1.5 for now

@LaStrada: looks like #108612 broke Airthings-ble integration for a bunch of us.
Looks like airthings-ble integration was bumped up in HA Core 2024.1.6: #108612

@HomeAssistantPim
Copy link

HomeAssistantPim commented Mar 24, 2024

I just upgraded from 2024.1.5 to:
Core 2024.3.3
Supervisor 2024.03.0
Operating System 12.1
Frontend 20240307.0

Didn't read any release notes (#QA #clean-code #test-driven #living-on-the-edge #life-is-to-short)
And yes my Airthings is losing the device multiple times a day and the connection restore can take hours.
Other changes I noted from 2024.1.5:

  • Also got some warnings about the lightness sensor having a different unit of measurement (I don't think my wave plus has such a sensor, thus I disabled it)
  • Change in battery level (54% -> 80%), I suspect this is the result of a bug fix as my battery level dropped instantely when I moved several weeks ago from the anythings cloud integration to the anythings ble integration.

I also have Xiaomi integration active for my bluetooth plant sensors, they did not suffer from these updates.

Many thnx on the tip to reload the integration when the device is dropped, that at least helps a bit.
It was triggered already 5 minutes after I dis/enabled a sensor to give communications a little kick.
Hopefully a real fix will come soon?

The workaround:
`
alias: Airthings Bug Workaround
trigger:

  • platform: template
    value_template: "{{ states('sensor.airthings_wave_136828_batterij') == 'unavailable' }}"
    action:
  • service: homeassistant.reload_config_entry
    target:
    device_id: 3e03dbe33d551de3bdc8cd2e21fc9204
    mode: single
    `

@sdaltons1
Copy link

Could someone who is connecting this with an ESPHome Bluetooth proxy share their ESPHome config?

I disabled my HA Bluetooth integration and have one of these running and it isn't picking up my AirThings at all. I assume I have something configured incorrectly.

@jac2424
Copy link

jac2424 commented Mar 24, 2024

Could someone who is connecting this with an ESPHome Bluetooth proxy share their ESPHome config?

I disabled my HA Bluetooth integration and have one of these running and it isn't picking up my AirThings at all. I assume I have something configured incorrectly.

I just tried this myself and didn't really do anything special, I flashed the ESP32 device using Bluetooth Proxy option from below site. Once flashing was complete and device was added to home assistant I just placed it close to middle of all my devices and then disabled the Bluetooth dongle in my home assistant. No other config changes were done and my Bluetooth sensors and Airthings Wave+ are all showing up fine. So far with the proxy AirThings is lot more stable and haven't seen any unavailable messages yet but its only been a couple of days. I still think issue is with AirThings integration perhaps not gracefully handling connection issues or weak signals at its set pooling intervals and resulting in unavailable message rather then just retrying it or waiting for several failed tries before marking entities as unavailable.

https://esphome.io/projects/?type=bluetooth

@sdaltons1
Copy link

sdaltons1 commented Mar 26, 2024

Could someone who is connecting this with an ESPHome Bluetooth proxy share their ESPHome config?
I disabled my HA Bluetooth integration and have one of these running and it isn't picking up my AirThings at all. I assume I have something configured incorrectly.

I just tried this myself and didn't really do anything special, I flashed the ESP32 device using Bluetooth Proxy option from below site. Once flashing was complete and device was added to home assistant I just placed it close to middle of all my devices and then disabled the Bluetooth dongle in my home assistant. No other config changes were done and my Bluetooth sensors and Airthings Wave+ are all showing up fine. So far with the proxy AirThings is lot more stable and haven't seen any unavailable messages yet but its only been a couple of days. I still think issue is with AirThings integration perhaps not gracefully handling connection issues or weak signals at its set pooling intervals and resulting in unavailable message rather then just retrying it or waiting for several failed tries before marking entities as unavailable.

https://esphome.io/projects/?type=bluetooth

Thanks for this. Helped me to understand I wasn't doing anything wrong and had followed the right steps. Turned out I needed to clean build files and reinstall.

Past 24 hours of near perfect connection now.

@HomeAssistantPim
Copy link

HomeAssistantPim commented Mar 26, 2024

Improved version as reloading the config apparently may not always result in the device becoming available...

description: ""
trigger:
  - platform: state
    entity_id:
      - sensor.airthings_wave_136828_batterij
    to: unavailable
condition: []
action:
  - repeat:
      sequence:
        - service: homeassistant.reload_config_entry
          metadata: {}
          data: {}
          target:
            device_id: 3e03dbe33d551de3bdc8cd2e21fc9204
        - delay: "00:01:00"
      while:
        - condition: state
          entity_id: sensor.airthings_wave_136828_batterij
          state: unavailable
mode: single

@AllenBurgett
Copy link

I have a similar concept, but I try to lower the amount of reload requests sent over a short period of time:

alias: Reload Airthings Devices Periodically
description: Reloads devices periodically every 5 minutes if conditions are met.
trigger:
  - platform: time_pattern
    minutes: /5
condition: []
action:
  - if:
      - condition: state
        state: unavailable
        entity_id: sensor.allens_office_airthings_temperature
    then:
      - service: homeassistant.reload_config_entry
        data: {}
        target:
          device_id: adc3f0aed148269948faa7fb829a16fc
  - if:
      - condition: state
        state: unavailable
        entity_id: sensor.basement_bedroom_airthings_temperature
    then:
      - service: homeassistant.reload_config_entry
        data: {}
        target:
          device_id: d71e8e2f99d3457c1e13f376387c3de7
  - if:
      - condition: state
        state: unavailable
        entity_id: sensor.basement_unfinished_side_airthings_temperature
    then:
      - service: homeassistant.reload_config_entry
        data: {}
        target:
          device_id: 7e043b859169e3b365b1642390cc08cc

I've been kicking around setting a limit on how many times it tries to reload, before it just notifies me that something's wrong (ex. Like the battery is dead and it's never going to reload).

@jaydeethree
Copy link

Copy/pasting my comment from #113610 since there are more people following this issue:

I've done some testing and I believe the problems were caused by this PR (which unfortunately contains a ton of changes, so it's hard to say which specific change is the bad one).

For now I've worked around this by rolling back to the version of the airthings_ble integration that was in use prior to that PR. There's a little bit of info about how to do this in the Home Assistant docs, but here's a slightly more detailed version of the process:

  • Go to the last working version of the airthings_ble integration, open each file, and download the raw file.
  • Create a custom_components/airthings_ble/ directory and add all of those files to it.
  • Edit the manifest.json file to add this line (the specific version number doesn't matter, but you have to specify some version number for this to work):
    • "version": "0.0.1",
    • It should look something like this: airthings
  • Restart Home Assistant.
  • Check your Devices & Services page to confirm that the Airthings integration now shows the "Custom integration" icon (the yellow icon in the lower-right corner): airthings2

This seems to have fixed the instability problems that I've been having.

@bobloadmire
Copy link

This has been ongoing for months, is there anything us regular people can do to help development for a fix?

@estofira
Copy link

@LaStrada , any idea when this would be fixed ?
Its 2.5 months now

@williameriksson
Copy link

Copy/pasting my comment from #113610 since there are more people following this issue:

I've done some testing and I believe the problems were caused by this PR (which unfortunately contains a ton of changes, so it's hard to say which specific change is the bad one).

For now I've worked around this by rolling back to the version of the airthings_ble integration that was in use prior to that PR. There's a little bit of info about how to do this in the Home Assistant docs, but here's a slightly more detailed version of the process:

  • Go to the last working version of the airthings_ble integration, open each file, and download the raw file.

  • Create a custom_components/airthings_ble/ directory and add all of those files to it.

  • Edit the manifest.json file to add this line (the specific version number doesn't matter, but you have to specify some version number for this to work):

    • "version": "0.0.1",
    • It should look something like this: airthings
  • Restart Home Assistant.

  • Check your Devices & Services page to confirm that the Airthings integration now shows the "Custom integration" icon (the yellow icon in the lower-right corner): airthings2

This seems to have fixed the instability problems that I've been having.

Thanks for this work around, it's working great now

@mwaterbu
Copy link

I've done some testing and I believe the problems were caused by this PR (which unfortunately contains a ton of changes, so it's hard to say which specific change is the bad one).

b244fa0 seems potentially related.

@SuppleCowChunks
Copy link

Copy/pasting my comment from #113610 since there are more people following this issue:

I've done some testing and I believe the problems were caused by this PR (which unfortunately contains a ton of changes, so it's hard to say which specific change is the bad one).

For now I've worked around this by rolling back to the version of the airthings_ble integration that was in use prior to that PR. There's a little bit of info about how to do this in the Home Assistant docs, but here's a slightly more detailed version of the process:

  • Go to the last working version of the airthings_ble integration, open each file, and download the raw file.

  • Create a custom_components/airthings_ble/ directory and add all of those files to it.

  • Edit the manifest.json file to add this line (the specific version number doesn't matter, but you have to specify some version number for this to work):

    • "version": "0.0.1",
    • It should look something like this: airthings
  • Restart Home Assistant.

  • Check your Devices & Services page to confirm that the Airthings integration now shows the "Custom integration" icon (the yellow icon in the lower-right corner): airthings2

This seems to have fixed the instability problems that I've been having.

Thank you for this. My integration has been running solid for the past few hours now. Haven't seen that since January.

@bdraco
Copy link
Member

bdraco commented May 1, 2024

duplicate of #113610

That one has more information, so please continue there instead.

@bdraco bdraco closed this as not planned Won't fix, can't repro, duplicate, stale May 1, 2024
@github-actions github-actions bot locked and limited conversation to collaborators May 31, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests