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

Multiple Colors on different sides of the monitor / Hotkeys? #306

Closed
HighOnBuffs opened this issue Feb 15, 2020 · 21 comments
Closed

Multiple Colors on different sides of the monitor / Hotkeys? #306

HighOnBuffs opened this issue Feb 15, 2020 · 21 comments

Comments

@HighOnBuffs
Copy link

Hi i love Prismatik but the software is pretty limiting when it comes to options.
How can i simply say for example, one side of the screen shows pink static lights while the other does red? Also is there a way to place hotkeys to switch from ambient to static for example?
Thanks!

@zomfg
Copy link

zomfg commented Feb 15, 2020

This is not exactly built-in, but both are doable. Here's how to achieve it (on Windows):

This involves enabling API server in Prismatik and using a little program called AutoHotKey.

In Prismatik:

  1. enable "Expert mode" in "Profiles" tab
  2. enable server in "Experimental" tab
    • then uncheck "listen only on local interface" if you want to control it from other computers
    • leave Key empty
  3. (optional) to see command list available in your Prismatik version, in a command prompt type telnet localhost 3636 (your Prismatik PC address and port from "experimental" tab)
    • you should see "Lightpack...." something something
    • type "help"

Now, AutoHotKey (this allows you doing all kinds of crazy things and bind them to, well, hotkeys)

  1. Download (I used "Current version", and when asked, "unicode 64")
  2. put this script in a folder of your choice
  3. put this script in the same folder
  4. open the latter with notepad or whatever, and change this part
; Prismatik machine's IP
global PRISMATIK_IP="192.168.1.20"
; port from Experimental tab
global PRISMATIK_PORT=3636
  1. right click on the same file, "Run Script"

Now, in theory, pressing Ctrl+1 should do the pink/red thing.
You can re-bind whatever keys you want, you can implement your own things from Prismatik API, as a bonus example I included a profile change on Ctrl+2. Look through prismatik.ahk file, it should be easy enough to customise for simple use cases combined with help from step 3. in Prismatik part (you can assign a color to each LED if you wish so).

Caveat: as of right now, the static color part seems to be breaking other animated modes until you restart Prismatik (I'll look into that). For other modes you can make profiles, bind them and switch between them (until you set the color).

@HighOnBuffs
Copy link
Author

HighOnBuffs commented Feb 15, 2020 via email

@HighOnBuffs
Copy link
Author

HighOnBuffs commented Feb 15, 2020

So i tried it but when i want to lauch the ahk script it tells me:
"Error at line 7.
#include file .../socket.ahk cant be opened"
So i renamed the first file in socket.ahk thinking it would probably work with that and after that it started but ctr+1 doesnt work for me.

What did you mean with change that part?:
; Prismatik machine's IP
global PRISMATIK_IP="192.168.1.20"
; port from Experimental tab
global PRISMATIK_PORT=3636

I tried setting the IP my prismatik tells me under local interface and it seems to connect as when i press ctrl+1 a lock appears next to the sun icon in the lower right corner of Prismatik that tells me on hover: "API colors persited" and also "Device locked via API" when i press ctrl+2.

When i "telnet localhost 3636" it tells me telnet is not a recognized command.
Any chance you could explain further what i need to change exactly or what might be wrong?

Thanks so much i can see this being great when i get this working!

@zomfg
Copy link

zomfg commented Feb 16, 2020

Try this version (you'll need to right click and "Run")
It should create prismatik.log file in the same directory as the .ahk file when you press your key combos, post it here

Telnet part isn't required for this, but you can enable it

@zomfg
Copy link

zomfg commented Feb 16, 2020

@psieg There's some hotkey code in the settings, but not in the UI/conf files, any idea what's the history there?

@HighOnBuffs
Copy link
Author

HighOnBuffs commented Feb 16, 2020

https://pastebin.com/4gTk4qqW

Is what i got from the log file. Thanks so much for taking the time and helping me out!

@zomfg
Copy link

zomfg commented Feb 16, 2020

New version
If that works, change True to False here to stop logging (if you care about that)

global LOG_DEBUG:=True

@HighOnBuffs
Copy link
Author

Awesome this worked! Thank you so much!

Is it possible to have an even 3 way light as well? Like left side right side middle side?

Oh and for some reason when i change the hotkeys to Alt+Ctrl+1 it doesnt seem to work.
Does AHK have problems with tripple inputs?

@zomfg
Copy link

zomfg commented Feb 16, 2020

Another update: you can add any number of colors, you can do 1 per LED if you want

Alt+Ctrl+1 works for me with ^!1::

@HighOnBuffs
Copy link
Author

Amazing it works flawless also the hotkeys!
I cant thank you enough! That was the most competent and flawless problem solving ive encountered in a long time!
Hope you have a wonderful week, you are awesome! 💯

@HighOnBuffs
Copy link
Author

Hi quick question: I started using a VPN recently and eventhough i whitelisted AHK and Prismatik the hotkeys stoped working when running the VPN saying "failed to connect".
Is there a way around that or do i need to whitelist something else?
Thanks in advance!

@zomfg
Copy link

zomfg commented Mar 2, 2020

something like a NordVPN?
what does you ipconfig look like?
are AHK and Prismatik on same PC? which IP did you put in AHK script?

@HighOnBuffs
Copy link
Author

HighOnBuffs commented Mar 2, 2020 via email

@HighOnBuffs
Copy link
Author

Hi got it to work when typing ipconfig i used the ip4 adress shown from my fritzbox.
Hope it doesnt make the VPN useless but all good for now!

@HighOnBuffs
Copy link
Author

HighOnBuffs commented Oct 11, 2020

Hi i remembered you helping me so much it blew my mind with this!
Thanks so much again! I recently switched or rather planning of switching at least partly to Arch Linux and was thinking ok Prismatic exists for linux but how do i use the AHK script on Linux to control my LEDs via hotkeys?

Is there an easy way to use my 2 control scripts on linux or convert them?

https://privatebin.net/?fbd885fa8fdfcc93#Hb38gUPkZ6iS7kAh7aygqf5amFGfYRRX8xL86TofMBoA is the main ahk file
https://privatebin.net/?24ee62bbc00f90e9#Am5HJ3Uwp2v6cA9p5crHnbbA4JVPiLSsomiUGAZkqtKx is the socket config file i think?

@zomfg
Copy link

zomfg commented Oct 11, 2020

I'm not sure there's a direct way to use ahk scripts, I'll let you do more research
but on linux you can easily bind your keys to execute whatever you want (either through your DE/WM or something like sxhkd)
so if there's no way to run ahk scripts directly, you could invoke, for example, python scripts that talk to prismatik
see examples here
lightpack.py takes care of most of the things, you'll just need another script that changes profiles etc and bind keys to that one

also beware, I don't think the screen capture works with Wayland

@minhluan259
Copy link

@zomfg Can we have hotkey for setmode (Screen grabbing / Mood lamp / Sound visualization) and turn light ON/OFF ?

@zomfg
Copy link

zomfg commented Jun 13, 2021

I updated the gist
while you can send those commands on their own, you can achieve the same thing with profiles (one with screen grab, one moodlamp A, one modlamp B, etc) and just flip between those

@minhluan259
Copy link

@zomfg thank you so much for update.
Can we get current status / mode and make hotkey as toggle?

@Talesowy
Copy link

Fantastic work! But I have issue: leds are disabled after +/- 40 sec when I switch profile to ctrl+1 What I'm doing wrong?

@zomfg
Copy link

zomfg commented Dec 2, 2022

if that switches to a static color your firmware probably times out, you can try unchecking "send data only if changed"

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

5 participants