Update config for version 0.7.0
This commit is contained in:
parent
744230d5d3
commit
f663cf4990
3 changed files with 15 additions and 5 deletions
|
|
@ -199,7 +199,9 @@ class PlejBLEHandler extends EventEmitter {
|
||||||
plejd.device = this.deviceRegistry.getDeviceBySerialNumber(fixedPlejdPath);
|
plejd.device = this.deviceRegistry.getDeviceBySerialNumber(fixedPlejdPath);
|
||||||
|
|
||||||
if (plejd.device) {
|
if (plejd.device) {
|
||||||
logger.debug(`Discovered ${plejd.path} with rssi ${plejd.rssi}, name ${plejd.device.name}`);
|
logger.debug(
|
||||||
|
`Discovered ${plejd.path} with rssi ${plejd.rssi} dBm, name ${plejd.device.name}`,
|
||||||
|
);
|
||||||
this.bleDevices.push(plejd);
|
this.bleDevices.push(plejd);
|
||||||
} else {
|
} else {
|
||||||
logger.warn(`Device registry does not contain device with serial ${fixedPlejdPath}`);
|
logger.warn(`Device registry does not contain device with serial ${fixedPlejdPath}`);
|
||||||
|
|
@ -359,9 +361,9 @@ class PlejBLEHandler extends EventEmitter {
|
||||||
}
|
}
|
||||||
|
|
||||||
async _powerOffAdapter() {
|
async _powerOffAdapter() {
|
||||||
logger.verbose('Powering off BLE adapter and waiting 5 seconds');
|
logger.verbose('Powering off BLE adapter and waiting 30 seconds');
|
||||||
await this.adapterProperties.Set(BLUEZ_ADAPTER_ID, 'Powered', new dbus.Variant('b', 0));
|
await this.adapterProperties.Set(BLUEZ_ADAPTER_ID, 'Powered', new dbus.Variant('b', 0));
|
||||||
await delay(5000);
|
await delay(30000);
|
||||||
}
|
}
|
||||||
|
|
||||||
async _cleanExistingConnections(managedObjects) {
|
async _cleanExistingConnections(managedObjects) {
|
||||||
|
|
@ -501,9 +503,15 @@ class PlejBLEHandler extends EventEmitter {
|
||||||
this.cleanup();
|
this.cleanup();
|
||||||
|
|
||||||
this.consecutiveReconnectAttempts++;
|
this.consecutiveReconnectAttempts++;
|
||||||
|
|
||||||
|
if (this.consecutiveReconnectAttempts % 100 === 0) {
|
||||||
|
logger.error('Failed reconnecting 100 times. Creating a new dbus instance...');
|
||||||
|
this.bus = dbus.systemBus();
|
||||||
|
}
|
||||||
|
|
||||||
if (this.consecutiveReconnectAttempts % 10 === 0) {
|
if (this.consecutiveReconnectAttempts % 10 === 0) {
|
||||||
logger.warn(
|
logger.warn(
|
||||||
`Tried reconnecting ${this.consecutiveReconnectAttempts} times. Try power cycling the BLE adapter every 10th time...`,
|
`Tried reconnecting ${this.consecutiveReconnectAttempts} times. Will power cycle the BLE adapter now...`,
|
||||||
);
|
);
|
||||||
await this._powerCycleAdapter();
|
await this._powerCycleAdapter();
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
|
|
@ -147,6 +147,8 @@ If you're having issues to get the addon working, there are a few things you can
|
||||||
- Start `bluetoothctl` interactive command
|
- Start `bluetoothctl` interactive command
|
||||||
- Write `list` and make sure it finds the Bluetooth device. If no device is found you need to fix this first!
|
- Write `list` and make sure it finds the Bluetooth device. If no device is found you need to fix this first!
|
||||||
- Look in Plejd addon log and make sure there is no `unable to find a bluetooth adapter` line
|
- Look in Plejd addon log and make sure there is no `unable to find a bluetooth adapter` line
|
||||||
|
- Make sure signal strength is "good enough". The BLE adapter needs to be reasonably close to a Plejd device. Look at the RSSI reading in the debug logs. In some cases an RSSI of -80 dBm works well, in other cases a higher value such as -40 dBm is required to work.
|
||||||
|
- You should get verbose/debug logs similar to: `Found Plejd service on ...` => `Discovered ... with RSSI ...` => `Inspecting ...` => `Connecting ...` => `Connected` => `Connected device is a Plejd device ...` => `BLE Connected to ...` => `Bluetooth connected. Plejd BLE up and running!`. After this sequence (which could fail multiple times before finally succeeding) you should get quite frequent `Raw event received ...` from the Plejd mesh. When updating state you should see in the logs `Sending 8 byte(s) of data to Plejd ...`.
|
||||||
- Listen to `#` in the MQTT integration and watch Plejd mqtt messages come in
|
- Listen to `#` in the MQTT integration and watch Plejd mqtt messages come in
|
||||||
- Initial device discovery messages originate from the Plejd API, so if you set up that correctly you should get new devices in HA
|
- Initial device discovery messages originate from the Plejd API, so if you set up that correctly you should get new devices in HA
|
||||||
- Plejd log will show something like `discovered light (DIM-01) named ....`
|
- Plejd log will show something like `discovered light (DIM-01) named ....`
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "Plejd",
|
"name": "Plejd",
|
||||||
"version": "0.6.2",
|
"version": "0.7.0",
|
||||||
"slug": "plejd",
|
"slug": "plejd",
|
||||||
"description": "Adds support for the Swedish home automation devices from Plejd.",
|
"description": "Adds support for the Swedish home automation devices from Plejd.",
|
||||||
"url": "https://github.com/icanos/hassio-plejd/",
|
"url": "https://github.com/icanos/hassio-plejd/",
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue