Holiday Mode (Voice Spoofing and Laser Attack prevention)
Prevent Laser Hacking or Voice Injection attacks with this simple flow. You can also use it as a parental control measure or a holiday mode to deactivate certain actions.
Features:
- Stop voice control from execution
- trigger 2FA authentication
- password protection-
Requirements:
More about me:
If you want to get the latest updates to this project you can follow me via your preferred social media:
And if you feeling like buying me a coffee or supporting me in a more continuous way:
I hope you have enjoyed the project!
[{"id":"531846e7.f7d648","type":"tab","label":"Holiday Mode","disabled":false,"info":"\nPrevent Laser Hacking or Voice Injection attacks with this simple flow. You can also use it as a parental control measure or a holiday mode to deactivate certain actions.\n\n [Complete instructions](https://notenoughtech.com/home-automation/smart-speakers-vs-lasers-voice-injection-hacking/)\n\n\n**Features**:\n- Stop voice control from execution\n- trigger [2FA authentication](https://notenoughtech.com/home-automation/nodered-home-automation/two-factor-authentication-in-nodered/)\n- password protection- \n\n## Requirements:\n\n - [node-red-contrib-crypto-js](https://flows.nodered.org/node/node-red-contrib-crypto-js) \n - [IFTTT account](https://ifttt.com/)"},{"id":"3b800dab.e6f592","type":"switch","z":"531846e7.f7d648","name":"Holiday Mode","property":"holiday","propertyType":"global","rules":[{"t":"false"}],"checkall":"true","repair":false,"outputs":1,"x":380,"y":120,"wires":[["1e962d16.1dac03"]]},{"id":"2e43e56f.19ca2a","type":"function","z":"531846e7.f7d648","name":"Set Holiday mode","func":"global.set(\"holiday\", msg.payload.holiday);\nreturn msg;","outputs":1,"noerr":0,"x":630,"y":300,"wires":[[]]},{"id":"dbc2897e.0aa7b8","type":"inject","z":"531846e7.f7d648","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":180,"y":120,"wires":[["3b800dab.e6f592"]]},{"id":"1e962d16.1dac03","type":"debug","z":"531846e7.f7d648","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":670,"y":120,"wires":[]},{"id":"14061bbd.772204","type":"http in","z":"531846e7.f7d648","name":"","url":"/holiday","method":"post","upload":false,"swaggerDoc":"","x":170,"y":300,"wires":[["508e9dc3.f26ca4","2e43e56f.19ca2a"]]},{"id":"d0d2a220.e9234","type":"function","z":"531846e7.f7d648","name":"Pass check","func":"var count;\nvar attempts = 5; //flow.get(\"attmepts\");\nvar pass = msg.payload;\nvar currentpass = msg.pass;\n\ncount = flow.get(\"count\");\n\nvar x = isNaN(count);\n\nif(x === true){\n flow.set(\"count\", 0);\n}\n\nif(count < attempts){\n if(currentpass === pass){\n global.set(\"holiday\", false);\n flow.set(\"count\", 0);\n msg.payload = \"Holiday Mode disabled\";\n return [msg, null];\n \n }\n if(currentpass !== pass){\n count = count + 1;\n flow.set(\"count\", count);\n msg.payload = \"Wrong password try again you have \" + (attempts - count+1) + \" left\";\n return [msg, null];\n \n }\n}\n\nif(count => attempts){\n msg.payload = \"Wrong password entered too many times\";\n return [null, msg];\n}\n\nreturn msg;","outputs":2,"noerr":0,"x":1150,"y":500,"wires":[["6f174361.fde03c"],["89e2be2a.e48b4"]]},{"id":"ec53ae69.a950c","type":"inject","z":"531846e7.f7d648","name":"Correct Pass","topic":"","payload":"1234","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":210,"y":500,"wires":[["9353e904.815018"]]},{"id":"2e2857cd.25adc8","type":"inject","z":"531846e7.f7d648","name":"","topic":"","payload":"1234","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":1070,"y":120,"wires":[["86935e76.ce461"]]},{"id":"5cc3aed8.3ef6a","type":"function","z":"531846e7.f7d648","name":"Store password","func":"flow.set(\"password\", msg.payload);\nreturn msg;","outputs":1,"noerr":0,"x":1440,"y":120,"wires":[[]]},{"id":"86935e76.ce461","type":"encrypt","z":"531846e7.f7d648","name":"","algorithm":"AES","key":"pajonk","x":1240,"y":120,"wires":[["5cc3aed8.3ef6a"]]},{"id":"3b3b4fe4.0f54d","type":"inject","z":"531846e7.f7d648","name":"Wrong Pass","topic":"","payload":"13241","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":210,"y":460,"wires":[["9353e904.815018"]]},{"id":"6f174361.fde03c","type":"debug","z":"531846e7.f7d648","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":1330,"y":480,"wires":[]},{"id":"89e2be2a.e48b4","type":"debug","z":"531846e7.f7d648","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":1330,"y":520,"wires":[]},{"id":"36de1e3e.81a232","type":"function","z":"531846e7.f7d648","name":"Get Password Hash","func":"msg.payload = flow.get(\"password\");\nreturn msg;","outputs":1,"noerr":0,"x":760,"y":500,"wires":[["a2d3f11c.2852a"]]},{"id":"a2d3f11c.2852a","type":"decrypt","z":"531846e7.f7d648","name":"","algorithm":"AES","key":"pajonk","x":960,"y":500,"wires":[["d0d2a220.e9234"]]},{"id":"9353e904.815018","type":"function","z":"531846e7.f7d648","name":"Assign Passowrd attempt","func":"msg.pass = msg.payload.pass;\nreturn msg;","outputs":1,"noerr":0,"x":510,"y":500,"wires":[["36de1e3e.81a232"]]},{"id":"a47ebdce.2a6fd","type":"inject","z":"531846e7.f7d648","name":"","topic":"","payload":"true","payloadType":"bool","repeat":"3600","crontab":"","once":false,"onceDelay":0.1,"x":1070,"y":220,"wires":[["931d91d3.b5b3a"]]},{"id":"931d91d3.b5b3a","type":"function","z":"531846e7.f7d648","name":"Count reset","func":"flow.set(\"count\", 0);\nreturn msg;","outputs":1,"noerr":0,"x":1270,"y":220,"wires":[[]]},{"id":"508e9dc3.f26ca4","type":"http response","z":"531846e7.f7d648","name":"","statusCode":"","headers":{},"x":370,"y":320,"wires":[]},{"id":"8ffaa6a1.3488b8","type":"mqtt out","z":"531846e7.f7d648","name":"Control Test Light","topic":"zigbee2mqtt/sonoffZigbee1/set","qos":"","retain":"","broker":"eca6af44.5297b","x":910,"y":700,"wires":[]},{"id":"ab4893f7.83ca7","type":"mqtt in","z":"531846e7.f7d648","name":"Google Voice Action [Test Light]","topic":"gBridge/u2491/testlight/set","qos":"2","datatype":"json","broker":"c4b43ba4.186ae8","x":230,"y":700,"wires":[["bd49407d.d01ab"]]},{"id":"4e1cb6dd.097e48","type":"change","z":"531846e7.f7d648","name":"","rules":[{"t":"change","p":"payload","pt":"msg","from":"0","fromt":"num","to":"{\"state\":\"OFF\"}","tot":"json"},{"t":"change","p":"payload","pt":"msg","from":"1","fromt":"num","to":"{\"state\":\"ON\"}","tot":"json"}],"action":"","property":"","from":"","to":"","reg":false,"x":680,"y":700,"wires":[["8ffaa6a1.3488b8"]]},{"id":"bd49407d.d01ab","type":"switch","z":"531846e7.f7d648","name":"Holiday Mode","property":"holiday","propertyType":"global","rules":[{"t":"false"}],"checkall":"true","repair":false,"outputs":1,"x":480,"y":700,"wires":[["4e1cb6dd.097e48"]]},{"id":"af7b7e9e.02157","type":"http in","z":"531846e7.f7d648","name":"","url":"/holiday/password","method":"post","upload":false,"swaggerDoc":"","x":200,"y":360,"wires":[["9353e904.815018","508e9dc3.f26ca4"]]},{"id":"e076256.22214d8","type":"comment","z":"531846e7.f7d648","name":"Holiday Mode Example","info":"","x":300,"y":80,"wires":[]},{"id":"55459d3.01d2164","type":"comment","z":"531846e7.f7d648","name":"Holiday Mode - gBridge","info":"","x":200,"y":640,"wires":[]},{"id":"3e0e4feb.45e5b","type":"comment","z":"531846e7.f7d648","name":"Password processing","info":"","x":200,"y":240,"wires":[]},{"id":"609dfbc3.423004","type":"comment","z":"531846e7.f7d648","name":"Set Password","info":"","x":1150,"y":80,"wires":[]},{"id":"a5ba8ebe.3a3c7","type":"comment","z":"531846e7.f7d648","name":"Reset Password Attempts every 1h","info":"","x":1220,"y":180,"wires":[]},{"id":"eca6af44.5297b","type":"mqtt-broker","z":"","name":"MQTT","broker":"dockerpi.local","port":"1883","clientid":"","usetls":false,"compatmode":true,"keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","closeTopic":"","closeQos":"0","closePayload":"","willTopic":"","willQos":"0","willPayload":""},{"id":"c4b43ba4.186ae8","type":"mqtt-broker","z":"","name":"Gbridge","broker":"mqtt.gbridge.io","port":"8883","tls":"47c99f2f.8b1c1","clientid":"","usetls":true,"compatmode":true,"keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","closeTopic":"","closeQos":"0","closePayload":"","willTopic":"","willQos":"0","willPayload":""},{"id":"47c99f2f.8b1c1","type":"tls-config","z":"","name":"TLS Gbridge","cert":"","key":"","ca":"","certname":"","keyname":"","caname":"","servername":"mqtt.gbridge.io","verifyservercert":true}]