Flashing Sonoff Dual R3 v2 with ESPHome (RESOLVED)

I have been able to flash this device using the serial cable. It all looks fine, the device appears online, etc.

When I try to update the device over the air (OTA) (wirelessly in ESPhome terms), I get the error message: “ERROR Error auth result: Error: Authentication invalid. Is the password correct?

I need help. Did anyone come across this issue before?

And when I try to add the device to Home Assistant, I get the following message: “Can’t connect to ESP. Please make sure your YAML file contains an ‘api:’ line.”. The thing is I have an ‘api:’ line…

Answer to myself: I tried disabling BLE (ble_tracker) and Power Saving (power_save_mode), but nothing happened.

The device does not respond to port 80 or port 6053…

Did you originally flash this a while ago? Something similar is happening to me on devices I created a year+ ago. They had an API password, and apparently now there is a requirement to use an API key instead of a password. Not sure if it’s related to either of our issues though.

No, @depasseg I flashed this two days ago. Brand new device.

Answer to myself: I have been able to resolve the issue. The problem is that I was using the wrong power sensor. Mine is a Dual R3 V2 and it uses the BL0939 power sensor. When I applied the configuration for the correct power sensor, everything worked!

The power sensor configuration can be found at BL0939 Power Sensor — ESPHome.

The error message ESPhome was giving is misleading. I spent a lot of time trying to figure out why the authentication error was happening and in the end it had nothing to do with authentication.

Hey, can I ask which guide you used to flash the R3 with ESP Home? Struggling to find anything recent