Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to connect to ELK-LAMPL #78

Open
Merikei opened this issue Dec 8, 2024 · 5 comments
Open

Unable to connect to ELK-LAMPL #78

Merikei opened this issue Dec 8, 2024 · 5 comments

Comments

@Merikei
Copy link

Merikei commented Dec 8, 2024

Awesome integration! But doesn't seem to work with my specific LEDs that are normally controlled with Lotus Lamp X (Google Play)

Name starts with: ELK-LAMPL

$ gatttool -I
[                 ][LE]> connect be:16:fa:00:04:2a
Attempting to connect to be:16:fa:00:04:2a
Connection successful

[be:16:fa:00:04:2a][LE]> primary
attr handle: 0x0001, end grp handle: 0x0003 uuid: 00001800-0000-1000-8000-00805f9b34fb
attr handle: 0x0004, end grp handle: 0x0009 uuid: 0000fff0-0000-1000-8000-00805f9b34fb

[be:16:fa:00:04:2a][LE]> Characteristics 
handle: 0x0002, char properties: 0x12, char value handle: 0x0003, uuid: 00002a00-0000-1000-8000-00805f9b34fb
handle: 0x0005, char properties: 0x10, char value handle: 0x0006, uuid: 0000fff4-0000-1000-8000-00805f9b34fb
handle: 0x0008, char properties: 0x06, char value handle: 0x0009, uuid: 0000fff3-0000-1000-8000-00805f9b34fb

[be:16:fa:00:04:2a][LE]> disconnect
[be:16:fa:00:04:2a][LE]> quit

sudo gatttool -i hci0 -b be:16:fa:00:04:2a --char-write-req -a 0x0009 -n 7e0004000000ff00ef # POWEROFF
sudo gatttool -i hci0 -b be:16:fa:00:04:2a --char-write-req -a 0x0009 -n 7e00040100000000ef # POWERON
@dave-code-ruiz
Copy link
Owner

only one question,

Work for you commands to power off and power on your specific LED ?

sudo gatttool -i hci0 -b be:16:fa:00:04:2a --char-write-req -a 0x0009 -n 7e0004000000ff00ef # POWEROFF
sudo gatttool -i hci0 -b be:16:fa:00:04:2a --char-write-req -a 0x0009 -n 7e00040100000000ef # POWERON

@Merikei
Copy link
Author

Merikei commented Dec 12, 2024

Those are the commands I ran, so not sure if I'm missing something, but I did check they worked when I ran them.

@dave-code-ruiz
Copy link
Owner

dave-code-ruiz commented Dec 13, 2024

ok, test version 1.2.1

I think it is posible to work to you

post results and logs please

@Merikei
Copy link
Author

Merikei commented Dec 14, 2024

It works!* 🎉 Thanks!

  • 🎉 Adjusting the brightness, turning on and off, and setting solid RGB colours works 🎉

  • *I don't care about this, but the effect names don't match the effects that occur, though all do something.
    My LEDs are a 20×20 grid which may explain the difference
    Happy to debug including log Bluetooth packets from LotusLamp X if others want, though.

  • *The whole device in Home Assistant shows up as being called "Effect Speed LED curtain" in Home Assistant (when I tried to name it "LED curtain")

  • *I'd expect number.effect_speed_led_curtain to be called number.led_curtain_effect_speed

  • *Setting the effect speed doesn't do anything. I tried other speeds but have just included setting it to 100 (max) and 0 (min) in the log below.
    I don't care about this, but again, happy to debug if others want.

  • *Included logged deprecation warning

  • One last thing:
    I use the "Gallery" mode in LotusLamp X which lets me pick from a few pixel art animations. This now lets me change the brightness and turn it on and off from Home Assistant, which is what I was mainly after, though I am interested in being able to send custom animations via Home Assistant, since while LotusLamp X has a "DIY" mode, there's no import or export option and the editor doesn't allow for picking exact colours.
    Any ideas?

Logs (not included testing turning on, off, setting solid colours, effects, and brightness)

2024-12-14 04:56:22.781 WARNING (MainThread) [homeassistant.helpers.frame] Detected that custom integration 'elkbledom' sets option flow config_entry explicitly, which is deprecated at custom_components/elkbledom/config_flow.py, line 196: self.config_entry = config_entry. This will stop working in Home Assistant 2025.12, please create a bug report at https://github.com/dave-code-ruiz/elkbledom/issues

