-
Notifications
You must be signed in to change notification settings - Fork 16
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
Does not work on hass.io #1
Comments
One thing to investigate here is if bluepy would work better on hass.io, I had initial issues with getting notifications to work on bluepy and went with pygatt instead. There seems to be a couple of components using bluepy and some of them clain to work on hass.io. Edit: and with that said it wasn't that tricky to get notifications working with bluepy. Maybe it would be good to move over to bluepy, I might make a test on a branch with that if I find time and interest. |
I just pushed some early bluepy code on a branch: https://github.com/klali/ha-plejd/tree/bluepy This might work better with hass.io, at the least it seems to be a more popular ble library in home assistant. Though it does seem to come with it's own bugs and not being properly maintained. |
Tricky to debug without running it, guess I might have to get hass.io running to be able to get the component running. Make sure you have bluepy installed and have given it's helper the permissions to run the btle scanning. |
Can I really install bluepy separatly? Doesnt that have to be included in the component? |
Much appreciated is you get this up and running on hass.io. Most people are running this setup I think |
I agree would be great to have it working with hass.io witout to much hassle. Thanks for the work your putting in. |
As stated in #4 I had a typo in the example, the config has to be for "devices" not "device". For better compatibility with hass.io the integration should probably follow https://developers.home-assistant.io/docs/en/creating_integration_manifest.html If doing the setcap part is to much and additional config is better I guess it's possible to optionally allow adding the adresses of connectable plejd devices to the config and skip the scanning step. |
I got this working on Hass.io (after changing device to devices), seems to be some issues with Bluepy still, I've got other BT issues, but now I got all my Plejdd lights in HA and they are updated directly when I change them in Plejd app, so all good here. |
Did you do anything besides copying the files (and adding config in yaml)? Did you install anything else manually? |
I tried to install bluepy once extra, but that installation ended with an error so I can't say if that made a difference or not. I did also create a manifest.json for this component, but I'm not sure that did anything either. I can do a PR for the manifest.json later if needed. |
Another update, I've now looked through all my lights (+30) and it seems that I also get the not used outputs from Plejd (got a few DIM-02 that is currently only using one output) and I also have a few DIM-01 that are duplicates (got two numbers for each device) and those turn on and off but doesn't update state in HA. I will take a look at getting the outputAddress instead of input that I'm currently using. Hopefully that fixes the update part. But I'm still a little puzzled by the duplicates. |
Your manifest file would be great! |
Same here! |
A manifest might look like:
with bluepy replaced with pygatt depending on branch. Though this wont install correctly since the imports in light.py is in top level rather than function level. If the requirements are already installed correctly it will work though (and should without the manifest as well). |
Could you perhaps guide me on how to install the prereqs on hass.io? |
Finally got it working! To install bluepy i added this repository to the add-on store: https://github.com/home-assistant/hassio-addons-development I then installed the "Custom deps deployment" add-on with the following config And my manifest.json looks like this: |
Curious if you got any error messages installing bluepy? I did it the old fashion way with "pip3 install bluepy" and the installation ended with an error. |
this should make it possible to pull in bluepy automatically relates #1
No errors as far as I can recall |
I get this error when trying to set it up. 2019-07-28 13:43:07 ERROR (MainThread) [homeassistant.setup] Setup failed for devices: Integration not found. This is my configuration.yaml light:
device_tracker:
Is this bluetooth device_tracker part neccesary? When i run the bluepy code in Custom deps deployment i get this in the log. [Info] Remove old deps My foldersetup is for the plejd files is /config/custom_components/plejd Im running a pi 3B |
Got the same messages as you. Did you add the manifest file? |
Yes i added the manifest in the same folder as light.py and init.py |
I've been having issues on and off with this, first I got it working, then I did some changes and it didn't work any more. Today I decided to set up a pi3 just with a clean Hass.io to see if I got it working and it works "out of the box". Add the three files (init, light and manifest) in custom components and add the config to config.yaml. Restart and it works. Did the same on my nuc, installed a fresh installation and the files and config and it works. So the steps to add some extra isn't needed, probably due to the manifest.json or if bluepy actually is installed in Hass.io. It doesn't work perfect for me, having a lot of issues to get the correct states back to HA, but all lights turn on and off and dims as they should. I'm guessing that with older installations that have gone through several upgrades there may be some leftovers or other things that prevent this from working properly. So I would say that this issue should be closed. It does work on a vanilla installation on Hass.io both on pi3 and nuc. |
I also got it up and running now:-)= I did a clean installation of Hass.io. But I also had to do the step with "custom dep deployment" as described previously befor i got it to work. |
I've merged the bluepy branch, that comes with a manifest and the correct way of including dependencies and in a virtualenv installation the pulls in dependencies correctly. When running on hass.io, did you have to do the setcap tricks to get it the correct permissions? |
Got it running in hassio on a Thnikerboard S, I didn´t use the setcap tricks |
No, no setcap on NUC either. |
If possible, it would be awesome with a hass.io port on this.
The text was updated successfully, but these errors were encountered: