Missing Sonoff Switch from Main Page

Hi guys, hopefully you can help. Last night I set up HA on my Pi and had everything working (just one sonoff POW). Turned it off whilst I went out and when I came back and booted it back up the switch control was missing off the main page. I tried going through the tutorials but nothing would work, so in desperation I installed everything clean but still the switch is not showing up! The sonoff is connected to HA looking at the console info but I’m at a loss.

This is in my configuration.yaml

mqtt:
broker: 192.168.1.85
port: 1883
client_id: home-assistant-1

switch:
platform: mqtt
name: “Sonoff1”
command_topic: “cmnd/sonoff/POWER”
state_topic: “stat/sonoff/POWER”
qos: 1
payload_on: “ON”
payload_off: “OFF”
retain: true

worked fine yesterday the first time so not sure what I could have done differently.

If you need any further info, I’ll add it in. I installed mosquitto mqtt.

Thanks

Just realised I missed the username and password in the mqtt but its there. Still not working.

oh my god typical! Posted this and I’ve fixed it, but not sure if it was the fix.

There was an error on the password with a blank space. That made it appear on the screen and not work. I deleted the client id from the sonoff and the configuration.yaml and it works!