At this point of course frankly this has nothing to do with an api call, but just trying to get the simplest output into domoticz.
Code: Select all
[{"id":"743a62898f598be4","type":"tab","label":"Flow 1","disabled":false,"info":"","env":[]},{"id":"aba1dab9e8709847","type":"http request","z":"743a62898f598be4","name":"Get Version","method":"GET","ret":"obj","paytoqs":"ignore","url":"https://10.0.0.199:8443/enduser-mobile-web/1/enduserAPI/apiVersion","tls":"d141c56ce52dcd5d","persist":false,"proxy":"","insecureHTTPParser":false,"authType":"bearer","senderr":false,"headers":[],"x":610,"y":120,"wires":[["d58a15c4c09ebd12","9c0b16ffc945e95a","8690d30946cad6ca"]]},{"id":"d58a15c4c09ebd12","type":"debug","z":"743a62898f598be4","name":"debug 1","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":900,"y":100,"wires":[]},{"id":"9c0b16ffc945e95a","type":"debug","z":"743a62898f598be4","name":"debug 2","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload.protocolVersion","targetType":"msg","statusVal":"","statusType":"auto","x":900,"y":160,"wires":[]},{"id":"1c61a2e3f17004cc","type":"inject","z":"743a62898f598be4","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":320,"y":120,"wires":[["aba1dab9e8709847"]]},{"id":"8690d30946cad6ca","type":"mqtt out","z":"743a62898f598be4","name":"","topic":"Tahoma","qos":"","retain":"","respTopic":"","contentType":"","userProps":"","correl":"","expiry":"","broker":"92e5b2c.00a8b5","x":920,"y":240,"wires":[]},{"id":"fc6d9990e9735efe","type":"http request","z":"743a62898f598be4","name":"Get Devices","method":"GET","ret":"obj","paytoqs":"ignore","url":"https://10.0.0.161:8443/enduser-mobile-web/1/enduserAPI/setup/devices","tls":"d141c56ce52dcd5d","persist":true,"proxy":"","insecureHTTPParser":false,"authType":"bearer","senderr":false,"headers":[],"x":430,"y":420,"wires":[["792793a85f7af9e3","0f5c255927c3a287"]]},{"id":"0d0b145a46d08eb6","type":"inject","z":"743a62898f598be4","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":220,"y":420,"wires":[["fc6d9990e9735efe"]]},{"id":"27bcb8ebe2e66553","type":"mqtt out","z":"743a62898f598be4","name":"","topic":"","qos":"","retain":"","respTopic":"","contentType":"","userProps":"","correl":"","expiry":"","broker":"92e5b2c.00a8b5","x":1350,"y":420,"wires":[]},{"id":"14b2125b610f82a3","type":"debug","z":"743a62898f598be4","name":"debug 8","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload.label","targetType":"msg","statusVal":"","statusType":"auto","x":700,"y":500,"wires":[]},{"id":"792793a85f7af9e3","type":"debug","z":"743a62898f598be4","name":"debug 9","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":480,"y":500,"wires":[]},{"id":"390f410fdeae6dec","type":"change","z":"743a62898f598be4","name":"","rules":[{"t":"set","p":"topic","pt":"msg","to":"\"domoticz/in/\"","tot":"jsonata"},{"t":"delete","p":"payload.creationTime","pt":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":900,"y":420,"wires":[["0d414e1eda85b389","164e4e3ca1fddfca","1f4ca39d34a2136f"]]},{"id":"0d414e1eda85b389","type":"debug","z":"743a62898f598be4","name":"debug 10","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"topic","targetType":"msg","statusVal":"","statusType":"auto","x":920,"y":500,"wires":[]},{"id":"0f5c255927c3a287","type":"split","z":"743a62898f598be4","name":"","splt":"\\n","spltType":"str","arraySplt":1,"arraySpltType":"len","stream":false,"addname":"","x":670,"y":420,"wires":[["14b2125b610f82a3","390f410fdeae6dec"]]},{"id":"164e4e3ca1fddfca","type":"function","z":"743a62898f598be4","name":"function 1","func":"//if(msg.payload.deviceURL === \"io://2017-8871-5701/3196925\")\n//{\n// return msg;\n//}\n\nif (msg.payload.deviceURL === \"io://2017-8871-5701/3196925\") \n {\n msg.payload = { \"idx\": 388, \"svalue\": \"test 1\" } \n // msg.topic = { \"domoticz/in\" }\n return msg;\n }\n\n\n//{ \"command\": \"udevice\", \"idx\" : 7, \"nvalue\" : 0, \"svalue\" : \"90;2975.00\" }\n//{ \"idx\" : 7, \"nvalue\" : 0, \"svalue\" : \"90;2975.00\" }\n\n","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1140,"y":420,"wires":[["27bcb8ebe2e66553","5569758a44d2d493"]]},{"id":"5569758a44d2d493","type":"debug","z":"743a62898f598be4","name":"debug 11","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1200,"y":500,"wires":[]},{"id":"1f4ca39d34a2136f","type":"debug","z":"743a62898f598be4","name":"debug 12","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1220,"y":320,"wires":[]},{"id":"da22f822bb4835c8","type":"inject","z":"743a62898f598be4","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":240,"y":640,"wires":[["887e1a675e7b7458"]]},{"id":"887e1a675e7b7458","type":"function","z":"743a62898f598be4","name":"function 1","func":"//if(msg.payload.deviceURL === \"io://2017-8871-5701/3196925\")\n//{\n// return msg;\n//}\n\n\n msg.payload = { \"idx\": 388, \"svalue\": \"Testing MQTT to Domoticz\" } \n return msg;\n\n//{ \"command\": \"udevice\", \"idx\" : 7, \"nvalue\" : 0, \"svalue\" : \"90;2975.00\" }\n//{ \"idx\" : 7, \"nvalue\" : 0, \"svalue\" : \"90;2975.00\" }\n\n","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":440,"y":640,"wires":[["f708f986c4e688fe","f5d9c199645c3960"]]},{"id":"f708f986c4e688fe","type":"mqtt out","z":"743a62898f598be4","name":"","topic":"domoticz/in","qos":"","retain":"","respTopic":"","contentType":"","userProps":"","correl":"","expiry":"","broker":"92e5b2c.00a8b5","x":670,"y":640,"wires":[]},{"id":"f5d9c199645c3960","type":"debug","z":"743a62898f598be4","name":"debug 13","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":700,"y":700,"wires":[]},{"id":"d141c56ce52dcd5d","type":"tls-config","name":"TLS","cert":"","key":"","ca":"","certname":"","keyname":"","caname":"","servername":"","verifyservercert":false,"alpnprotocol":""},{"id":"92e5b2c.00a8b5","type":"mqtt-broker","name":"MQTT (NAS)","broker":"10.0.0.4","port":"1883","clientid":"Node_Red_Client","autoConnect":true,"usetls":false,"compatmode":false,"protocolVersion":"4","keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthRetain":"false","birthPayload":"","birthMsg":{},"closeTopic":"","closeQos":"0","closeRetain":"false","closePayload":"","closeMsg":{},"willTopic":"","willQos":"0","willRetain":"false","willPayload":"","willMsg":{},"userProps":"","sessionExpiry":""}]
And this is working somehow.