I lose half of my devices and names when I restart HA (Sonoff)

I have a bunch of sonoff devices. I’m using 2022.3.6 because the update after this breaks everything.

Just trying to keep status quo and it’s exceptionally difficult.

I have a virtualbox with home assistant. Works great when I roll back and launch. All my entities are there are working. My sonoffo integration is using Sonoff LAN (from HACS) and this configuration:

# Unflashed SONOFF devices
sonoff:
  username: [email protected]
  password: hack8r8r2022
  reload: always
  sensors: [power, current, voltage, rssi]

sensor:
- platform: integration
  source: sensor.sonoff_10015da61a_power
  name:  "Livingroom TV Usage"
  unit_prefix: k
  unit: kWh
  round: 2
- platform: integration
  source: sensor.sonoff_10015d9366_power
  name:  "Diningroom Music Usage"
  unit_prefix: k
  unit: kWh
  round: 2
- platform: integration
  source: sensor.sonoff_10015d9359_power
  name:  "Dishwasher Usage"
  unit_prefix: k
  unit: kWh
  round: 2
- platform: integration
  source: sensor.sonoff_10015da4c9_power
  name:  "Server Usage"
  unit_prefix: k
  unit: kWh
  round: 2
- platform: integration
  source: sensor.sonoff_100153b062_power
  name:  "Chest Freezer Usage"
  unit_prefix: k
  unit: kWh
  round: 2
- platform: integration
  source: sensor.sonoff_100153b36a_power
  name:  "Washing Machine Usage"
  unit_prefix: k
  unit: kWh
  round: 2

When I reboot, I lose all their names, and I lose any dashboard items referencing Power.

I can roll back, launch, everything works until first reboot.

What is going on ?

I was about to ask about the status of Option 19 on your devices, however this only applies to Sonoff devices running Tasmota, and the comment in your post suggests you are running Sonoff hardware with Sonoff stock firmware. Is that correct please?

For Tasmota firmware, Set Option 19 1 means a device appears in the MQTT integration, but with Set Option 19 0 a device appears via the dedicated Tasmota integration which includes additional state_class: config needed for energy.

Sadly, I’ve never run Sonoff firmware even once so can’t help - Tasmota is on all of my many ESP* devices.

James

This is stock firmware, working with the Sonoff LAN (https://github.com/AlexxIT/SonoffLAN)

The issue is strange. After I roll back my virtual box, all my devices and entities work flawlessly- for DAYS- unless I reboot once.

After reboot, the devices lose their names and say status “Restored” next to them.

That it happens on boot does suggest a discovery issue in the eWeLink binding - guess the code for state_class: initialisation might be new and a GitHub Issue might help debug it?

Flashing everything to Tasmota ESPhome doesn’t seem a good workaround - likely to get you a fresh set of issues to look at!

So, for some reason the snapshot I took had a function authentication token saved in memory- but when I reboot it tried to re-initialize with the saved username and password. And apparently ewelink forced a password reset on my account which I discovered trying to launch the app on my phone.

Fixing the password “fixes” some of the entities but in order to get my names back, I had to do one more restore back to the restore point that works, update passwords, and then reboot. Problem solved.

1 Like

I don’t trust Sonoff devices at all. Their support is abysmal and the quality of products is poor.
I will never buy another rubbish Sonoff device again. It is cheap shite that will fail.

1 Like

You’re probably right, the app doesn’t instill much confidence.

But for the price per unit on the S30s, I can handle if they don’t last long.