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

Freezes when airthings too far away #19

Open
poohbah opened this issue Aug 22, 2022 · 2 comments
Open

Freezes when airthings too far away #19

poohbah opened this issue Aug 22, 2022 · 2 comments

Comments

@poohbah
Copy link

poohbah commented Aug 22, 2022

I have two 1st gen airthings wave units (Model 2900). When both are close to the HASSIO system with BLE radio, the addon works fine. When one is in the basement where it normally lives (in a problematic reception area that sometimes works and sometimes doesn't), the addon freezes with no log info that I can see. It will work on a restart until it can't connect. It doesn't seem to timeout and move on, it just freezes. I would not mind at all if it got no data then moved on. I can account for failures by scheduling it often enough.

Here are the last few lines of the current log (it's about 16:15 now, so it froze about 7 hours ago). On this restart, it successfully interviewed the problem unit twice before freezing up. I can replicate this very consistently.

[2022-08-22 09:08:07] INFO: Done sending messages to mqtt broker.
[2022-08-22 09:08:07] INFO: Waiting 600 seconds.
[2022-08-22 09:18:08] DEBUG: Getting sensor data...
[2022-08-22 09:18:08] DEBUG: Getting sensor data for 98:07:2d:4a:2a:01
[2022-08-22 09:18:08] DEBUG: Connecting to 98:07:2d:4a:2a:01

Home Assistant 2022.8.6
Supervisor 2022.08.3
Operating System 8.4
Running in a VM on top of xcp-ng

@mjmccans
Copy link
Owner

Thank you for the bug report, and it definitely should not be working that way and should instead timeout and move on like you suggested. I will take a look to see if I can find the error. However, the best news that I may have for you is that someone is working on bringing support for Airthings devices to Home Assistant Core using the new bluetooth support. In my mind this is a better option than using my add-on, and if done will render this add-on obsolete. If you are interested you can go here to see the discussion.

@spaceman83
Copy link

I've cobbled together an automation workaround in the meanwhile

alias: AirthingsAddonBroke
description: Restart Airthings Addon after 30m of unchanged CO2 values
#Check every 5 minutes
trigger:
  - platform: time_pattern
    minutes: /5
condition:
  - condition: template
    value_template: >-
      {{ now().timestamp() -
      states.sensor.airthings_<sensor>_co2.last_updated.timestamp() > 1800 }}
action:
  - service: hassio.addon_restart
    data:
      addon: <random>_airthings
  - service: notify.persistent_notification
    data:
      message: Airthings Addon restarted due to stale data
      title: Airthings Addon restarted
#Delay further triggering, allowing addon to gather new data before restarting again
  - delay:
      hours: 0
      minutes: 10
      seconds: 0
      milliseconds: 0
mode: single

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants