I was able to flash TASMOTA on my NodeMCU and got it to switch on / off, 1 relay using both the TASMOTA UI and HA. Now, my Nodemcu is connected to a 4 channel relay. I assigned separate pins and could get those worked using the TASMOTA UI.
For the single relay, I wrote the following in configuration.yaml:
# switch switch: - platform: mqtt name: "Sonoff power" state_topic: "stat/sonoff/POWER" command_topic: "cmnd/sonoff/POWER" availability_topic: "tele/sonoff/LWT" qos: 1 payload_on: "ON" payload_off: "OFF" payload_available: "Online" payload_not_available: "Offline" retain: false
This worked well and comes up in my Home assistant as the screenshot below:
Now, I want 3 more switches to control 3 more relays. What should I be writing in the configuration.yaml?