dave-code-ruiz / elkbledom

Home Assistant custom component for LED STRIP NAME ELK BLEDOM
MIT License
77 stars 16 forks source link

Light strip fails to add #45

Closed QuantumTheFox closed 7 months ago

QuantumTheFox commented 11 months ago

Hi. I decided to try this project as I have an ELKBLEDOM Strip in my kitchen. I set up Bluetooth on my server (generic-x86) and installed the integration. The integration finds my light strip but when I try to go add it i get an endless spinning circle. image

If i leave the app, I get an unknown error. Nothings shows up in the logs, just a warning saying that this is a custom integration. I'm pretty new to bluetooth Hass devices as i just got the Bluetooth integration working on my server.

dave-code-ruiz commented 11 months ago

Use debug log to see more information of posible errors.

In configuration.yaml:

logger:
  default: info
  logs:
    custom_components.elkbledom: debug

Post log results.

but i think it is distance error, move strip beside raspberry for discart this possible issue

QuantumTheFox commented 11 months ago

Alright, now I get these 2 errors. I tried moving my server right next to the strip but still nothing. When I leave it for a while I get a 'Unable to connect to Elkbledom' error.

Error getting status: ELK-BLEDOM - BE:FF:00:00:0A:C9: Failed to connect after 4 attempt(s): TimeoutError Error getting status: ELK-BLEDOM - BE:FF:00:00:0A:C9: Failed to connect after 4 attempt(s): failed to discover services, device disconnected

dave-code-ruiz commented 11 months ago

Hi, The integration does not manage the connections , this error is throws from the bleak library (https://pypi.org/project/bleak/) it is possible to be distance error (now discarted) , or strip is connected to other device, or the strip staying blocked (try turn off, turn on), or something similar, but integration is not the problem

dave-code-ruiz commented 10 months ago

@dilpish say : I had a similar problem with an LED strip when I used weak USB power. I connected it to a more powerful power supply and everything worked out.

Dont use battery and try to use power supply with more amps, post your results

t0mc1k commented 10 months ago

Power supply sufficient, distance right next to the bluetooth receiver. It doesn't work. I enter the name of the device and click send, then it asks "Did the light blink" and nothing. nothing flashes. adding fails.

dave-code-ruiz commented 10 months ago

ok, i think it was possible the same issue but no. Like i said you in another post: The integration does not manage the connections , this error is throws from the bleak library (https://pypi.org/project/bleak/) it is possible to be distance error (now discarted) , or strip is connected to other device, or the strip staying blocked (try turn off, turn on), or something similar, but integration is not the problem

t0mc1k commented 10 months ago

I tried turning it on and off. I also tried powering down, waiting a while and reconnecting. still the same. the distance from bluetooth is about 15cm. the other device is not connecting i have not paired it with any application i have deleted all of them both from ios and android. even after erasing i tried the same procedure to turn off/on, disconnect from the network, etc. the device is found. it connects but when it says to blink it doesn't blink. Video https://www.youtube.com/watch?v=YT1Ll8yoJOY :)

dave-code-ruiz commented 10 months ago

Woowww, now i understand what occurs. !!!! Ok when question for you is , did it blink ?, you need to click the CHECK on the left for confirm blink. If you dont check it , process is canceled . Try clicking the check

t0mc1k commented 10 months ago

I've tried that too, otherwise I wouldn't be writing here. The device is added, but it doesn't work. The control does not work. I'm not stupid to post here without trying all the methods.

dave-code-ruiz commented 10 months ago

Ok, add the device, active debug mode, click some controla, turn on , turn off, change color, etc And then obtain debug log and post it here

t0mc1k commented 10 months ago

interesting that the brightness control works but the others don't. nor off and on, or changing colors or effects. Power supply is 2a, 5V charger. Led strip is placed next to the server. And in the log I noticed that the signal fluctuates from 71rssi to 121rssi. I don't understand why it does this. I'm guessing it's a bug? Should i get rid of it and buy a better bluetooth controller? But interesting that through the mobile phone app the baud works for me in the next room too. other devices I have via bluetooth humidity and temperature sensors are very far away from the server and they work great.

debug log: https://file.io/nd7yM7jLI2Hp

dave-code-ruiz commented 10 months ago

Ok, i saw all you send, and power supply , bluetooth and rest was correct. no bug. no need better bluetooth, and you can put your strip far away.

I saw too the log file and no ERROR in it, strip connect and no are fails to add. you havent same issue than @DaTrafficCone

Finally your strip model is MELK , i have an issue open about your problem, #11 and you need to send to the strip two init commands , i dont know why , something weird, but work fine:

sudo gatttool -b BE:16:F8:1D:D6:66 --char-write-req -a 0x0009 -n 7e0783 sudo gatttool -b BE:16:F8:1D:D6:66 --char-write-req -a 0x0009 -n 7e0404

after that, try to restart strip, add your strip to homeassistant and i think you could work with your strip normally

Try and post results

t0mc1k commented 10 months ago

Hey, boss. I'm sorry I'm only writing now, I've had a lot of work to do. I tried your tip. but without success. I can't write this data according to the gatttol. I tried restarting, turning off/on strip and etc. it won't let me write.

root@T0mc0-HA:~# sudo gatttool -b BE:16:F8:1D:D6:66 --char-write-req -a 0x0009 -n 7e0404 Characteristic Write Request failed: Attribute can't be written root@T0mc0-HA:~# sudo gatttool -b BE:16:F8:1D:D6:66 --char-write-req -a 0x0009 -n 7e0783 Characteristic Write Request failed: Attribute can't be written root@T0mc0-HA:~# sudo gatttool -b BE:16:F8:1D:D6:66 --char-write-req -a 0x0009 -n 7e0404 Characteristic Write Request failed: Attribute can't be written root@T0mc0-HA:~# sudo gatttool -b BE:16:F8:1D:D6:66 --char-write-req -a 0x0009 -n 7e0783 Characteristic Write Request failed: Attribute can't be written root@T0mc0-HA:~# sudo gatttool -b BE:16:F8:1D:D6:66 --char-write-req -a 0x0009 -n 7e0404 Characteristic Write Request failed: Attribute can't be written root@T0mc0-HA:~# sudo gatttool -b BE:16:F8:1D:D6:66 --char-write-req -a 0x0009 -n 7e0783 Characteristic Write Request failed: Attribute can't be written root@T0mc0-HA:~# sudo gatttool -b BE:16:F8:1D:D6:66 --char-write-req -a 0x0009 -n 7e0404 Characteristic Write Request failed: Attribute can't be written root@T0mc0-HA:~# sudo gatttool -b BE:16:F8:1D:D6:66 --char-write-req -a 0x0009 -n 7e0783 Characteristic Write Request failed: Attribute can't be written root@T0mc0-HA:~# sudo gatttool -b BE:16:F8:1D:D6:66 --char-write-req -a 0x0009 -n 7e0404 Characteristic Write Request failed: Attribute can't be written

dave-code-ruiz commented 10 months ago

There are only one connection to led strip, if HA is connected to strip, gatttool not work.

1- You need to delete HA integration with elkbledom strip. 2- restart strip 3- send commands with gatttool, first 7e0783 and second 7e0404 in this order.

Finally connect HA integration again

good luck