Trying to find out how to fix this.
Code: Select all
[{"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","targetType":"msg","statusVal":"","statusType":"auto","x":740,"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":500,"y":500,"wires":[]},{"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":690,"y":420,"wires":[["14b2125b610f82a3","bfff67f1ca427a4b"]]},{"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/14384853\") \n {\n msg.payload = { \"idx\": 397, \"svalue\": Number(msg.payload.states[3].value)}\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":"bfff67f1ca427a4b","type":"change","z":"743a62898f598be4","name":"","rules":[{"t":"set","p":"topic","pt":"msg","to":"domoticz/in","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":920,"y":420,"wires":[["164e4e3ca1fddfca","0d414e1eda85b389"]]},{"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":""}]
edit: doh... I'm rather stupid... String() instead of Number() is working...