2024-12-14 05:04:55.719 DEBUG (MainThread) [custom_components.elkbledom.config_flow] Discovered supported devices: ELK-LAMPL   2A - BE:16:FA:00:04:2A - -92
2024-12-14 05:05:17.300 DEBUG (MainThread) [custom_components.elkbledom.elkbledom] device ELK-LAMPL   2A: BE:16:FA:00:04:2A -92
2024-12-14 05:05:17.300 DEBUG (MainThread) [custom_components.elkbledom.elkbledom] Model information for device ELK-LAMPL   2A : ModelNo ELK-LAMPL, Turn on cmd [126, 0, 4, 1, 0, 0, 0, 0, 239], Turn off cmd [126, 0, 4, 0, 0, 0, 255, 0, 239], rssi -92
2024-12-14 05:05:17.300 DEBUG (MainThread) [custom_components.elkbledom.elkbledom] init command for: ELK-LAMPL   2A not needed; RSSI: -92
2024-12-14 05:05:17.301 DEBUG (MainThread) [custom_components.elkbledom.elkbledom] ELK-LAMPL   2A: Connecting; RSSI: -92
2024-12-14 05:05:17.710 DEBUG (MainThread) [custom_components.elkbledom.elkbledom] ELK-LAMPL   2A: Connected; RSSI: -92
2024-12-14 05:05:17.711 DEBUG (MainThread) [custom_components.elkbledom.elkbledom] ELK-LAMPL   2A: Configured disconnect from device in 120 seconds; RSSI: -92
2024-12-14 05:05:17.711 DEBUG (MainThread) [custom_components.elkbledom.elkbledom] login command for: ELK-LAMPL   2A not needed; RSSI: -92
2024-12-14 05:05:17.711 DEBUG (MainThread) [custom_components.elkbledom.elkbledom] ELK-LAMPL   2A: Subscribe to notifications; RSSI: -92
2024-12-14 05:05:17.723 DEBUG (MainThread) [custom_components.elkbledom.elkbledom] ELK-LAMPL   2A: Configured disconnect from device in 120 seconds; RSSI: -92
2024-12-14 05:05:17.724 DEBUG (MainThread) [custom_components.elkbledom.elkbledom]  7e 00 04 01 00 00 00 00 ef
2024-12-14 05:05:19.726 DEBUG (MainThread) [custom_components.elkbledom.elkbledom] ELK-LAMPL   2A: Configured disconnect from device in 120 seconds; RSSI: -92
2024-12-14 05:05:19.726 DEBUG (MainThread) [custom_components.elkbledom.elkbledom]  7e 00 04 00 00 00 ff 00 ef
2024-12-14 05:05:19.728 DEBUG (MainThread) [custom_components.elkbledom.elkbledom] ELK-LAMPL   2A: Stop
2024-12-14 05:05:19.728 DEBUG (MainThread) [custom_components.elkbledom.elkbledom] Disconnecting: READ_UUID=0000fff4-0000-1000-8000-00805f9b34fb (Handle: 6): Vendor specific, CLIENT_CONNECTED=True
2024-12-14 05:05:19.865 DEBUG (MainThread) [custom_components.elkbledom.elkbledom] ELK-LAMPL   2A: Disconnected from device; RSSI: -92
2024-12-14 05:05:26.090 DEBUG (MainThread) [custom_components.elkbledom] Config: Reset: None, Delay: None, Mac: BE:16:FA:00:04:2A
2024-12-14 05:05:26.090 DEBUG (MainThread) [custom_components.elkbledom.elkbledom] device ELK-LAMPL   2A: BE:16:FA:00:04:2A -92
2024-12-14 05:05:26.090 DEBUG (MainThread) [custom_components.elkbledom.elkbledom] Model information for device ELK-LAMPL   2A : ModelNo ELK-LAMPL, Turn on cmd [126, 0, 4, 1, 0, 0, 0, 0, 239], Turn off cmd [126, 0, 4, 0, 0, 0, 255, 0, 239], rssi -92
2024-12-14 05:05:26.091 DEBUG (MainThread) [custom_components.elkbledom.elkbledom] ELK-LAMPL   2A: Connecting; RSSI: -92
2024-12-14 05:05:26.093 DEBUG (MainThread) [custom_components.elkbledom.elkbledom] ELK-LAMPL   2A: Connection already in progress, waiting for it to complete; RSSI: -92
2024-12-14 05:05:26.190 DEBUG (MainThread) [custom_components.elkbledom.elkbledom] ELK-LAMPL   2A: Connected; RSSI: -92
2024-12-14 05:05:26.190 DEBUG (MainThread) [custom_components.elkbledom.elkbledom] login command for: ELK-LAMPL   2A not needed; RSSI: -92
2024-12-14 05:05:26.190 DEBUG (MainThread) [custom_components.elkbledom.elkbledom] ELK-LAMPL   2A: Subscribe to notifications; RSSI: -92

# effect speed 100, then 0 #
2024-12-14 06:20:10.762 DEBUG (MainThread) [custom_components.elkbledom.elkbledom]  7e 00 02 64 00 00 00 00 ef
2024-12-14 06:20:54.339 DEBUG (MainThread) [custom_components.elkbledom.elkbledom]  7e 00 02 00 00 00 00 00 ef

@dave-code-ruiz
Copy link
Owner

Wow! Good news!

I'm very happy

You could buy me a coffee if you consider it as a thanks

I'm glad to hear that, I'll ask you for help to make changes when I have time

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants