ComfortClickのRPC機能とクラウドGateWay機能を使って外部から操作する方法メモ

ComfortClickが外部のシステムと連携する際、RPC(Remote Procedure Call protocol)という機能を使うことができます。

RPC – Smart Home Building Automation Software – ComfortClick bOS

今回、Node-REDからRPC呼び出しのアプリをつくり、クラウドゲートウェイ機能を使うことでリモートからローカルにあるComfortClickの状態を取得したりデバイスを制御したり、シーンなどのFunctionを動作させる方法のメモをおいておきます。

Node-REDのフロー

UntitledImage

Node-REDのフロー。

[{"id":"6c1be3dfb18f1cde","type":"debug","z":"1cc49f1b109653d6","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":830,"y":240,"wires":[]},{"id":"b281826c1e55fbc4","type":"http request","z":"1cc49f1b109653d6","name":"SetValue","method":"POST","ret":"txt","paytoqs":"ignore","url":"https://RPC:RPC@gateway.comfortclick.com/UISample202309/API/RPC/SetValue","tls":"","persist":false,"proxy":"","insecureHTTPParser":false,"authType":"","senderr":false,"headers":[],"x":600,"y":240,"wires":[["6c1be3dfb18f1cde"]]},{"id":"22fa4568b8555960","type":"inject","z":"1cc49f1b109653d6","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"100","payloadType":"num","x":250,"y":200,"wires":[["566b370c9db41410"]]},{"id":"566b370c9db41410","type":"template","z":"1cc49f1b109653d6","name":"DALI-G1-LED","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"{\"objectName\":\"Devices\\\\KNX\\\\TW\\\\G1-DimLevel\",\"valueName\":\"Value\",\"value\":\"{{payload}}\"}","output":"str","x":420,"y":220,"wires":[["b281826c1e55fbc4"]]},{"id":"6d98c7f9011cc55c","type":"inject","z":"1cc49f1b109653d6","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"0","payloadType":"num","x":250,"y":240,"wires":[["566b370c9db41410"]]},{"id":"15a311f2518515a7","type":"comment","z":"1cc49f1b109653d6","name":"DeviceControl","info":"","x":250,"y":160,"wires":[]},{"id":"6f3f370b5bee61e9","type":"comment","z":"1cc49f1b109653d6","name":"CallScenes","info":"","x":250,"y":300,"wires":[]},{"id":"668ff0b4e43e2dd2","type":"http request","z":"1cc49f1b109653d6","name":"","method":"POST","ret":"txt","paytoqs":"ignore","url":"http://RPC:RPC@192.168.1.111/API/RPC/SetValue","tls":"","persist":false,"proxy":"","insecureHTTPParser":false,"authType":"","senderr":false,"headers":[],"x":830,"y":140,"wires":[[]]},{"id":"49178dfe0afd26c5","type":"http request","z":"1cc49f1b109653d6","name":"GetValue","method":"POST","ret":"txt","paytoqs":"ignore","url":"https://RPC:RPC@gateway.comfortclick.com/UISample202309/API/RPC/GetValue","tls":"","persist":false,"proxy":"","insecureHTTPParser":false,"authType":"","senderr":false,"headers":[],"x":600,"y":160,"wires":[["6c1be3dfb18f1cde"]]},{"id":"6a6d132f16215ac1","type":"template","z":"1cc49f1b109653d6","name":"GetStatus","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"{\"objectName\":\"Devices\\\\KNX\\\\TW\\\\TriggerNumber\",\"valueName\":\"Value\"}","output":"str","x":400,"y":100,"wires":[["49178dfe0afd26c5"]]},{"id":"496a9552273593bf","type":"inject","z":"1cc49f1b109653d6","name":"Start","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":250,"y":100,"wires":[["6a6d132f16215ac1"]]},{"id":"51471e6727063907","type":"template","z":"1cc49f1b109653d6","name":"Scene1","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"{\"objectName\":\"Devices\\\\KNX\\\\TW\\\\Scene1\",\"functionName\":\"Run\",\"value\":[true]}","output":"str","x":420,"y":360,"wires":[["f7b929fd91854537"]]},{"id":"f7b929fd91854537","type":"http request","z":"1cc49f1b109653d6","name":"CallFunction","method":"POST","ret":"txt","paytoqs":"ignore","url":"https://RPC:RPC@gateway.comfortclick.com/UISample202309/API/RPC/CallFunction","tls":"","persist":false,"proxy":"","insecureHTTPParser":false,"authType":"","senderr":false,"headers":[],"x":610,"y":320,"wires":[["6c1be3dfb18f1cde"]]},{"id":"6719cc0c29682973","type":"inject","z":"1cc49f1b109653d6","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"true","payloadType":"bool","x":250,"y":360,"wires":[["51471e6727063907"]]},{"id":"99f0fb38ec88a0bc","type":"template","z":"1cc49f1b109653d6","name":"Scene2","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"{\"objectName\":\"Devices\\\\KNX\\\\TW\\\\Scene2\",\"functionName\":\"Run\",\"value\":[true]}","output":"str","x":420,"y":400,"wires":[["f7b929fd91854537"]]},{"id":"a43dddb527184c1b","type":"inject","z":"1cc49f1b109653d6","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"true","payloadType":"bool","x":250,"y":400,"wires":[["99f0fb38ec88a0bc"]]},{"id":"3d14406ef747ff8a","type":"comment","z":"1cc49f1b109653d6","name":"GetStatus","info":"","x":260,"y":60,"wires":[]},{"id":"56b918cc62cd6e30","type":"comment","z":"1cc49f1b109653d6","name":"Local URL","info":"","x":820,"y":100,"wires":[]}]

コメントを残す

メールアドレスが公開されることはありません。 が付いている欄は必須項目です