I came up with the following solution:
(disclaimer: this solution enables PowerShell commands to be executed on your computers and MIGHT expose you to security risks, so use at your own risk)

How did I do this:
open your favorite text editor and create a PowerShell script (is made 4)

The script contains the following code: (change your ip address and the idx number to your situation, also this example is to turn the switch On, you can also use the Off command)
Code: Select all
$url="http://xx.xx.xx.xx:8080/json.htm?type=command¶m=switchlight&idx=220&switchcmd=On"
(New-Object System.Net.WebClient).DownloadString("$url");Be sure to save it as a PowerShell script file (.ps1)
Next open the Logitech gaming software

and click on the G-Keys and select the blue down-arrow to edit a G-Key

choose "Shortcut" and fill in the name (optional) and the shortcut location (location of the PowerShell script)

make sure that the file location does NOT have space in the name otherwise you get an error
(e.g.: C:\Users\username\Documents\DomoticzKeyboardCommands\AmbilightOn.ps1)
(NOT: C:\Users\username\Documents\Domoticz Keyboard Commands\Ambilight On.ps1
Do the same with your other scripts and G-Keys
Test by pressing the g-keys, if nothing happened and you see an PowerShell command screen with red letters it probably says something like:

(This image have i found on the interwebz because i fixed my error already)
You can fix this by doing the following:
Go to start and type PowerShell

right click on Windows PowerShell (x86) and run as administrator
Type the following command:
Code: Select all
Set-ExecutionPolicy RemoteSigned– Restricted: The default setting which does not load configuration files or run scripts.
– AllSigned: Requires that all scripts and configuration files be signed by a trusted publisher, including scripts that you write on the local computer.
– RemoteSigned: Requires that all scripts and configuration files downloaded from the Internet be signed by a trusted remote publisher.
– Unrestricted: Loads all configuration files and runs all scripts. If you run an unsigned script that was downloaded from the Internet, you are prompted for permission before it runs.
– Bypass: Nothing is blocked and there are no warnings or prompts.
– Undefined: Removes the currently assigned execution policy from the current scope, returning the session to the default. This parameter will not remove an execution policy that is set in a Active Directory Group Policy.
and choose A for Yes to All

Now do the same for Windows PowerShell (without (x86) )
and the G-Key should work
Let me know if you have any suggestions or questions