Automated Wyze Authentication (Tasker & Node-RED) #1116
DocBennett
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Every time the docker, wifi, power, or add-on being used for my single camera have some sort of interruption, it stops working and I have to redo the two-factor authorization code from a text message. Not wanting to manually update it I used Tasker on my phone to then MQTT the message to Node-RED, which can then pull out the code, format a command, then SSH to the server to update the mfa_token.txt file.
Requirements:
I do apologize - not sure how exactly to export Profiles and Tasks from Tasker, but it's simple enough.
The profile triggers with AutoNotification Intercept, watches for 'Wyze' (case in) and 'Get All Fields' is set.
That goes into the Task which is simply an MQTT Publish of
{"topic":"wyze","payload":"%antext"}
You could probably also strip out the number in tasker, but I'm better with JS.
After that is published, the Node-RED MQTT IN node hands off to a string node to chompLeft and chompRight, leaving only the 6 digit code. The function node after that concats the code with the command into the msg.payload:
msg.payload = "echo '" + msg.code + "' > /addon_configs/7094bb28_docker_wyze_bridge/wyze-bridge/mfa_token.txt > /dev/null 2>&1\n"; return msg;
Finally, the @insectos/ssh-exec node handles the SSH login and fires the command.
Let me know if you have any questions, improvements, suggestions, etc.!
wyze auto auth.json
Beta Was this translation helpful? Give feedback.
All reactions