Closed spripe closed 4 years ago
Could you try updating to the 0.1.1 version? I think you can ignore the HTTP-error, it seems everyone has that. What hardware are you using? RPi 4?
How do I update to the 0.1.1 Version? Do I need to do a manually git clone with some tag for that?
When I install via HassIO store I got 0.1.0. Then I've just tried manually git clone the dev branch, but the problem persists in the logs.
[cont-init.d] 00-banner.sh: exited 0. [cont-init.d] 01-log-level.sh: executing... [cont-init.d] 01-log-level.sh: exited 0. [cont-init.d] done. [services.d] starting services [services.d] done. [10:34:54] INFO: Starting the Plejd service... [10:34:54] INFO: Verified permissions on startup script [10:34:54] INFO: Executing startup script [10:34:54] INFO: Wrote plejd.json [10:34:54] INFO: Running add-on noble warning: adapter does not support Bluetooth Low Energy (BLE, Bluetooth Smart). Try to run with environment variable: [sudo] NOBLE_HCI_DEVICE_ID=x node ... plejd-mqtt: connected to mqtt. discovered light: Hall with Plejd ID 19. discovered light: Spotligt tak with Plejd ID 18. discovered light: Taklampa Soffa with Plejd ID 11.
The hardware is an ordinary laptop with Bluetooth LE adapter
If you go to the add-on store in the Hass.io menu and click the refresh button in the upper right corner the update should be visible in the plejd add-on.
We're using different BLE libraries, so I'm guessing your device id isn't recognized by noble. Could you give me your VID/PID and I'll add that to the list of recognizable devices.
And, can you check if your laptop has a builtin bluetooth adapter as well? In that case, you might need to specify the NOBLE_HCI_DEVICE_ID environment variable to point to the correct BL adapter.
Bus 001 Device 003: ID 0a12:0001 Cambridge Silicon Radio, Ltd Bluetooth Dongle (HCI mode) idVendor 0x0a12 Cambridge Silicon Radio, Ltd idProduct 0x0001 Bluetooth Dongle (HCI mode)
The laptop have builtin bluetooth adapter, but no Bluetooth LE. That's why I bouht this USB Bluetooth LE dongle and tried with ha-plejd component from klali - which worked. For that to work - I didn't need to set the NOBLE_HCI_DEVICE_ID variable.
Should we try first to specify above VID/PID as recognized?
I've also clicked the refresh button in the upper corner
But it still show version 0.1.0
The noble library doesn't work the same way as bluepy which requires you to specify which device to use, default is that the one listed first is that, that is used. If that device doesn't support LE we're out of luck. That's where the NOBLE_HCI_DEVICE_ID comes into play, you need to specify which Bluetooth adapter to use.
Use hcitool (if on Linux) and list your Bluetooth devices, note if your USB device is hci0 or 1. Set the NOBLE_HCI_DEVICE_ID to 0 or 1 depending on which hci interface it is assigned. Please try again after that :-)
Will test that as soon I'm back from holiday. Do you have any syntax example to set NOBLE_HCI_DEVICE_ID to 1?
You can try using export NOBLE_HCI_DEVICE_ID=1
:)
root@ubuntu:~# hcitool dev Devices: hci1 CC:AF:78:F0:8A:8B < Vendor: Hon Hai Precision Ind. Co.,Ltd. hci0 00:1A:7D:DA:71:04 < Vendor: cyber-blue(HK)Ltd
Even with NOBLE_HCI_DEVICE_ID set; root@ubuntu:~# export NOBLE_HCI_DEVICE_ID=1 root@ubuntu:~# echo $NOBLE_HCI_DEVICE_ID 1
After setting above variable, I've also tried push rebuild and restart. I've alsor tried with/without protection mode off, just in case
1) What does "parse error: Expected string key before ':' at line 1, column 4" mean? 2) What does "ERROR: Unknown HTTP error occured" mean?
Github editor changed the font-size, Think its easier to read if you just copy above text to notepad :)
Did you made the change to approve this vendor or wasn't it necessary? idVendor 0x0a12 Cambridge Silicon Radio, Ltd idProduct 0x0001 Bluetooth Dongle (HCI mode)
Adapter specific known issues
Some BLE adapters cannot connect to a peripheral while they are scanning (examples below). You will get the following messages when trying to connect : Sena UD-100 (Cambridge Silicon Radio, Ltd Bluetooth Dongle (HCI mode)) : Error: Command disallowed Intel Dual Band Wireless-AC 7260 (Intel Corporation Wireless 7260 (rev 73)) : Error: Connection Rejected due to Limited Resources (0xd) You need to stop scanning before trying to connect in order to solve this issue. https://github.com/noble/noble
I forgot to mention that i've also tried export NOBLE_HCI_DEVICE_ID=0 which seems to be the right adapter Without success
just bought a raspberry pi 4 to test this addon.
Have tried installation both manual (local addon) and via hassio. In both cases i get below error in my hassio log
20-01-14 09:19:07 INFO (MainThread) [hassio.store.git] Update add-on https://github.com/icanos/hassio-plejd.git repository 20-01-14 09:19:09 INFO (MainThread) [hassio.store] Load add-ons from store: 64 all - 1 new - 0 remove 20-01-14 09:19:17 INFO (MainThread) [hassio.addons] Create Home Assistant add-on data folder /data/addons/data/local_plejd 20-01-14 09:19:17 INFO (SyncWorker_8) [hassio.docker.addon] Start build local/armv7-addon-plejd:0.2.2 20-01-14 09:19:23 ERROR (SyncWorker_8) [hassio.docker.addon] Can't build local/armv7-addon-plejd:0.2.2: The command '/bin/bash -o pipefail -c apk add --no-cache --virtual .build-dependencies g++=8.3.0-r0 gcc=8.3.0-r0 libc-dev=0.7.1-r0 linux-headers=4.19.36-r0 make=4.2.1-r2 python=2.7.16-r1 bluez=5.50-r3 eudev-dev=3.2.8-r0 && apk add --no-cache git nodejs=10.16.3-r0 npm=10.16.3-r0 && npm config set unsafe-perm true' returned a non-zero code: 2
which resulting in that the installation exits.
Any clue?
The Raspberry pi 4 image I used is: Raspberry Pi 4 Model B 32bit (recommended) https://github.com/home-assistant/hassos/releases/download/3.8/hassos_rpi4-3.8.img.gz
I understand if your time is limited to work with this project
But do you have any idea whats the problem is in this case or my other "newely created" case(https://github.com/icanos/hassio-plejd/issues/32) with rpi4, feel free to update.
Otherwise I have to look for something else.
Look at my comment in that thread :) please try the new version
:) Works, I think.
[cont-init.d] 00-banner.sh: exited 0. [cont-init.d] 01-log-level.sh: executing... [cont-init.d] 01-log-level.sh: exited 0. [cont-init.d] done. [services.d] starting services [services.d] done. [17:59:57] INFO: Starting the Plejd service... [17:59:57] INFO: Verified permissions on startup script [17:59:57] INFO: Executing startup script [17:59:58] INFO: Wrote plejd.json [17:59:58] INFO: Running add-on starting Plejd add-on v. 0.2.3 plejd-api: login() logging into Hemma plejd-api: got session token response plejd-api: getCryptoKey() plejd-api: got sites response wireEvents() onInterfaceStateChanged(poweredOn) scan() plejd-mqtt: connected to mqtt. discovered light: Taklampa Hall with Plejd ID 19. discovered light: Spotligt tak with Plejd ID 18. discovered light: Taklampa Soffa with Plejd ID 11. discovered light: Vardagsrum Matsal with Plejd ID 20. scan completed, found 5 device(s). onDeviceScanComplete() trying to connect to the mesh network. connecting to e54a5b66fa80 with addr e5:4a:5b:66:fa:80 and rssi -33 onDeviceConnected() authenticate() startPing() plejd: connected via bluetooth.
I would say a very good sign :)
Perfect, I Think we can close this and the other issue I've created. When I will work further with this setup on my rpi4
The first BLE device is not supported by Noble (the BLE library used by this addon), please make a request in the noble repository for a fix if needed. Using RPi 4, the bug is fixed in 0.2.3.
Good luck :-)
I've just now tried this addon, prior I used ha-plejd component from klali which worked just fine. So now to the problem / questions I've got.
The hassio log says:
[s6-init] making user provided files available at /var/run/s6/etc...exited 0. [s6-init] ensuring user provided files have correct perms...exited 0. [fix-attrs.d] applying ownership & permissions fixes... [fix-attrs.d] done. [cont-init.d] executing container initialization scripts... [cont-init.d] 00-banner.sh: executing...
Hass.io Add-on: Plejd Adds support for the Swedish home automation devices from Plejd.
Add-on version: 0.1.0 You are running the latest version of this add-on. parse error: Expected string key before ':' at line 1, column 4 [09:09:59] ERROR: Unknown HTTP error occured System: (amd64 / qemux86-64) Home Assistant version: 0.103.3 Supervisor version: 193
Please, share the above information when looking for help or support in, e.g., GitHub, forums or the Discord chat.
[cont-init.d] 00-banner.sh: exited 0. [cont-init.d] 01-log-level.sh: executing... [cont-init.d] 01-log-level.sh: exited 0. [cont-init.d] done. [services.d] starting services [services.d] done. [09:09:59] INFO: Starting the Plejd service... [09:09:59] INFO: Verified permissions on startup script [09:09:59] INFO: Executing startup script [09:10:00] INFO: Wrote plejd.json [09:10:00] INFO: Running add-on noble warning: adapter does not support Bluetooth Low Energy (BLE, Bluetooth Smart). Try to run with environment variable: [sudo] NOBLE_HCI_DEVICE_ID=x node ... plejd-mqtt: connected to mqtt. discovered light: Hall with Plejd ID 19. discovered light: Spotligt tak with Plejd ID 18. discovered light: Taklampa Soffa with Plejd ID 11.
1) what does this error mean and how do I solve it? parse error: Expected string key before ':' at line 1, column 4 [09:09:59] ERROR: Unknown HTTP error occured
2) I got a message that my Bluetooth LOW Energy adapter is not supported "noble warning: adapter does not support Bluetooth Low Energy (BLE, Bluetooth Smart). Try to run with environment variable: [sudo] NOBLE_HCI_DEVICE_ID=x node ..." Even though it works just fine with the ha-plejd component, any idea?