Sorry I took so long to reply. But I was not here at the time.
I would say it is possible. I managed to change light colors and modes already. But with forced IPs by MAC address (router config)
This example should turn lights on and off pressing "/" key on number pad if numLock is active and set it blue if inactive.
Code: Select all
#Include, lib/Socket.ahk
action_blue={"id":1,"method":"set_rgb","params":[255,"smooth",500]}`r`n
action_white={"id":1,"method":"set_ct_abx","params":[5000,"smooth",500]}`r`n
action_toggle={"id":1,"method":"toggle","params":[]}`r`n
lights := Array({"ip": "10.0.0.101"})
NumpadDiv::
TCP := new SocketTCP()
try {
TCP.Connect([lights[1].ip, yeelightPort])
if (GetKeyState("NumLock", "T")) {
TCP.SendText(action_toggle)
} else {
TCP.SendText(action_blue)
}
;info := TCP.RecvText()
TCP.Disconnect()
;MsgBox, % info
}
return
The Socket library is the one here:
https://autohotkey.com/boards/viewtopic.php?t=35120 and I placed it inside a lib folder.
I did not code a discovery function yet. but I do plan to do so.
Better late than never, right?