Closed mist0706 closed 4 years ago
It's possible that the bluetooth hardware (and/or software) gets into sad states after alot of fiddling (especially with the raw hci tools), can you try a reboot and see if it behaves better?
Unfortunately the same result after a reboot, however the bluetooth adapter seems to always respond to hcitool scan now which is an improvement
2020-05-06 06:14:51 INFO (MainThread) [homeassistant.components.light] Setting up light.plejd
2020-05-06 06:14:51 DEBUG (MainThread) [custom_components.plejd.light] Discovered bluetooth adapter /org/bluez/hci0
2020-05-06 06:14:53 WARNING (MainThread) [custom_components.plejd.light] No plejd devices found
2020-05-06 06:14:53 WARNING (MainThread) [homeassistant.components.light] Platform plejd not ready yet. Retrying in 180 seconds.
Do you get anything in syslog or dmesg about bluetooth when this happens? What version of bluez are you running with? What hardware is this with?
bluez is already the newest version (5.37-0ubuntu5.3). (This is from the host OS which i assume you're interested in?)
The hardware is a intel nuc 54250wyk
Nothing in particular in either the syslog nor dmesg.
5.37 is quite old, I'm running 5.48 (from ubuntu 18.04) (yes, host is what matters).
It should be possible to run bluetoothd with debugging enabled (--debug), I don't know if that could possible shed some light on what's happening.
I'm running ubuntu 16 lts, i'll upgrade to 18 since it has to be done anyway. Then i'll update the package to see if that fixes it, if not i'll get some debug logs from bluetoothd.
After an upgrade to ubuntu 18 it started working!
2020-05-07 14:40:42 DEBUG (MainThread) [custom_components.plejd.light] Plejd network reports time as '2020-05-07 15:40:42'
2020-05-07 14:40:42 DEBUG (MainThread) [custom_components.plejd.light] No match for device '27' (b'270110009800ffff00')
2020-05-07 14:40:43 DEBUG (MainThread) [custom_components.plejd.light] No match for device '19' (b'190110009801131300')
2020-05-07 14:40:44 DEBUG (MainThread) [custom_components.plejd.light] No match for device '28' (b'280110009800ffff00')
2020-05-07 14:40:58 DEBUG (MainThread) [custom_components.plejd.light] No match for device '17' (b'170110009800000000')
2020-05-07 14:41:12 DEBUG (MainThread) [custom_components.plejd.light] Plejd network reports time as '2020-05-07 15:41:18'
2020-05-07 14:41:44 DEBUG (MainThread) [custom_components.plejd.light] Plejd network reports time as '2020-05-07 15:41:51'
2020-05-07 14:42:03 DEBUG (MainThread) [custom_components.plejd.light] Plejd network reports time as '2020-05-07 15:42:10'
2020-05-07 14:42:16 DEBUG (MainThread) [custom_components.plejd.light] No match for device '2d' (b'2d0110009801000000')
2020-05-07 14:42:23 DEBUG (MainThread) [custom_components.plejd.light] Plejd network reports time as '2020-05-07 15:42:30'
2020-05-07 14:42:32 DEBUG (MainThread) [custom_components.plejd.light] Plejd network reports time as '2020-05-07 15:42:38'
2020-05-07 14:43:38 DEBUG (MainThread) [custom_components.plejd.light] Plejd network reports time as '2020-05-07 15:43:44'
Before we close this. Is there a simple way of translating which number is which device name? Otherwise i'll write a python script to try and figure that out and generate a yaml for homeassistant
So i hacked something together but it doesn't take into consideration cron dimmers properly. If anyone has a clue you can ping me. This can be marked as closed.
#!/usr/bin/env python3
import json
_json = json.loads(open('site.json').read())
adresses = {}
output = _json['PlejdMesh']['outputAdresses']
output.pop('$type')
for device_id in output:
adresses[output[device_id].get('0')] = device_id
adresses[output[device_id].get('1')] = device_id
final_data = {}
device_info = _json['DeviceInfos']['$values']
for device in device_info:
for device_id in adresses:
if device['DeviceID'] == adresses[device_id]:
print("%s:\n name: %s" % (device_id, device['Title']))
root@mango:/home/mist# ./devicenames.py
11:
name: Spotar tak
13:
name: Spotar tak hall
15:
name: Spot tak wc/d
17:
....
Awesome, glad to hear that it works.
So after the dbus up and working i still am not able to find any devices
There are no apparent error messages but "No plejd devices found".
Running hcitool lescan works SOMETIMES. For some reason the interface seems to not work, i don't understand why: