So z.B.

| [ |
| { |
| "id": "e4524f82656cd957", |
| "type": "tab", |
| "label": "Flow 2", |
| "disabled": false, |
| "info": "", |
| "env": [] |
| }, |
| { |
| "id": "ac1e2c56d66e6954", |
| "type": "http in", |
| "z": "e4524f82656cd957", |
| "name": "ioBroker State Change", |
| "url": "/ioBroker/stateChange", |
| "method": "post", |
| "upload": false, |
| "swaggerDoc": "", |
| "x": 220, |
| "y": 120, |
| "wires": [ |
| [ |
| "1d7f4181f4024d03", |
| "b59cdb052b959c5e" |
| ] |
| ] |
| }, |
| { |
| "id": "a3320f282da607bf", |
| "type": "inject", |
| "z": "e4524f82656cd957", |
| "name": "Register for state changes", |
| "props": [ |
| { |
| "p": "payload" |
| } |
| ], |
| "repeat": "", |
| "crontab": "", |
| "once": true, |
| "onceDelay": 0.1, |
| "topic": "", |
| "payload": "", |
| "payloadType": "date", |
| "x": 240, |
| "y": 60, |
| "wires": [ |
| [ |
| "2438b2516da0d404" |
| ] |
| ] |
| }, |
| { |
| "id": "18d235b5987d73d7", |
| "type": "http request", |
| "z": "e4524f82656cd957", |
| "name": "ioBroker Subscribe", |
| "method": "POST", |
| "ret": "txt", |
| "paytoqs": "ignore", |
| "url": "", |
| "tls": "", |
| "persist": false, |
| "proxy": "", |
| "insecureHTTPParser": false, |
| "authType": "", |
| "senderr": false, |
| "headers": [], |
| "x": 770, |
| "y": 60, |
| "wires": [ |
| [ |
| "3558d8854fd87800" |
| ] |
| ] |
| }, |
| { |
| "id": "2438b2516da0d404", |
| "type": "function", |
| "z": "e4524f82656cd957", |
| "name": "Set url and payload", |
| "func": "const nodeRedIp = '10.10.9.27:1880';\nconst ioBrokerIp = '10.10.2.51';\n\nconst stateId = '0_userdata.0.test';\n\nmsg.url = `http://${ioBrokerIp}:8082/rest-api/v1/state/${stateId}/subscribe`;\nmsg.payload = {\n url: `http://${nodeRedIp}/ioBroker/stateChange`\n};\n\nreturn msg;", |
| "outputs": 1, |
| "timeout": 0, |
| "noerr": 0, |
| "initialize": "", |
| "finalize": "", |
| "libs": [], |
| "x": 530, |
| "y": 60, |
| "wires": [ |
| [ |
| "18d235b5987d73d7" |
| ] |
| ] |
| }, |
| { |
| "id": "3558d8854fd87800", |
| "type": "debug", |
| "z": "e4524f82656cd957", |
| "name": "debug 3", |
| "active": false, |
| "tosidebar": true, |
| "console": false, |
| "tostatus": false, |
| "complete": "true", |
| "targetType": "full", |
| "statusVal": "", |
| "statusType": "auto", |
| "x": 980, |
| "y": 60, |
| "wires": [] |
| }, |
| { |
| "id": "1d7f4181f4024d03", |
| "type": "http response", |
| "z": "e4524f82656cd957", |
| "name": "", |
| "statusCode": "", |
| "headers": {}, |
| "x": 450, |
| "y": 160, |
| "wires": [] |
| }, |
| { |
| "id": "b59cdb052b959c5e", |
| "type": "switch", |
| "z": "e4524f82656cd957", |
| "name": "Just a test?", |
| "property": "payload.test", |
| "propertyType": "msg", |
| "rules": [ |
| { |
| "t": "true" |
| }, |
| { |
| "t": "else" |
| } |
| ], |
| "checkall": "false", |
| "repair": false, |
| "outputs": 2, |
| "x": 470, |
| "y": 120, |
| "wires": [ |
| [], |
| [ |
| "375c837e9615b225" |
| ] |
| ] |
| }, |
| { |
| "id": "375c837e9615b225", |
| "type": "debug", |
| "z": "e4524f82656cd957", |
| "name": "debug 4", |
| "active": true, |
| "tosidebar": true, |
| "console": false, |
| "tostatus": false, |
| "complete": "payload", |
| "targetType": "msg", |
| "statusVal": "", |
| "statusType": "auto", |
| "x": 680, |
| "y": 120, |
| "wires": [] |
| } |
| ] |
- Erfordert im ioBroker die rest-api
- In diesem Beispiel ist die rest-api als web-Extension konfiguriert (ansonsten url anpassen)