Lutronの電動ロールスクリーンをNode-REDからTelnetで操作する方法についてまとめました。
Lutron機器をTelnetで操作するためには、Lutron QSE-CI-NWK-Eコントロールインターフェイスが必要になります。
QSE-CI-NWK-Eコントロールインターフェイスを使用した基本的な通信方法は過去の記事を参照ください
LutronをQSE-CI-NWK-Eコントロールインターフェースを使って制御する方法|デジタルライト(Digital-light.jp)
目次
作成したフロー
フローはこんな感じです。
[{"id":"9316b340105a1321","type":"inject","z":"c7814379aea85fd1","name":"auto_login","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":true,"onceDelay":"1","topic":"","payload":"","payloadType":"date","x":110,"y":60,"wires":[["8d543150e9ac8407"]]},{"id":"8d543150e9ac8407","type":"function","z":"c7814379aea85fd1","name":"nwk/n/r","func":"msg.payload = '';\nnode.send(msg);\nmsg.payload = 'nwk\\n\\r';\nnode.send(msg);","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":340,"y":60,"wires":[["909e714b3a42a135"]]},{"id":"e98e4c04e2687f9c","type":"function","z":"c7814379aea85fd1","name":"","func":"var b=Buffer.from(msg.payload);\nvar s=b.toString();\nvar out=s;\nmsg.payload = out;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":960,"y":140,"wires":[["a6bb2c98941a823f"]]},{"id":"a6bb2c98941a823f","type":"debug","z":"c7814379aea85fd1","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":970,"y":220,"wires":[]},{"id":"909e714b3a42a135","type":"tcp request","z":"c7814379aea85fd1","server":"192.168.1.231","port":"23","out":"sit","splitc":" ","name":"","x":860,"y":60,"wires":[["e98e4c04e2687f9c"]]},{"id":"6ee1027a9b5606a1","type":"inject","z":"c7814379aea85fd1","name":"Screen_DOWN","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":120,"y":300,"wires":[["ab00c22bc965fbdc","bfb3a276697c1181","174efc9b.2f3193"]]},{"id":"6b30da62205395f6","type":"inject","z":"c7814379aea85fd1","name":"Screen_UP","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":110,"y":180,"wires":[["bbaba9aef2b53cc4","cad8a789d9cdd1ce","527c261.1ac0ad8"]]},{"id":"bbaba9aef2b53cc4","type":"function","z":"c7814379aea85fd1","name":"#DEVICE,0x03c5082b,0,18,100","func":"msg.payload = '#DEVICE,0x03c5082b,0,18,100\\r\\n';\nnode.send(msg);","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":410,"y":180,"wires":[["909e714b3a42a135"]]},{"id":"ab00c22bc965fbdc","type":"function","z":"c7814379aea85fd1","name":"#DEVICE,0x03c5082b,0,19,100","func":"msg.payload = '#DEVICE,0x03c5082b,0,19,100\\r\\n';\nnode.send(msg);","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":410,"y":300,"wires":[["909e714b3a42a135"]]},{"id":"cad8a789d9cdd1ce","type":"function","z":"c7814379aea85fd1","name":"#DEVICE,0x03c5081f,0,18,100","func":"msg.payload = '#DEVICE,0x03c5081f,0,18,100\\r\\n';\nnode.send(msg);","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":410,"y":220,"wires":[["909e714b3a42a135"]]},{"id":"bfb3a276697c1181","type":"function","z":"c7814379aea85fd1","name":"#DEVICE,0x03c5081f,0,19,100","func":"msg.payload = '#DEVICE,0x03c5081f,0,19,100\\r\\n';\nnode.send(msg);","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":410,"y":340,"wires":[["909e714b3a42a135"]]},{"id":"512c3949e73e002c","type":"inject","z":"c7814379aea85fd1","name":"Screen_STOP","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payloadType":"date","x":110,"y":420,"wires":[["2db5a1d423d7dd8f","f316b3b4a2bdb63b","badc1de5.f651b"]]},{"id":"2db5a1d423d7dd8f","type":"function","z":"c7814379aea85fd1","name":"#DEVICE,0x03c5082b,0,20,100","func":"msg.payload = '#DEVICE,0x03c5082b,0,20,100\\r\\n';\nnode.send(msg);","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":410,"y":420,"wires":[["909e714b3a42a135"]]},{"id":"f316b3b4a2bdb63b","type":"function","z":"c7814379aea85fd1","name":"#DEVICE,0x03c5081f,0,20,100","func":"msg.payload = '#DEVICE,0x03c5081f,0,20,100\\r\\n';\nnode.send(msg);","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":410,"y":460,"wires":[["909e714b3a42a135"]]},{"id":"393c09291084b708","type":"inject","z":"c7814379aea85fd1","name":"Screen_HALF-Positon","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":140,"y":740,"wires":[["f039b385e45f0501","c7054c3272b1638d","44f91896.d65e38"]]},{"id":"f039b385e45f0501","type":"function","z":"c7814379aea85fd1","name":"#DEVICE,0x03c5082b,0,14,50","func":"msg.payload = '#DEVICE,0x03c5082b,0,14,50\\r\\n';\nnode.send(msg);","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":430,"y":780,"wires":[["909e714b3a42a135"]]},{"id":"c7054c3272b1638d","type":"function","z":"c7814379aea85fd1","name":"#DEVICE,0x03c5081f,0,14,52","func":"msg.payload = '#DEVICE,0x03c5081f,0,14,52\\r\\n';\nnode.send(msg);","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":430,"y":740,"wires":[["909e714b3a42a135"]]},{"id":"12d364c0ac85d91a","type":"inject","z":"c7814379aea85fd1","name":"Screen_CLOSE-Position","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":150,"y":860,"wires":[["037b6af3b0550b8d","e3a7fd3aa8a3b815","764d4cbd.da57e4"]]},{"id":"037b6af3b0550b8d","type":"function","z":"c7814379aea85fd1","name":"#DEVICE,0x03c5082b,0,14,3","func":"msg.payload = '#DEVICE,0x03c5082b,0,14,3\\r\\n';\nnode.send(msg);","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":420,"y":860,"wires":[["909e714b3a42a135"]]},{"id":"e3a7fd3aa8a3b815","type":"function","z":"c7814379aea85fd1","name":"#DEVICE,0x03c5081f,0,14,5","func":"msg.payload = '#DEVICE,0x03c5081f,0,14,5\\r\\n';\nnode.send(msg);","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":420,"y":900,"wires":[["909e714b3a42a135"]]},{"id":"894d3f1194e824ab","type":"function","z":"c7814379aea85fd1","name":"#DEVICE,0x03c5082b,0,14,50","func":"var position = msg.payload;\n\nmsg.payload = \"#DEVICE,0x03c5082b,0,14, \"+position+\"\\r\\n\";\nnode.send(msg);","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":370,"y":1360,"wires":[["909e714b3a42a135"]]},{"id":"0ee1d1f0856189ea","type":"inject","z":"c7814379aea85fd1","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"100","payloadType":"num","x":130,"y":1340,"wires":[["894d3f1194e824ab"]]},{"id":"23ded2cc0e818cf2","type":"inject","z":"c7814379aea85fd1","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"50","payloadType":"num","x":130,"y":1380,"wires":[["894d3f1194e824ab"]]},{"id":"64d51f6a476bfad5","type":"inject","z":"c7814379aea85fd1","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"60","payloadType":"num","x":130,"y":1420,"wires":[["894d3f1194e824ab"]]},{"id":"527c261.1ac0ad8","type":"function","z":"c7814379aea85fd1","name":"#DEVICE,0x03c50867,0,18,100","func":"msg.payload = '#DEVICE,0x03c50867,0,18,100\\r\\n';\nnode.send(msg);","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":410,"y":260,"wires":[["909e714b3a42a135"]]},{"id":"badc1de5.f651b","type":"function","z":"c7814379aea85fd1","name":"#DEVICE,0x03c50867,0,20,100","func":"msg.payload = '#DEVICE,0x03c50867,0,20,100\\r\\n';\nnode.send(msg);","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":410,"y":500,"wires":[["909e714b3a42a135"]]},{"id":"174efc9b.2f3193","type":"function","z":"c7814379aea85fd1","name":"#DEVICE,0x03c50867,0,19,100","func":"msg.payload = '#DEVICE,0x03c50867,0,19,100\\r\\n';\nnode.send(msg);","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":410,"y":380,"wires":[["909e714b3a42a135"]]},{"id":"44f91896.d65e38","type":"function","z":"c7814379aea85fd1","name":"#DEVICE,0x03c50867,0,14,48","func":"msg.payload = '#DEVICE,0x03c50867,0,14,48\\r\\n';\nnode.send(msg);","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":430,"y":820,"wires":[["909e714b3a42a135"]]},{"id":"764d4cbd.da57e4","type":"function","z":"c7814379aea85fd1","name":"#DEVICE,0x03c50867,0,14,2","func":"msg.payload = '#DEVICE,0x03c50867,0,14,2\\r\\n';\nnode.send(msg);","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":420,"y":940,"wires":[["909e714b3a42a135"]]},{"id":"67704c9.ca8d9b4","type":"inject","z":"c7814379aea85fd1","name":"Screen_OPEN-Positon","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":140,"y":620,"wires":[["19681888.f56e97","d606cb92.5da9e8","a76738d0.6bb158"]]},{"id":"19681888.f56e97","type":"function","z":"c7814379aea85fd1","name":"#DEVICE,0x03c5082b,0,14,98","func":"msg.payload = '#DEVICE,0x03c5082b,0,14,98\\r\\n';\nnode.send(msg);","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":430,"y":620,"wires":[["909e714b3a42a135"]]},{"id":"d606cb92.5da9e8","type":"function","z":"c7814379aea85fd1","name":"#DEVICE,0x03c5081f,0,14,100","func":"msg.payload = '#DEVICE,0x03c5081f,0,14,100\\r\\n';\nnode.send(msg);","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":430,"y":660,"wires":[["909e714b3a42a135"]]},{"id":"a76738d0.6bb158","type":"function","z":"c7814379aea85fd1","name":"#DEVICE,0x03c50867,0,14,95","func":"msg.payload = '#DEVICE,0x03c50867,0,14,95\\r\\n';\nnode.send(msg);","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":430,"y":700,"wires":[["909e714b3a42a135"]]},{"id":"e72d602b.5e97e","type":"inject","z":"c7814379aea85fd1","name":"GraphicEye_Scene1","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":130,"y":1040,"wires":[["ef935f98.e0915"]]},{"id":"ef935f98.e0915","type":"function","z":"c7814379aea85fd1","name":"#DEVICE,TESTQS,70,3","func":"msg.payload = '#DEVICE,TESTQS,70,3\\r\\n';\nnode.send(msg);","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":410,"y":1040,"wires":[["909e714b3a42a135"]]},{"id":"22be671e.972e58","type":"inject","z":"c7814379aea85fd1","name":"GraphicEye_Scene2","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":130,"y":1080,"wires":[["d5d54392.c5c3a"]]},{"id":"d5d54392.c5c3a","type":"function","z":"c7814379aea85fd1","name":"#DEVICE,TESTQS,71,3","func":"msg.payload = '#DEVICE,TESTQS,71,3\\r\\n';\nnode.send(msg);","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":410,"y":1080,"wires":[["909e714b3a42a135"]]},{"id":"be4f8e92.8b53a","type":"inject","z":"c7814379aea85fd1","name":"GraphicEye_Scene3","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":130,"y":1120,"wires":[["4291ec52.d39774"]]},{"id":"4291ec52.d39774","type":"function","z":"c7814379aea85fd1","name":"#DEVICE,TESTQS,76,3","func":"msg.payload = '#DEVICE,TESTQS,76,3\\r\\n';\nnode.send(msg);","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":410,"y":1120,"wires":[["909e714b3a42a135"]]},{"id":"e7d0be6.37b1a4","type":"inject","z":"c7814379aea85fd1","name":"GraphicEye_Scene4","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":130,"y":1160,"wires":[["b357d3ff.c2cca"]]},{"id":"b357d3ff.c2cca","type":"function","z":"c7814379aea85fd1","name":"#DEVICE,TESTQS,77,3","func":"msg.payload = '#DEVICE,TESTQS,77,3\\r\\n';\nnode.send(msg);","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":410,"y":1160,"wires":[["909e714b3a42a135"]]},{"id":"146e5153.75418f","type":"inject","z":"c7814379aea85fd1","name":"GraphicEye_OFF","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":120,"y":1200,"wires":[["4ffcd3d2.3a08ec"]]},{"id":"4ffcd3d2.3a08ec","type":"function","z":"c7814379aea85fd1","name":"#DEVICE,TESTQS,83,3","func":"msg.payload = '#DEVICE,TESTQS,83,3\\r\\n';\nnode.send(msg);","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":410,"y":1200,"wires":[["909e714b3a42a135"]]},{"id":"2e612818.090188","type":"comment","z":"c7814379aea85fd1","name":"自動ログイン","info":"","x":110,"y":20,"wires":[]},{"id":"a577deef.46a07","type":"comment","z":"c7814379aea85fd1","name":"開いて閉じたり止めたり","info":"","x":150,"y":140,"wires":[]},{"id":"9813444.88567b8","type":"comment","z":"c7814379aea85fd1","name":"ポジションで同じ長さに揃える","info":"","x":150,"y":580,"wires":[]},{"id":"bfe54ec1.2b7d6","type":"comment","z":"c7814379aea85fd1","name":"グラフィックアイからのシーン変更","info":"","x":160,"y":1000,"wires":[]},{"id":"329a7382.58264c","type":"function","z":"c7814379aea85fd1","name":"nwk/n/r","func":"msg.payload = '?DETAILS,ffffffff\\n\\r';\n\nreturn msg;\n","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1080,"y":340,"wires":[["909e714b3a42a135"]]},{"id":"52f5d83.6572028","type":"inject","z":"c7814379aea85fd1","name":"テスト","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":850,"y":340,"wires":[["329a7382.58264c"]]},{"id":"ac758adb.20d0c8","type":"comment","z":"c7814379aea85fd1","name":"数値で位置を変更","info":"","x":110,"y":1300,"wires":[]}]
Lutronロールスクリーンを制御する方法
スクリーンのID
スクリーンにはIDがあり、このIDを指定してコマンドを送ることで制御できます。
スマートライトの事務所には3つのスクリーンがあり、それぞれのIDは、
スクリーン1:0x03c5082b
スクリーン2:0x03c5081f
スクリーン3:0x03c50867
となります。
スクリーンUPのコマンド
#DEVICE,【スクリーンID】,0,18,100\r\n
スクリーンDOWNのコマンド
#DEVICE,【スクリーンID】,0,19,100\r\n
スクリーンSTOPのコマンド(動いているのを止める)
#DEVICE,【スクリーンID】,0,20,100\r\n
任意の位置で止める
#DEVICE,【スクリーンID】,0,14,【任意の位置0〜100】\r\n
まとめ
以上、Lutron電動ロールスクリーンをNode-REDから制御する方法をご紹介しました。