今天,在NR里准备做电视与功放的自动化联动流程的时候,突然觉得应该拿到小米电视局域网控制api,虽然io或者hass本身都有小米电视的节点,但是据我所知,并不好用,所以索性拿到api,来用NR直接控制,效率更高,反应更快,出现问题的概率也更低。
好了,先来个示意图
节点分享如下:
[{"id":"e416228f.73db4","type":"http request","z":"6107880d.ece008","name":"增大音量","method":"GET","ret":"txt","paytoqs":false,"url":"http://192.168.3.23:6095/controller?action=keyevent&keycode=volumeup","tls":"","proxy":"","authType":"basic","x":440,"y":80,"wires":[[]]},{"id":"76932be7.8ef474","type":"inject","z":"6107880d.ece008","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":250,"y":80,"wires":[["e416228f.73db4"]]},{"id":"6c8ad3fc.b29cbc","type":"http request","z":"6107880d.ece008","name":"减小音量","method":"GET","ret":"txt","paytoqs":false,"url":"http://192.168.3.23:6095/controller?action=keyevent&keycode=volumedown","tls":"","proxy":"","authType":"basic","x":440,"y":120,"wires":[[]]},{"id":"3438fc5d.0dd9a4","type":"inject","z":"6107880d.ece008","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":250,"y":120,"wires":[["6c8ad3fc.b29cbc"]]},{"id":"a0e5fbf1.0f0a08","type":"http request","z":"6107880d.ece008","name":"电源","method":"GET","ret":"txt","paytoqs":false,"url":"http://192.168.3.23:6095/controller?action=keyevent&keycode=power","tls":"","proxy":"","authType":"basic","x":430,"y":160,"wires":[[]]},{"id":"3a9d795d.45cbe6","type":"inject","z":"6107880d.ece008","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":250,"y":160,"wires":[["a0e5fbf1.0f0a08"]]},{"id":"4421cbbd.6de674","type":"http request","z":"6107880d.ece008","name":"上","method":"GET","ret":"txt","paytoqs":false,"url":"http://192.168.3.23:6095/controller?action=keyevent&keycode=up","tls":"","proxy":"","authType":"basic","x":430,"y":200,"wires":[[]]},{"id":"b706ef93.bdbd8","type":"inject","z":"6107880d.ece008","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":250,"y":200,"wires":[["4421cbbd.6de674"]]},{"id":"f8d98218.04e58","type":"http request","z":"6107880d.ece008","name":"下","method":"GET","ret":"txt","paytoqs":false,"url":"http://192.168.3.23:6095/controller?action=keyevent&keycode=down","tls":"","proxy":"","authType":"basic","x":430,"y":240,"wires":[[]]},{"id":"3a4592eb.fb6bde","type":"inject","z":"6107880d.ece008","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":250,"y":240,"wires":[["f8d98218.04e58"]]},{"id":"2214abc1.efa044","type":"http request","z":"6107880d.ece008","name":"左","method":"GET","ret":"txt","paytoqs":false,"url":"http://192.168.3.23:6095/controller?action=keyevent&keycode=left","tls":"","proxy":"","authType":"basic","x":430,"y":280,"wires":[[]]},{"id":"7876040.a522ffc","type":"inject","z":"6107880d.ece008","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":250,"y":280,"wires":[["2214abc1.efa044"]]},{"id":"cf4937d5.e69488","type":"http request","z":"6107880d.ece008","name":"右","method":"GET","ret":"txt","paytoqs":false,"url":"http://192.168.3.23:6095/controller?action=keyevent&keycode=right","tls":"","proxy":"","authType":"basic","x":430,"y":320,"wires":[[]]},{"id":"5be9c126.f3fb7","type":"inject","z":"6107880d.ece008","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":250,"y":320,"wires":[["cf4937d5.e69488"]]},{"id":"4a6575be.412c9c","type":"http request","z":"6107880d.ece008","name":"确定","method":"GET","ret":"txt","paytoqs":false,"url":"http://192.168.3.23:6095/controller?action=keyevent&keycode=enter","tls":"","proxy":"","authType":"basic","x":430,"y":360,"wires":[[]]},{"id":"45907aa8.f3fd44","type":"inject","z":"6107880d.ece008","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":250,"y":360,"wires":[["4a6575be.412c9c"]]},{"id":"e7e7f7d0.3e1658","type":"http request","z":"6107880d.ece008","name":"返回","method":"GET","ret":"txt","paytoqs":false,"url":"http://192.168.3.23:6095/controller?action=keyevent&keycode=back","tls":"","proxy":"","authType":"basic","x":430,"y":400,"wires":[[]]},{"id":"47a085cc.6712dc","type":"inject","z":"6107880d.ece008","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":250,"y":400,"wires":[["e7e7f7d0.3e1658"]]},{"id":"99a29e74.31d61","type":"http request","z":"6107880d.ece008","name":"菜单","method":"GET","ret":"txt","paytoqs":false,"url":"http://192.168.3.23:6095/controller?action=keyevent&keycode=menu","tls":"","proxy":"","authType":"basic","x":430,"y":440,"wires":[[]]},{"id":"658f2577.b514ac","type":"inject","z":"6107880d.ece008","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":250,"y":440,"wires":[["99a29e74.31d61"]]},{"id":"9dec8ec3.e4ab","type":"http request","z":"6107880d.ece008","name":"主页","method":"GET","ret":"txt","paytoqs":false,"url":"http://192.168.3.23:6095/controller?action=keyevent&keycode=home","tls":"","proxy":"","authType":"basic","x":430,"y":480,"wires":[[]]},{"id":"9438b4d9.228e38","type":"inject","z":"6107880d.ece008","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":250,"y":480,"wires":[["9dec8ec3.e4ab"]]},{"id":"f3d935f4.263d08","type":"comment","z":"6107880d.ece008","name":"小米电视控制API","info":"","x":220,"y":40,"wires":[]}]
刚准备要睡觉,突然想起来有个地方需要补充,又爬起来打开电脑把坑填完吧。。。其实稍微有点道行的大佬就应该会知道有个地方需要根据个人情况修改。
如图所示:
请各位仙友一定要把红框这里的IP地址改成你们自己家小米电视的ip地址。。切记,只改ip就好,端口号什么的都不要动。
如果你要觉得对你有用的话,请点个赞吧。。。