how do i try that?farhanito wrote:Does the script works in terminal? Maybe nc isn't installed
My hue scripts [ and much others ] work fine...
Moderator: leecollings
how do i try that?farhanito wrote:Does the script works in terminal? Maybe nc isn't installed
Code: Select all
#!/bin/bash
echo -ne '{"id":1,"method":"set_bright","params":[50, "smooth", 500]}\r\n' | nc -w1 192.168.5.29 55443
Make no different...corbin wrote:one more thing I just saw in your setup, you have 3 slashes. Change to two:
script:///home
change to
script://home
Are you able to talk about this PWM lawyer letter? Interested to know what it was about?weiweipossible wrote: Besides that, if we implement the same form of API, we may receive a letter from Philips' lawyer ... just like when we develop this bulb using the everyone-is-using PWM technique ...
Code: Select all
linaro@cubie:~$ cd /home/linaro/domoticz/scripts/bash/yeelight
linaro@cubie:~/domoticz/scripts/bash/yeelight$ echo -ne '{"id":1,"method":"set_s cene", "params": ["color", 65280, 70]}\r\n' | nc -w1 192.168.5.30 55443
{"id":1, "result":["ok"]}
{"method":"props","params":{"power":"on"}}
{"method":"props","params":{"color_mode":1,"bright":70,"rgb":65280}}
linaro@cubie:~/domoticz/scripts/bash/yeelight$
Code: Select all
linaro@cubie:~$ cd /home/linaro/domoticz/scripts/bash/yeelight
linaro@cubie:~/domoticz/scripts/bash/yeelight$ echo -ne '{"id":1,"method":"set_s cene", "params": ["color", 65280, 70]}\r\n' | nc -w1 192.168.5.30 55443
{"id":1, "result":["ok"]}
{"method":"props","params":{"power":"on"}}
{"method":"props","params":{"color_mode":1,"bright":70,"rgb":65280}}
linaro@cubie:~/domoticz/scripts/bash/yeelight$ ^C
linaro@cubie:~/domoticz/scripts/bash/yeelight$ echo -ne '{"id":1, "method":"start_cf", "params":[3,1,"50,1,16731392,1,360000,2,1700,10,540000,2,2700,100"]}\r\n' | nc -w1 192.168.5.30 55443
{"id":1, "result":["ok"]}
{"method":"props","params":{"flowing":1}}
{"method":"props","params":{"flow_params":"3,1,50,1,16731392,1,360000,2,1700,10,540000,2,2700,100"}}
linaro@cubie:~/domoticz/scripts/bash/yeelight$ ./start_1.sh
{"id":(null), "error":{"code":-1, "message":"invalid command"}}
linaro@cubie:~/domoticz/scripts/bash/yeelight$ ./ start_1.sh
-bash: ./: Is a directory
linaro@cubie:~/domoticz/scripts/bash/yeelight$ ./start_1.sh
{"id":(null), "error":{"code":-1, "message":"invalid command"}}
linaro@cubie:~/domoticz/scripts/bash/yeelight$ ./sunrise_1.sh
{"id":(null), "error":{"code":-1, "message":"invalid command"}}
linaro@cubie:~/domoticz/scripts/bash/yeelight$
Code: Select all
#!/bin/sh
echo -ne '{"id":1,"method":"set_scene", "params": ["color", 65280, 70]}\r\n' | nc -w1 192.168.5.30 55443
You missed the "id" field which is mandatory.Derik wrote:Terminal:Light was off..Code: Select all
linaro@cubie:~$ cd /home/linaro/domoticz/scripts/bash/yeelight linaro@cubie:~/domoticz/scripts/bash/yeelight$ echo -ne '{"id":1,"method":"set_s cene", "params": ["color", 65280, 70]}\r\n' | nc -w1 192.168.5.30 55443 {"id":1, "result":["ok"]} {"method":"props","params":{"power":"on"}} {"method":"props","params":{"color_mode":1,"bright":70,"rgb":65280}} linaro@cubie:~/domoticz/scripts/bash/yeelight$
And after this on wih a green light...
Other things i try:Think the script is not ok.Code: Select all
linaro@cubie:~$ cd /home/linaro/domoticz/scripts/bash/yeelight linaro@cubie:~/domoticz/scripts/bash/yeelight$ echo -ne '{"id":1,"method":"set_s cene", "params": ["color", 65280, 70]}\r\n' | nc -w1 192.168.5.30 55443 {"id":1, "result":["ok"]} {"method":"props","params":{"power":"on"}} {"method":"props","params":{"color_mode":1,"bright":70,"rgb":65280}} linaro@cubie:~/domoticz/scripts/bash/yeelight$ ^C linaro@cubie:~/domoticz/scripts/bash/yeelight$ echo -ne '{"id":1, "method":"start_cf", "params":[3,1,"50,1,16731392,1,360000,2,1700,10,540000,2,2700,100"]}\r\n' | nc -w1 192.168.5.30 55443 {"id":1, "result":["ok"]} {"method":"props","params":{"flowing":1}} {"method":"props","params":{"flow_params":"3,1,50,1,16731392,1,360000,2,1700,10,540000,2,2700,100"}} linaro@cubie:~/domoticz/scripts/bash/yeelight$ ./start_1.sh {"id":(null), "error":{"code":-1, "message":"invalid command"}} linaro@cubie:~/domoticz/scripts/bash/yeelight$ ./ start_1.sh -bash: ./: Is a directory linaro@cubie:~/domoticz/scripts/bash/yeelight$ ./start_1.sh {"id":(null), "error":{"code":-1, "message":"invalid command"}} linaro@cubie:~/domoticz/scripts/bash/yeelight$ ./sunrise_1.sh {"id":(null), "error":{"code":-1, "message":"invalid command"}} linaro@cubie:~/domoticz/scripts/bash/yeelight$
Code: Select all
linaro@cubie:~/domoticz/scripts/bash/yeelight$ echo -ne '{"id":1,"method":"set_scene", "params": ["color", 65280, 70]}\r\n' | nc -w1 192.168.5.30 55443
{"id":1, "result":["ok"]}
{"method":"props","params":{"color_mode":1}}
{"method":"props","params":{"bright":70}}
linaro@cubie:~/domoticz/scripts/bash/yeelight$
Yes other scripts are working fine.corbin wrote:So it looks like there is a problem with your bash file. are you able to execute other bash files?
Code: Select all
linaro@cubie:~/domoticz/scripts/bash/yeelight$ ./start.sh
{"id":(null), "error":{"code":-1, "message":"invalid command"}}
linaro@cubie:~/domoticz/scripts/bash/yeelight$ ./sunrise.sh
{"id":1, "result":["ok"]}
linaro@cubie:~/domoticz/scripts/bash/yeelight$
Code: Select all
#!/bin/bash
everything the samecorbin wrote:Did you create your Hue script file the same way you created the Yeelight file? Same text editor, file permissions exactly the same etc? Maybe try a Cubieboard forum and see if someone else can run the script ok.
Can you also post up more information about your Cubieboard setup?
Code: Select all
#!/bin/bash
toggle="{\"id\":1,\"method\":\"toggle\",\"params\":[]}\r\n"
on="{\"id\":1,\"method\":\"set_power\",\"params\":[\"on\",\"smooth\",500]}\r\n"
off="{\"id\":1,\"method\":\"set_power\",\"params\":[\"off\",\"smooth\",500]}\r\n"
b="{\"id\":1,\"method\":\"set_bright\",\"params\":[$2,\"smooth\",500]}\r\n"
ct="{\"id\":1,\"method\":\"set_ct_abx\",\"params\":[$2,\"smooth\",500]}\r\n"
exec 3<> /dev/tcp/192.168.31.101/55443
# echo $1
case $1 in
toggle)
printf "$toggle" >&3
;;
on)
printf "$on" >&3
;;
off)
printf "$off" >&3
;;
b)
printf "$b" >&3
;;
ct)
printf "$ct" >&3
;;
esac
Users browsing this forum: No registered users and 1 guest