Although this write-up is based on a Sonoff S20 with a 'device_name' of 'node53', it should be applicable to any device flashed with Tasmota firmware. It covers how to set the various networking credentials.
The other day, after flashing a Sonoff, I couldn't find a menu item that would allow me to give the device a fixed IP address. Although I could have used the 'console' (see image below) and entered commands there - I created this flow to see if I could do it by sending the appropriate commands using MQTT.
I've documented the flow as a guide to the entries you need to change to match your set-up.
You may need to Restart/Reboot the device (using Inject node 4) for some of the changes to take effect.
I hope someone finds it useful.
Note: You can click the above image for a larger view of my flow.
[{"id":"6db908984d140b37","type":"tab","label":"Sonoff credential setter","disabled":false,"info":"","env":[]},{"id":"79db74a165994e8a","type":"inject","z":"6db908984d140b37","name":"3. Change IP address to this... ","props":[{"p":"payload"},{"p":"action","v":"ip","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":"","topic":"","payload":"192.168.1.53","payloadType":"str","x":230,"y":440,"wires":[["3229adc5912f3d16"]]},{"id":"0cb10798a2478d28","type":"mqtt in","z":"6db908984d140b37","name":"","topic":"","qos":"0","datatype":"json","broker":"b80c36f2.044588","nl":false,"rap":false,"inputs":1,"x":930,"y":220,"wires":[["343fa633e3e25a93"]]},{"id":"343fa633e3e25a93","type":"debug","z":"6db908984d140b37","name":"","active":true,"console":"false","complete":"false","x":1150,"y":260,"wires":[]},{"id":"b6b4a939eb2053f3","type":"inject","z":"6db908984d140b37","name":"2. Get Sonoff network details","props":[{"p":"payload"},{"p":"action","v":"details","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":"","topic":"","payload":"5","payloadType":"num","x":220,"y":360,"wires":[["3229adc5912f3d16"]]},{"id":"7f952f64ed080951","type":"inject","z":"6db908984d140b37","name":"4. Restart / Reboot Sonoff device","props":[{"p":"payload"},{"p":"action","v":"restart","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":"","topic":"","payload":"1","payloadType":"num","x":230,"y":680,"wires":[["3229adc5912f3d16"]]},{"id":"f38fb06d4bc6147a","type":"inject","z":"6db908984d140b37","name":"3, Change DNS2 address to this... ","props":[{"p":"payload"},{"p":"action","v":"dns2","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":"","topic":"","payload":"64.6.64.6","payloadType":"str","x":240,"y":600,"wires":[["3229adc5912f3d16"]]},{"id":"c9418ed405864c9e","type":"mqtt out","z":"6db908984d140b37","name":"","topic":"","qos":"0","retain":"","respTopic":"","contentType":"","userProps":"","correl":"","expiry":"","broker":"b80c36f2.044588","x":690,"y":520,"wires":[]},{"id":"226c75f2b63eddc5","type":"inject","z":"6db908984d140b37","name":"3. Change GATEWAY address to this... ","props":[{"p":"payload"},{"p":"action","v":"gateway","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":"","topic":"","payload":"192.168.1.1","payloadType":"str","x":250,"y":480,"wires":[["3229adc5912f3d16"]]},{"id":"f863b67e775c4539","type":"inject","z":"6db908984d140b37","name":"3. Change SUBNET address to this... ","props":[{"p":"payload"},{"p":"action","v":"subnet","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":"","topic":"","payload":"255.255.255.0","payloadType":"str","x":250,"y":520,"wires":[["3229adc5912f3d16"]]},{"id":"cffad4215bbd6148","type":"inject","z":"6db908984d140b37","name":"3. Change DNS1 address to this... ","props":[{"p":"payload"},{"p":"action","v":"dns1","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":"","topic":"","payload":"192.168.1.1","payloadType":"str","x":240,"y":560,"wires":[["3229adc5912f3d16"]]},{"id":"c08a72fa3d2512f4","type":"inject","z":"6db908984d140b37","name":"1. Set Sonoff device name","props":[{"p":"payload"}],"repeat":"","crontab":"","once":true,"onceDelay":"","topic":"","payload":"node53","payloadType":"str","x":220,"y":260,"wires":[["e6aa98934b577758"]]},{"id":"e6aa98934b577758","type":"change","z":"6db908984d140b37","name":"","rules":[{"t":"set","p":"deviceName","pt":"flow","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":480,"y":260,"wires":[["23c445f8657ff463","815119150a62ed1c"]]},{"id":"3229adc5912f3d16","type":"function","z":"6db908984d140b37","name":"","func":"let deviceName = flow.get(\"deviceName\");\n\nif (msg.action == \"details\") {\n msg.topic = \"cmnd/\"+deviceName+\"/STATUS\";\n}\nelse if (msg.action == \"ip\") {\n msg.topic = \"cmnd/\"+deviceName+\"/IPAddress1\";\n}\nelse if (msg.action == \"gateway\") {\n msg.topic = \"cmnd/\"+deviceName+\"/IPAddress2\";\n}\nelse if (msg.action == \"subnet\") {\n msg.topic = \"cmnd/\"+deviceName+\"/IPAddress3\";\n}\nelse if (msg.action == \"dns1\") {\n msg.topic = \"cmnd/\"+deviceName+\"/IPAddress4\";\n}\nelse if (msg.action == \"dns2\") {\n msg.topic = \"cmnd/\"+deviceName+\"/IPAddress5\";\n}\nelse if (msg.action == \"restart\") {\n msg.topic = \"cmnd/\"+deviceName+\"/RESTART\";\n}\n\ndelete msg.action;\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":540,"y":520,"wires":[["34c25d73ab5f74e6","c9418ed405864c9e"]]},{"id":"34c25d73ab5f74e6","type":"debug","z":"6db908984d140b37","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":690,"y":580,"wires":[]},{"id":"5eb3243e0c7c40c6","type":"comment","z":"6db908984d140b37","name":"A simple flow to manage a Sonoff's credentials after flashing it with Tasmota firmware","info":"","x":340,"y":40,"wires":[]},{"id":"202c7c5485377d42","type":"comment","z":"6db908984d140b37","name":"Use Inject 1. to set the Sonoff 'device name' e.g. node53","info":"","x":290,"y":80,"wires":[]},{"id":"542a94179faa1371","type":"comment","z":"6db908984d140b37","name":"Use Inject 2. to get current network details for the Sonoff device","info":"","x":310,"y":120,"wires":[]},{"id":"913c814d5401a770","type":"comment","z":"6db908984d140b37","name":"Use Inject 3. nodes to set appropriate credentials for your Sonoff device","info":"","x":340,"y":160,"wires":[]},{"id":"b4630c3b5c6d637a","type":"comment","z":"6db908984d140b37","name":"Use Inject 4. node to Restart/Reboot your Sonoff device","info":"","x":290,"y":200,"wires":[]},{"id":"23c445f8657ff463","type":"function","z":"6db908984d140b37","name":"Subscribe to .../STATUS5","func":"let deviceName = flow.get(\"deviceName\");\nmsg.topic = \"stat/\"+deviceName+\"/STATUS5\";\nmsg.action =\"subscribe\";\n\ndelete msg.payload;\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":730,"y":220,"wires":[["0cb10798a2478d28"]]},{"id":"5359720c6ac661f5","type":"comment","z":"6db908984d140b37","name":"Last modified by DjD on 9th May 2022","info":"","x":870,"y":40,"wires":[]},{"id":"b8549cb048eafb3a","type":"mqtt in","z":"6db908984d140b37","name":"","topic":"","qos":"0","datatype":"json","broker":"b80c36f2.044588","nl":false,"rap":false,"inputs":1,"x":930,"y":300,"wires":[["343fa633e3e25a93"]]},{"id":"815119150a62ed1c","type":"function","z":"6db908984d140b37","name":"Subscribe to .../RESULT","func":"let deviceName = flow.get(\"deviceName\");\nmsg.topic = \"stat/\"+deviceName+\"/RESULT\";\nmsg.action =\"subscribe\";\n\ndelete msg.payload;\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":730,"y":300,"wires":[["b8549cb048eafb3a"]]},{"id":"b80c36f2.044588","type":"mqtt-broker","name":"Broker_156","broker":"192.168.1.156","port":"1883","clientid":"","autoConnect":true,"usetls":false,"protocolVersion":"4","keepalive":"120","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","birthMsg":{},"closeTopic":"","closePayload":"","closeMsg":{},"willTopic":"","willQos":"0","willPayload":"","willMsg":{},"sessionExpiry":""}]