This is sort of a basic question, there's just one piece of the puzzle that I'm missing somewhere. I'm trying to write a batch script to change my smart home light bulbs to a specific color using netcat and UDP commands. If I open command prompt, type this:
ncat -u 192.168.1.3 38899
A connection is established successfully to my smart light bulb, and then I can type this:
{"id":1,"method":"setPilot","params":{"r":0,"g":0,"b":255,"dimming":100}}
Which sends the UDP message to the bulb, and successfully changes it to blue. The problem is I can't seem to get this process down to one line of code for use in a batch script, for example if I send this in a command line window:
ncat -u 192.168.1.3 38899 {"id":1,"method":"setPilot","params":{"r":0,"g":0,"b":255,"dimming":100}}
I get an error that I'm trying to specify more than one port. If called from a batch script, the connection will establish, then pause, and I can then send the UDP command by typing it into the open cmd window, but that defeats the purpose. I'm sure this is a simple solution that I'm just not aware of, would someone be able to help me out? Thanks.