[ { "id": "pg-tab", "type": "tab", "label": "Power Genius", "disabled": false, "info": "Example flow for node-red-contrib-power-genius.\n\nSet the host of the **power genius** server node to the address of your PowerGenius XL, deploy, and watch the debug sidebar." }, { "id": "pg-server", "type": "power-genius-server", "host": "192.168.1.100", "port": 9008, "autoConnect": true, "pollInterval": 1000 }, { "id": "pg-comment-setup", "type": "comment", "z": "pg-tab", "name": "Setup: edit the power genius server node (host), then deploy", "info": "Double click any Power Genius node, then the pencil next to Server, and enter the host name or IP address of the amplifier. The API port is 9008.", "x": 280, "y": 40, "wires": [] }, { "id": "pg-comment-monitor", "type": "comment", "z": "pg-tab", "name": "Monitor: the whole status, and one property", "info": "The first status node emits the whole status as an object. Use it to find out which properties your amplifier reports, then add one status node per property you care about.", "x": 220, "y": 100, "wires": [] }, { "id": "pg-status-all", "type": "power-genius-status", "z": "pg-tab", "name": "", "server": "pg-server", "property": "*", "onlyChange": true, "deadband": 0, "startDelay": 1000, "x": 150, "y": 160, "wires": [["pg-debug-status"]] }, { "id": "pg-debug-status", "type": "debug", "z": "pg-tab", "name": "status", "active": true, "tosidebar": true, "console": false, "tostatus": false, "complete": "payload", "targetType": "msg", "x": 400, "y": 160, "wires": [] }, { "id": "pg-status-state", "type": "power-genius-status", "z": "pg-tab", "name": "", "server": "pg-server", "property": "state", "onlyChange": true, "deadband": 0, "startDelay": 1000, "x": 150, "y": 220, "wires": [["pg-debug-state"]] }, { "id": "pg-debug-state", "type": "debug", "z": "pg-tab", "name": "state", "active": true, "tosidebar": true, "console": false, "tostatus": true, "complete": "payload", "targetType": "msg", "statusVal": "payload", "statusType": "auto", "x": 400, "y": 220, "wires": [] }, { "id": "pg-comment-info", "type": "comment", "z": "pg-tab", "name": "Info: setup and interface configuration", "info": "Emits the device info after connecting. Click the inject button to read it again.", "x": 210, "y": 280, "wires": [] }, { "id": "pg-inject-info", "type": "inject", "z": "pg-tab", "name": "read info", "props": [{ "p": "payload" }], "repeat": "", "crontab": "", "once": false, "onceDelay": 0.1, "topic": "", "payload": "", "payloadType": "date", "x": 120, "y": 340, "wires": [["pg-info"]] }, { "id": "pg-info", "type": "power-genius-info", "z": "pg-tab", "name": "", "server": "pg-server", "property": "*", "startDelay": 1000, "x": 280, "y": 340, "wires": [["pg-debug-info"]] }, { "id": "pg-debug-info", "type": "debug", "z": "pg-tab", "name": "info", "active": true, "tosidebar": true, "console": false, "tostatus": false, "complete": "payload", "targetType": "msg", "x": 450, "y": 340, "wires": [] }, { "id": "pg-comment-control", "type": "comment", "z": "pg-tab", "name": "Control: operate / standby, or any command", "info": "The control node takes its action from msg.topic. With topic 'operate' the payload is true/false (or 1/0, on/off) and 'operate=<0|1>' is sent. With topic 'command' the payload is sent as the command, for example 'setup read' or 'ping', and the reply is output. Watch the state property of the status node change between STANDBY and IDLE.", "x": 190, "y": 400, "wires": [] }, { "id": "pg-inject-operate", "type": "inject", "z": "pg-tab", "name": "operate", "props": [{ "p": "payload" }, { "p": "topic", "vt": "str" }], "repeat": "", "crontab": "", "once": false, "onceDelay": 0.1, "topic": "operate", "payload": "true", "payloadType": "bool", "x": 120, "y": 460, "wires": [["pg-control"]] }, { "id": "pg-inject-standby", "type": "inject", "z": "pg-tab", "name": "standby", "props": [{ "p": "payload" }, { "p": "topic", "vt": "str" }], "repeat": "", "crontab": "", "once": false, "onceDelay": 0.1, "topic": "operate", "payload": "false", "payloadType": "bool", "x": 120, "y": 520, "wires": [["pg-control"]] }, { "id": "pg-inject-command", "type": "inject", "z": "pg-tab", "name": "setup read", "props": [{ "p": "payload" }, { "p": "topic", "vt": "str" }], "repeat": "", "crontab": "", "once": false, "onceDelay": 0.1, "topic": "command", "payload": "setup read", "payloadType": "str", "x": 130, "y": 580, "wires": [["pg-control"]] }, { "id": "pg-control", "type": "power-genius-control", "z": "pg-tab", "name": "", "server": "pg-server", "action": "", "x": 300, "y": 520, "wires": [["pg-debug-reply"]] }, { "id": "pg-debug-reply", "type": "debug", "z": "pg-tab", "name": "reply", "active": true, "tosidebar": true, "console": false, "tostatus": false, "complete": "payload", "targetType": "msg", "x": 470, "y": 520, "wires": [] } ]