taburineagle / NeewerLite-Python

NeewerLite-Python is an un-official cross-platform Neewer LED light control app - written in Python, originally based off of the NeewerLite macOS Swift project by @keefo (Xu Lian)
MIT License
60 stars 11 forks source link

Hotkeys for Presets #63

Closed shootyourshotTV closed 1 year ago

shootyourshotTV commented 1 year ago

First off, thanks for continuing this project for windows from the original mac version.

I wanted to know if there was a way to add Custom hotkeys for presets? I'm trying to run this with my streaming programs to be able to trigger certain snapshot presets automatically. Would there be added support for that in the future?

EDIT: oof this is how you do it on the streamdeck : https://github.com/taburineagle/NeewerLite-Python/wiki/(3)---The-HTTP-Server-Daemon

fribse commented 1 year ago

I'm doing exactly that with a raspberry pi and the web interface. I just ask for specific urls with my presets.

shootyourshotTV commented 1 year ago

that sounds awesome! I really look forward to it - ive been playing with it all day. thanks for picking up the slack that neewer dropped.

shootyourshotTV commented 1 year ago

wait sorry, im new to github, youre not the coder and youre already doing what im asking for?

fribse commented 1 year ago

Yes, I'm not the developer, just set it up on a RPi, and use urls to a tivate presets.

lΓΈr. 4. feb. 2023 23.52 skrev shootyourshotTV @.***>:

wait sorry, im new to github, youre not the coder and youre already doing what im asking for?

β€” Reply to this email directly, view it on GitHub https://github.com/taburineagle/NeewerLite-Python/issues/63#issuecomment-1416868704, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADIHDTM6TUWKS7FV5BT6M3LWV3MRJANCNFSM6AAAAAAURL6O7Y . You are receiving this because you commented.Message ID: @.***>

shootyourshotTV commented 1 year ago

Im just extremely out of my element here and need a bit of hand-holding to get this done. i'll bother one of my friends that knows python because Im not sure how to launch the HTTP daemon.

Thanks for pointing me in the right direction! i really appreciate it

shootyourshotTV commented 1 year ago

Ive got the http daemon setup but none of the urls work, it wont connect through my browser

taburineagle commented 1 year ago

Hi @shootyourshotTV - I'm the coder πŸ˜„ @fribse is a long-running user, who also provides a lot of great suggestions - most of which I've been able to add, but I've fallen behind lately... Thanks for saying so, I'm glad you're enjoying the program! I could definitely code hotkeys for the presets in the GUI, let me check into that. As for the HTTP daemon, if the IP of the computer that's sending the URLs isn't listed as Acceptable in the NeewerLite-Python preferences (set up for now in the GUI), here -

Screenshot 2023-02-04 at 7 57 17 PM

Then the program will deny access to that computer until you add the IP for that specific system.

shootyourshotTV commented 1 year ago

Sorry! im not up on the lingo, the Developer lol. Its been fun setting this up but also a real headscratcher for someone that has no idea what they are doing. If I could get this to work, it would be much better than hotkeys.

whenever I run the HTTP Daemon, it says that an instance is already running - even after a restart so I have to do --force_instance image

I added the ip address in the program but that didnt change anything

Running the http://127.0.0.1/NeewerLite-Python/doAction?list url in the browser tells me that the ip address refuses the connection, even when i run the URL with the ip address for the computer.

taburineagle commented 1 year ago

Ha, that's cool, coder, developer, I know what you mean 😁 You need to use the IP address of the PC that's running the NeewerLite-Python HTTP server, if you're using a different PC than the one that's running the server. In your address, http://127.0.0.1/NeewerLite-Python/doAction?list, 127.0.0.1 is the IP address to the computer that you're on currently (127.0.0.1 refers to this computer), so you'd need to use the IP address of the machine you're running the server from, like http://10.0.0.45/... instead of http://127.0.0.1. Also, if you have the GUI running, close that first, and then the program shouldn't warn about another instance running.

shootyourshotTV commented 1 year ago

My friend offered me some help and this worked no problem http://127.0.0.1:8080/NeewerLite-Python/doAction?list

Thanks! its been a rollarcoaster of a day getting this to work, very rewarding

shootyourshotTV commented 1 year ago

@fribse would you mind me asking how you have yours setup with the streamdeck?

shootyourshotTV commented 1 year ago

ok I have it running by the commands wont change the lights half the time

fribse commented 1 year ago

I'll look it up when I can get to my computer, it's run via Home Assistant. I've created a webhook in HA, that toggles an input_boolean, and that triggers a flow in Node-Red, and the flow then sends webrequests to the raspberry pi. This way it also changes states in the streamdeck (my channel on YT is called Kenneths Teknik 😁 ). The office is currently a guest room, so when our guest wakes up, I'll go and look at the setup.

Make sure that the BT connection is strong enough. For me, when the signal gets below -70 dB, it is unreliable.

taburineagle commented 1 year ago

I'm glad you got the HTTP server sorted @shootyourshotTV - as @fribse says, a lower signal level to the lights makes sending them commands more unreliable. I'd say if you can get around -50 to -70dB you should be good, but anything less than that isn't guaranteed to work properly.

taburineagle commented 1 year ago

Also, nice YT channel @fribse - ha, I don't understand Dutch very well (I'd say... maybe 0.005% :D) but I like the style!

fribse commented 1 year ago

@taburineagle Dutch wouldn't do you any good anyways, it's Danish πŸ˜‚πŸ€£πŸ˜‚

shootyourshotTV commented 1 year ago

thanks for all the help from you two! So heres what I have so far and I hope all of this thread will be useful to future people who also have limited python knowledge. I know for sure thatll be sharing this with my streamer friends.

This is my flow for my streamdeck (@fribse id use home assistant but not all of my lights are home assistant compatible as I know and it seems like a whole other can of worms to figure out, maybe another day)

I have a startup button that leads to a .cmd that just gets the server started, waits 3 seconds, and sends a Discovery url to connect the light.

The .cmd looks like this: I type this out in a notepad and rename the extension as a .cmd since the stream decks native plugin wont open a .bat

@echo off "C:\Users\your-file-path\python.exe" "D:\your-file-path\NeewerLite-Python-main\NeewerLite-Python.py" python3 NeewerLite-Python.py --http --force_instance pause

I use the --force_instance to just avoid having the issue of the server thinking that another instance is running, even after a fresh restart.

This is what the startup sequence looks like on the stream deck image

I use the API Ninja plugin to send the urls and that looks like this: image

You can probably use the native System>Website plugin and toggle the GET in background box to prevent every button press opening up a new browser window. I tried to plugin above and it seemingly worked consistently but that was before I knew that my connection strength was giving me the connection issues. your mileage may vary.

It works pretty consistently on button press now after messing with my antenna. I seem to have a LOT of interference in my area so my rssi hovers around -68 to -71 with my antenna being l only 6 inches away from the light. I downloaded the iphone app "Bluetooth RSSI Analyser", connected to my light via bluetooth, and moved around my phone until i found the optimal place to put my antenna.

Im currently using the NEEWER RBG 530

Once again, thank you for making this and helping me along the way guys

taburineagle commented 1 year ago

Hehe, then I'm definitely out of my league @fribse! πŸ˜† You're very welcome @shootyourshotTV - I'm glad you like it!

fribse commented 1 year ago

Looks great, as I'm using Home Assistant, and have node-red do all the tricks for me, the Home Assistant is just integrated to the Stream Deck, it's so very nice to be able to manipulate everything through the stream deck πŸ˜„ I genuinly appreciate all the hard work done by @taburineagle, thankyou so much!

taburineagle commented 1 year ago

You're very welcome @fribse! 😊