fsaris / home-assistant-awox

AwoX mesh light integration for Home Assistant
MIT License
84 stars 23 forks source link

Entities unavailable after configuring Awox #56

Closed Xrlwyzz closed 2 years ago

Xrlwyzz commented 2 years ago

Hi, I am running Home Assistant on Debian, installed on an old notebook. This has bluetooth, so I wanted to give it a try to connect to my Awox lights. Bluetooth tracker was able to see my smartphone, so bluetooth in genereal seems to be working. I was able to install pybluez and the integration, and after entering my account information it found all devices displayed in the app. Since it could not connect to the devices after that I tried setting the logging to debug mode, also tried moving the devices close to each other during installation. Nothing worked.

In the Home Assistant log the devices are also shown as ble.tlmesh.light* which I hope should work? _2022-02-21 22:37:15 DEBUG (MainThread) [custom_components.awox.config_flow] Processing device - {'objectId': 'LniFKu2W32', 'uuid': '24591c9f-40cc-30c6-942b-8be0215b7594', 'macAddress': 'a4:c1:38:d1:d5:87', 'version': '2.6.37', 'friendlyName': 'EGLOBulb', 'owner': {'__type': 'Pointer', 'className': '_User', 'objectId': '2VTjg8zSNh'}, 'syncable': True, 'modelName': 'ESMLm-c9i', 'room': 'Badezimmer', 'address': '21895', 'typedRoom': {'_type': 'Pointer', 'className': 'Room', 'objectId': 'Dhxeyrw9B4'}, 'displayName': 'Bad Wand', 'hardwareVersion': '4.52', 'provider': 'BLELight', 'vendor': 'AwoxByEglo', 'type': '.ble.tlmesh.light.switch.white.dimming.temperature.color.', 'createdAt': '2021-09-30T11:19:37.958Z', 'updatedAt': '2021-09-30T11:19:37.958Z', 'ACL': {'2VTjg8zSNh': {'read': True, 'write': True}}}

Nevertheless, all devices remain in state "unavailable" and thus cannot be controlled at all.

The log also shows no connection, but apart from "device not found" and "no result received" I could not find an error there: _2022-02-21 22:38:26 INFO (SyncWorker_3) [custom_components.awox.bluetoothctl] found: {} 2022-02-21 22:38:26 DEBUG (MainThread) [custom_components.awox.scanner] Found devices: {} 2022-02-21 22:38:27 DEBUG (MainThread) [custom_components.awox.awox_mesh] Scan result: {} 2022-02-21 22:38:27 INFO (MainThread) [custom_components.awox.awox_mesh] [a4:c1:38:d1:d5:87][Bad Wand] Device NOT found during Bluetooth scan 2022-02-21 22:38:27 INFO (MainThread) [custom_components.awox.awox_mesh] [a4:c1:38:b0:22:3d][Dusche] Device NOT found during Bluetooth scan 2022-02-21 22:38:27 INFO (MainThread) [custom_components.awox.awox_mesh] [a4:c1:38:98:c7:50][Bad Decke] Device NOT found during Bluetooth scan 2022-02-21 22:38:27 INFO (MainThread) [custom_components.awox.awox_mesh] async_update: Request status 2022-02-21 22:38:27 INFO (MainThread) [custom_components.awox.awox_mesh] Queue command requestStatus {'dest': 65535, 'withResponse': True} 2022-02-21 22:38:27 DEBUG (AwoxMeshCommands-2VTjg8zS) [custom_components.awox.awox_mesh] process 0/0 - {'command': 'requestStatus', 'params': {'dest': 65535, 'withResponse': True}, 'callback': <function AwoxMesh._async_add_command_to_queue..command_executed at 0x7fa727fbf160>, 'allow_to_fail': False} 2022-02-21 22:38:27 INFO (MainThread) [custom_components.awox.awox_mesh] [a4:c1:38:d1:d5:87][Bad Wand] Trying to connect 2022-02-21 22:38:27 DEBUG (SyncWorker_10) [custom_components.awox.awoxmeshlight] _waitResp - waiting for ['stat', 'ntfy', 'ind'] 2022-02-21 22:38:27 DEBUG (SyncWorker_10) [custom_components.awox.awoxmeshlight] _waitResp - set timeout to 5 seconds 2022-02-21 22:38:27 DEBUG (SyncWorker_10) [custom_components.awox.awoxmeshlight] _waitResp - waiting for ['stat', 'ntfy', 'ind'] 2022-02-21 22:38:27 DEBUG (SyncWorker_10) [custom_components.awox.awoxmeshlight] _waitResp - set timeout to 5 seconds 2022-02-21 22:38:27 DEBUG (SyncWorker_10) [custom_components.awox.awoxmeshlight] _waitResp - resp [{'rsp': ['stat'], 'state': ['tryconn'], 'dst': ['a4:c1:38:d1:d5:87'], 'mtu': [0], 'sec': ['low']}] 2022-02-21 22:38:27 DEBUG (SyncWorker_10) [custom_components.awox.awoxmeshlight] _waitResp - waiting for ['stat', 'ntfy', 'ind'] 2022-02-21 22:38:27 DEBUG (SyncWorker_10) [custom_components.awox.awoxmeshlight] _waitResp - set timeout to 5 seconds 2022-02-21 22:38:32 DEBUG (SyncWorker_10) [custom_components.awox.awoxmeshlight] _waitResp - timeout - no result received within timeout 2022-02-21 22:38:32 INFO (MainThread) [custom_components.awox.awox_mesh] [a4:c1:38:d1:d5:87][Bad Wand] Failed to connect, trying next device [Timed out while trying to connect to peripheral a4:c1:38:d1:d5:87, addr type: public] 2022-02-21 22:38:32 DEBUG (MainThread) [custom_components.awox.awox_mesh] [a4:c1:38:d1:d5:87][Bad Wand] Setting up Bluetooth connection failed, making sure Bluetooth device stops trying 2022-02-21 22:38:32 DEBUG (SyncWorker_6) [customcomponents.awox.awoxmeshlight] force stoppping blue helper

Am I missing something here?

Thanks for helping!

patpac9 commented 2 years ago

I'm having the same issue... Please fix it!!! <3

patpac9 commented 2 years ago

Nvm.. i just fixed it. 😅 Btw Xrlwyzz: use "bluetoothctl" and look if your adapter or dongle is recognized and set to on.

Xrlwyzz commented 2 years ago

Nvm.. i just fixed it. 😅 Btw Xrlwyzz: use "bluetoothctl" and look if your adapter or dongle is recognized and set to on.

Thanks for the hint. I'm relatively new to linux. Nevertheless, in bluetoothctl everything is turned on, I can see devices and so on. Also in bluetoothctl I can see the ID of the one AWOX light in range and switched on, so it seems like communication in general should be possible.

Unfortunately I still get the same errors and alle 3 Awox lights are unavailable.

patpac9 commented 2 years ago

Nvm.. i just fixed it. 😅 Btw Xrlwyzz: use "bluetoothctl" and look if your adapter or dongle is recognized and set to on.

Thanks for the hint. I'm relatively new to linux. Nevertheless, in bluetoothctl everything is turned on, I can see devices and so on. Also in bluetoothctl I can see the ID of the one AWOX light in range and switched on, so it seems like communication in general should be possible.

Unfortunately I still get the same errors and alle 3 Awox lights are unavailable.

In your debug output: "custom_components.awox.bluetoothctl"

As you can see the integration is using bluetoothctl. There must be something with that. Search deeply in the settings. Try to scan for other devices for example headphones does that work. Is your controller set as the default one, is there another controller recognized etc... If you played enough with your settings try to reinstall the intergation and restart hass. Let all lights on and wait.

When nothing works with your adapter. Im using a tplink usb dongle that costs 10€ from amazon. Maybe give that one a shot.

Xrlwyzz commented 2 years ago

Thanks for your help! I got it working. Indeed another adapter was fine. Turned out htis was an issue with the driver of the combined Intel Wifi/Bluetooth device driver. Then I had the issue it only worked over distances of 3-4 meters maximum, even when my smartphone can control everything from much further away. Now that all of this is sorted I can control the lights in homeassistant.

Nevertheless, I wanted to have an indicator in which state the light is currently (turned on and off through a regular wall switch). In my setup the integration does not seem to realize that the awox light is unavailable at the moment - unlike the smartphone app that disables the light when it is out of range or without power almost instantaneously. In Home Assistant it is in state "On" for hours after the light is switched off. I will do some more testing with that, maybe there is a solution to this.

patpac9 commented 2 years ago

I have the same problem.

I think you have 4 options here.

  1. Sell them and buy some zigbee panels.( They are friends of hue and intergate MUCH better) - btw I think i go that route

  2. Buy a wifi or zigbee wall switch and use the state(on/off) in automation to set the state from the light. - I already did that with a tuya wifi switch it works perfectly. But you need to swap out all light switches and you should have some neutral wires in your wall socket.

  3. You can try to fix it on your own in the code.

  4. Or contact the creator of this integration in another way mail etc... maybe he can help with that.

fsaris commented 2 years ago

the "is available" check looks indeed to be broken/unreliable. Will check if that can be improved. But as the initial issue in this ticket is resolved I close this ticket.

fsaris commented 2 years ago

@Xrlwyzz @patpac9 version 0.1.3b3 handles the unavailable state again.