Coder Social home page Coder Social logo

austinbrunkhorst / snooz Goto Github PK

View Code? Open in Web Editor NEW
15.0 15.0 6.0 293 KB

Home Assistant component to control SNOOZ white noise machine

License: MIT License

Python 100.00%
automation bluetooth bluetooth-le bluetooth-low-energy home-assistant homeassistant raspberry-pi

snooz's Issues

Error setting up entry Snooz A516 for snooz

So I actually just picked up a long range Bluetooth adapter for my Home Assistant Core installation this weekend, and got this custom integration working (for the most part, and ignoring connectivity issues that I assume are mostly related to the Snooz and/or other bluetooth issues).

However, I did just install Home Assistant 2022.9 (was running 2022.8.7 when I originally installed the Snooz integration and had it working) and am now unable to start this integration. I tried deleting the device and integration to start from scratch, but I still get the following error showing up in Home Assistant's logs after re-configuring my Snooz w/this integration. It seems to pair normally, but then the integration just errors out after that:

Error setting up entry Snooz A516 for snooz Traceback (most recent call last): File "/srv/homeassistant/lib/python3.10/site-packages/homeassistant/config_entries.py", line 357, in async_setup result = await component.async_setup_entry(hass, self) File "/home/homeassistant/.homeassistant/custom_components/snooz/__init__.py", line 36, in async_setup_entry coordinator = PassiveBluetoothProcessorCoordinator( TypeError: PassiveBluetoothProcessorCoordinator.__init__() missing 1 required positional argument: 'update_method'

Either way, thank you so much for working on this integration @AustinBrunkhorst! Can't wait to see it become an official part of Hass =)

AttributeError: 'SnoozFan' object has no attribute '_address'

Thanks for this, I'd love to be able to tie our snooz into our morning HA routine! However, after installing and restarting HA, I ran into this error:

2021-04-22 08:06:44 ERROR (MainThread) [homeassistant.components.fan] Error while setting up snooz platform for fan
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 205, in _async_setup_platform
await asyncio.shield(task)
File "/config/custom_components/snooz/fan.py", line 47, in async_setup_platform
async_add_entities([SnoozFan(hass, name, address, device)])
File "/config/custom_components/snooz/fan.py", line 54, in __init__
self.id = "".join(self._address.split(":")[-2:])
AttributeError: 'SnoozFan' object has no attribute '_address'

Other installation notes:

  • Added https://github.com/AustinBrunkhorst/snooz as a custom repository in HACS and was able to install that way. The result looks to be the same, all the contents of the snooz folder in config/custom_components/snooz
  • This is on a Raspberry Pi 4 running Raspbian Buster and Home Assistant Supervised, version 2021.4.6
  • I have been able to use other Bluetooth-based custom components and I currently have https://github.com/custom-components/sensor.airthings_wave installed - maybe there is a BT conflict?
  • The snooz has been paired to my phone and I've tested with the app closed. I haven't yet tested resetting the snooz.

Added config snippet:

- platform: snooz
  address: D0:CF:5E:33:07:C8

Does this Integration still work? (reliably)

Hey,

I stumbled on this and I am really excited to try it out. I have 3 of these gems, and have always hated the native app.

I am struggling to get it working properly and was wondering how to troubleshoot? I was able to get mine working for a few minutes and then it stopped responding and has not responded since. I tried adding my son's... that doesn't work either.

I was not able to see anything in the logs

No valid version key in manifest file - as of HA 2021.6, integration is not loaded at startup

I'm sure this is an easy fix - the manifest now needs a version key or else HA (as of 2021.6) won't load the integration. Here's the error at startup:
2021-06-08 09:19:08 ERROR (SyncWorker_0) [homeassistant.loader] The custom integration 'snooz' does not have a valid version key (None) in the manifest file and was blocked from loading. See https://developers.home-assistant.io/blog/2021/01/29/custom-integration-changes#versions for more details

Here's the relevant section in the developer docs:
https://developers.home-assistant.io/blog/2021/01/29/custom-integration-changes/#versions

And here's screenshot of a valid manifest file which includes the version key, from the wyzesense custom component:
image

Error in HA log and on component install with HA 2021.5.0

(Note: I first noticed this prior to upgrading to 2021.5.0)
I've left this component installed even though I know the distance between my snooz and HA box is currently too far, and I've noticed a HA error in the startup logs:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config.py", line 853, in async_process_component_config
    platform = p_integration.get_platform(domain)
  File "/usr/src/homeassistant/homeassistant/loader.py", line 493, in get_platform
    cache[full_name] = self._import_platform(platform_name)
  File "/usr/src/homeassistant/homeassistant/loader.py", line 498, in _import_platform
    return importlib.import_module(f"{self.pkg_path}.{platform_name}")
  File "/usr/local/lib/python3.8/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 973, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'custom_components.snooz.fan'

While I initially thought this was due to the snooz being out of range, I upgraded to 2021.5.0 today, and while I was able to upgrade, I could not restart HA until I removed the fan section from my configuration. The built-in configuration checker notes the error and the server restart will not trigger until the fan section of the config is removed.
image

2021-05-05 14:05:17 ERROR (MainThread) [homeassistant.components.hassio] Platform error fan.snooz - No module named 'custom_components.snooz.fan'

There are some relevant release notes regarding the restart prevention: https://www.home-assistant.io/blog/2021/05/05/release-20215/#why-home-assistant-didnt-restart-when-i-pressed-the-restart-button

Once the fan section of the config is removed, HA restarts normally. However, even on a reinstall of this component, HA gives the above errors even when using the suggested yaml from the README.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.