Get status data from Speedport Smart 4
Description
This flow was created to be able to access the status data from Speedport Smart 4 router. It uses the http:///data/Status.json as the source after which it decodes and decrypts the file to get stored JSON array with parameters and values. Decoding was reverse engineering of the solution found at https://github.com/aaronk6/dsl-monitoring/blob/main/smart4-vdsl by aaronk6, so all the credit and thanks go to him. This flow requires NodeJS Crypto module, so be sure to install it beforehand.
[{"id":"5e2250833ee3fc42","type":"function","z":"6ad12bcd22d548d0","name":"Decrypt JSON","func":"var crypto = context.global.get('crypto')\n\nconst keyHex = 'cdc0cac1280b516e674f0057e4929bca84447cca8425007e33a88a5cf598a190';\nconst key = Buffer.from(keyHex, 'hex');\nconst nonce = key.subarray(0, 8);\n\nconst ciphertextTag = Buffer.from(msg.payload, 'hex');\nconst ciphertext = ciphertextTag.subarray(0, ciphertextTag.length - 16)\nconst tag = ciphertextTag.subarray(ciphertextTag.length - 16)\n\nconst decipher = crypto.createDecipheriv('aes-256-ccm', key, nonce, {\n authTagLength: 16,\n});\ndecipher.setAuthTag(tag);\n//\nconst receivedPlaintext = decipher.update(ciphertext, null, 'utf8');\n\ndecipher.final();\n\nmsg.payload = receivedPlaintext;\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":960,"y":880,"wires":[["0df211401cc63514"]]}]