Sonoff pow R2 config

I installed home assistant 0.98.4 on raspberrypi 2. I configured the mqtt service in the raspberry pi and then I configured the configuration.yaml file.
It’s the config of the mqtt:

  username: or94

  discovery: true
  discovery_prefix: homeassistant

I configured shelly switch and yeelight in the same file and everthing works great. Yesterday I flashed tasmota for the sonoff pow R2 switch. I configured the mqtt service in the web interface:

I enabled the mqtt in the configure other option in the sonoff web inteface and I wrote friendly name.
Then I tried to config the sonoff in the configuration.yaml:

- platform: mqtt
  name: Boiler
  state_topic: "stat/sonoff/POWER"
  command_topic: "cmnd/sonoff/POWER"
  qos: 1
  payload_on: "ON"
  payload_off: "OFF"
  retain: true

After I saved the configuration.yaml file I got an error in the home assistant:
ERROR (MainThread) [homeassistant.components.homeassistant] Component error: boiler - Integration boiler not found.

What I am doing wrong?

you should have

  - platform: mqtt


  - platform: mqtt

Ok I changed it. Now there are no errors but I don’t have a switch in the ui. where is the problem? in the mqtt config of the sonoff?

Did you establish a MQTT broker? How did you set it up?

You need a broker, and you need to connect HA and the sonoff to the broker.

I established a MQTT broker. I set it up with this video:
I connected the HA to the broker in the configuration.yaml file and then I connected the sonoff to the broker in the web interface of the sonoff. I have a shelly switch that working with mqtt and everthing is ok. the sonoff doesn’t work

someone can help me?

Check tasmota concole see of MQTT connected and sending data

Did you enable SetOption19?

I checked tasmota console and it connected and sending data. What is SetOption19 and how I enable it?

It enables automatic discovery for HA, in Tasmota console write SetOption19 1:

Ok it worked. Now I have another problem: In the home assitant UI i see the switch that I config in the configuration.yaml and I can switch it on and off but in addition i see another switch that called Sonoff that is not available for switching. How can I remove the Sonoff that not available?

Remove it from configuration.yaml… You turned on MQTT discovery hence the duplication.

What to remove from configuration.yaml? All the code of the switch? But it’s working. I want to remove just the switch that unavailable.

No I think youll find the discovery one is the one that’s working.

Thank you it works great. I have another question: I have shelly switch and I have the sonoff switch. I want to add an option for my home assistant to update the firmware of the switches. Is there an option to do so in home assistant? How can I do it?


Can you please tell how did you flashed the POW R2? Tried with SonOTA but stuck at “FinalStage”


I used this video to flash tasmota on the POW R2:

SonOTA didn’t work for me