Sonoff B1 build is no longer working after upgrade of ESPHome

Hello,

I have upgraded to ESPHome 2022.2 (and 2022.3) and since then my Sonoff B1 is “broken”. It permanently glows violett if everything is turned off. The cold white and warm white channel is only controllable as long as the RGB channel is in the on state.

Here is my config:

substitutions:
    plug_name: wohnzimmerlampe
    friendly_name: "Wohnzimmerlampe"
    devicename: wohnzimmerlampe
    frequency_rgb: 100 Hz
    frequency_cw: 1000 Hz
    frequency_ww: 1000 Hz
esphome:
  #esp8266_restore_from_flash: true
  name: ${devicename}
  platform: ESP8266
  board: esp01_1m
globals: !include shared/globals.yaml
web_server: !include shared/webserver.yaml
time: !include shared/time.yaml
sensor: !include shared/sensors.yaml
binary_sensor: !include shared/binarysensors.yaml
text_sensor: !include shared/textsensors.yaml
wifi: !include shared/wifi.yaml
api: !include shared/api.yaml
ota: !include shared/ota.yaml
logger:

switch:
  - platform: restart
    name: ${friendly_name} Restart

my9231:
  data_pin: GPIO12  # GPIO13 for AiLight
  clock_pin: GPIO14  # GPIO15 for AiLight
  num_channels: 6
  num_chips: 2
  bit_depth: 8

output:
  - platform: my9231
    id: output_blue
    channel: 0
  - platform: my9231
    id: output_red
    channel: 1
  - platform: my9231
    id: output_green
    channel: 2
  - platform: my9231
    id: output_warm_white
    channel: 4
  - platform: my9231
    id: output_cold_white
    channel: 5

light:
    - platform: rgb
      name: ${devicename}_rgb
      id: ${devicename}_rgb
      red: output_red
      green: output_green
      blue: output_blue
      default_transition_length: 3s
      restore_mode: ALWAYS_OFF 
#      effects: !include shared/effects.yaml
    - platform: cwww
      name: ${devicename}_cwww
      id: ${devicename}_cwww
      warm_white: output_warm_white
      cold_white: output_cold_white
      cold_white_color_temperature: 6500 K
      warm_white_color_temperature: 2800 K
      default_transition_length: 3s
      restore_mode: RESTORE_DEFAULT_OFF

Are you saying you reflashed your sonoff? Merely upgrading esphome will not change firmware unless you reflash it.

Yes this time I hit the update all button and it reflashed the B1, not sure on which version the working bin was based on

Are you facing this maybe:

I don’t think so, I have never seen any errors in the log - here the log from a short test:

Time	level	Tag	Message
22:56:30	[D]	[light:084]	
  Transition length: 3.0s
22:57:22	[D]	[sensor:124]	
'Wohnzimmerlampe Uptime': Sending state 2.89937 minutes with 0 decimals of accuracy
22:57:23	[D]	[sensor:124]	
'Wohnzimmerlampe WiFi Signal': Sending state -46.00000 db with 0 decimals of accuracy
22:58:22	[D]	[sensor:124]	
'Wohnzimmerlampe Uptime': Sending state 3.89937 minutes with 0 decimals of accuracy
22:58:23	[D]	[sensor:124]	
'Wohnzimmerlampe WiFi Signal': Sending state -43.00000 db with 0 decimals of accuracy
22:59:22	[D]	[sensor:124]	
'Wohnzimmerlampe Uptime': Sending state 4.89940 minutes with 0 decimals of accuracy
22:59:23	[D]	[sensor:124]	
'Wohnzimmerlampe WiFi Signal': Sending state -45.00000 db with 0 decimals of accuracy
22:59:28	[I]	[ota:105]	
Boot seems successful, resetting boot loop counter.
23:00:22	[D]	[sensor:124]	
'Wohnzimmerlampe Uptime': Sending state 5.89933 minutes with 0 decimals of accuracy
23:00:23	[D]	[sensor:124]	
'Wohnzimmerlampe WiFi Signal': Sending state -46.00000 db with 0 decimals of accuracy
23:01:22	[D]	[sensor:124]	
'Wohnzimmerlampe Uptime': Sending state 6.89938 minutes with 0 decimals of accuracy
23:01:23	[D]	[sensor:124]	
'Wohnzimmerlampe WiFi Signal': Sending state -44.00000 db with 0 decimals of accuracy
23:02:22	[D]	[sensor:124]	
'Wohnzimmerlampe Uptime': Sending state 7.89937 minutes with 0 decimals of accuracy
23:02:23	[D]	[sensor:124]	
'Wohnzimmerlampe WiFi Signal': Sending state -42.00000 db with 0 decimals of accuracy
23:03:22	[D]	[sensor:124]	
'Wohnzimmerlampe Uptime': Sending state 8.89938 minutes with 0 decimals of accuracy
23:03:23	[D]	[sensor:124]	
'Wohnzimmerlampe WiFi Signal': Sending state -43.00000 db with 0 decimals of accuracy
23:04:22	[D]	[sensor:124]	
'Wohnzimmerlampe Uptime': Sending state 9.89937 minutes with 0 decimals of accuracy
23:04:23	[D]	[sensor:124]	
'Wohnzimmerlampe WiFi Signal': Sending state -43.00000 db with 0 decimals of accuracy
23:05:22	[D]	[sensor:124]	
'Wohnzimmerlampe Uptime': Sending state 10.89937 minutes with 0 decimals of accuracy
23:05:23	[D]	[sensor:124]	
'Wohnzimmerlampe WiFi Signal': Sending state -45.00000 db with 0 decimals of accuracy
23:06:22	[D]	[sensor:124]	
'Wohnzimmerlampe Uptime': Sending state 11.89935 minutes with 0 decimals of accuracy
23:06:23	[D]	[sensor:124]	
'Wohnzimmerlampe WiFi Signal': Sending state -45.00000 db with 0 decimals of accuracy
23:07:22	[D]	[sensor:124]	
'Wohnzimmerlampe Uptime': Sending state 12.89938 minutes with 0 decimals of accuracy
23:07:23	[D]	[sensor:124]	
'Wohnzimmerlampe WiFi Signal': Sending state -45.00000 db with 0 decimals of accuracy
23:08:22	[D]	[sensor:124]	
'Wohnzimmerlampe Uptime': Sending state 13.89937 minutes with 0 decimals of accuracy
23:08:23	[D]	[sensor:124]	
'Wohnzimmerlampe WiFi Signal': Sending state -42.00000 db with 0 decimals of accuracy
23:09:22	[D]	[sensor:124]	
'Wohnzimmerlampe Uptime': Sending state 14.89940 minutes with 0 decimals of accuracy
23:09:23	[D]	[sensor:124]	
'Wohnzimmerlampe WiFi Signal': Sending state -45.00000 db with 0 decimals of accuracy
23:10:22	[D]	[sensor:124]	
'Wohnzimmerlampe Uptime': Sending state 15.89937 minutes with 0 decimals of accuracy
23:10:23	[D]	[sensor:124]	
'Wohnzimmerlampe WiFi Signal': Sending state -43.00000 db with 0 decimals of accuracy
23:11:22	[D]	[sensor:124]	
'Wohnzimmerlampe Uptime': Sending state 16.89937 minutes with 0 decimals of accuracy
23:11:23	[D]	[sensor:124]	
'Wohnzimmerlampe WiFi Signal': Sending state -46.00000 db with 0 decimals of accuracy
23:12:22	[D]	[sensor:124]	
'Wohnzimmerlampe Uptime': Sending state 17.89937 minutes with 0 decimals of accuracy
23:12:23	[D]	[sensor:124]	
'Wohnzimmerlampe WiFi Signal': Sending state -45.00000 db with 0 decimals of accuracy
23:13:22	[D]	[sensor:124]	
'Wohnzimmerlampe Uptime': Sending state 18.89933 minutes with 0 decimals of accuracy
23:13:23	[D]	[sensor:124]	
'Wohnzimmerlampe WiFi Signal': Sending state -45.00000 db with 0 decimals of accuracy
23:14:22	[D]	[sensor:124]	
'Wohnzimmerlampe Uptime': Sending state 19.89940 minutes with 0 decimals of accuracy
23:14:23	[D]	[sensor:124]	
'Wohnzimmerlampe WiFi Signal': Sending state -44.00000 db with 0 decimals of accuracy
23:15:22	[D]	[sensor:124]	
'Wohnzimmerlampe Uptime': Sending state 20.89933 minutes with 0 decimals of accuracy
23:15:23	[D]	[sensor:124]	
'Wohnzimmerlampe WiFi Signal': Sending state -43.00000 db with 0 decimals of accuracy
23:16:22	[D]	[sensor:124]	
'Wohnzimmerlampe Uptime': Sending state 21.89938 minutes with 0 decimals of accuracy
23:16:23	[D]	[sensor:124]	
'Wohnzimmerlampe WiFi Signal': Sending state -43.00000 db with 0 decimals of accuracy
23:17:22	[D]	[sensor:124]	
'Wohnzimmerlampe Uptime': Sending state 22.89937 minutes with 0 decimals of accuracy
23:17:23	[D]	[sensor:124]	
'Wohnzimmerlampe WiFi Signal': Sending state -42.00000 db with 0 decimals of accuracy
23:18:22	[D]	[sensor:124]	
'Wohnzimmerlampe Uptime': Sending state 23.89940 minutes with 0 decimals of accuracy
23:18:23	[D]	[sensor:124]	
'Wohnzimmerlampe WiFi Signal': Sending state -42.00000 db with 0 decimals of accuracy
23:19:22	[D]	[sensor:124]	
'Wohnzimmerlampe Uptime': Sending state 24.89938 minutes with 0 decimals of accuracy
23:19:23	[D]	[sensor:124]	
'Wohnzimmerlampe WiFi Signal': Sending state -42.00000 db with 0 decimals of accuracy
23:20:22	[D]	[sensor:124]	
'Wohnzimmerlampe Uptime': Sending state 25.89935 minutes with 0 decimals of accuracy
23:20:23	[D]	[sensor:124]	
'Wohnzimmerlampe WiFi Signal': Sending state -41.00000 db with 0 decimals of accuracy

same here. With other problems already described here

No way to add MIFLORA and other sensor after last upgrade. If I add sensor log becomes full of json error and board disconnects itself from wifi
Current version: 2022.3.2 doesn’t solve issue

I flashed another board (4M instead of 2M). Same problem… it’s really the esphome code…

I’ve got 2 sonoff basic r2 devices, both wouldn’t connect to wifi anymore after recent update of esphome (and updating the devices accordingly).
After some searching/experimenting with one device, and the many painful serial flashing over UART, I got it online again a few times.
I had to remove/comment a lot of the components.

Now it looks like this was now causing an issue:


binary_sensor:
  - platform: gpio
    pin:
      number: GPIO0
      mode: INPUT_PULLUP
      inverted: True

After changing into this everything was back to normal:

binary_sensor:
  - platform: gpio
    pin:
      number: GPIO0
      mode:
        input: true
        pullup: true
      inverted: true

my connection issues of a few basic r1’s was fixable by manually assigning an ip address. But my B1 is fully accessible just the light part is broken.

Wanted to chime-in that I observed something similar to the original posted, here are the symptoms:

  • Two Sonoff B1 light bulbs flashed with ESPHome, both working fine for several months (but I don’t remember which ESPHome version was running on them)
  • Recently updated both to ESPHome version 2022.8.3
  • Since then, every now and then when they turn-off, they don’t switch the RGB channel completely off, it remains glowing faintly with a violet color
  • Usually turning it on and off again will do the trick and shut it off, but sometimes it is necessary to do it two or three times before the bulb is really off
  • I have not noticed anything strange with the brightness sliders in Home Assistant, but I also don’t tweak them much (these two lights are primarily driven by automations)
  • The logs don’t display any errors or warnings (logger level is set to DEBUG)
  • The lights are using the default 1s transition time fading anymation

In case it helps, this is the YAML currently flashed to both Sonoffs:

# -----------------------------------------------------------------------------
# ESPHome config file for the wake-up lights (Sonoff B1)
# CAH 2022-04-17
#
# For the initial reflashing with ESPHome, refer to <docs/flashing_sonoff_b1.md>
# -----------------------------------------------------------------------------

esphome:
  name: wakeup_light_01r
  platform: ESP8266
  board: esp01_1m

wifi:
  networks:
    - ssid: !secret wifi_ssid_1
      password: !secret wifi_password_1
    - ssid: !secret wifi_ssid_2
      password: !secret wifi_password_2
    - ssid: !secret wifi_ssid_3
      password: !secret wifi_password_3
    - ssid: !secret wifi_ssid_4
      password: !secret wifi_password_4

captive_portal:

ota:
  safe_mode: True
  password: !secret ota_password

api:

logger:
  level: DEBUG

sensor:

  - platform: uptime
    name: "Wake-up Light 01-R Uptime"
    id: uptime_sensor


my9231:
  data_pin: GPIO12
  clock_pin: GPIO14
  num_channels: 6
  num_chips: 2
  bit_depth: 8

output:
  - platform: my9231
    id: output_blue
    channel: 0
  - platform: my9231
    id: output_red
    channel: 1
  - platform: my9231
    id: output_green
    channel: 2
  - platform: my9231
    id: output_warm_white
    channel: 4
  - platform: my9231
    id: output_cold_white
    channel: 5

light:
  - platform: rgbww
    name: wakeup_light_01r
    red: output_red
    green: output_green
    blue: output_blue
    cold_white: output_cold_white
    warm_white: output_warm_white
    cold_white_color_temperature: 6500 K
    warm_white_color_temperature: 2800 K

switch:
  - platform: restart
    name: "Wake-up Light 01-R Restart"

Hi @pw-sys wondering whether you manage to figure this out?

I’ve seen this issue too, but it’s not deterministic, happens maybe every 10th time the light is turned off.

I am considering adding a on_turn_off action to set all channels’ brightness to zero as an experiment, BUT I first need to learn how to save the previous state in-memory before doing this.

For whatever it is worth, I’ve noticed that it is easy to reproduce the “dim purple glow” issue on the Sonoff B1 by enabling the “restart” switch in the ESPHome template and restarting from Home Assistant.

As a workaround, I’ve added an action to turn the light on and then off again at reboot, which so far have resolved the issue with the purple glow (but notice that if your HA crashes and does not connect anymore to the API, the device will enter a reboot loop and this action will hinder using the light without HA)

Here’s the code for the hack:

esphome:
  on_boot:
    priority: 600
    then:
      - light.turn_on:
          id: ${node_hostname}
          brightness: 50%
      - delay: 0.5s
      - light.turn_off:
          id: ${node_hostname}

unfortunately this is not fixing my problem, yes I can script it this way, but for me being able to control the white channels the RGB must be on, which results in a dirty looking white and a turn on delay of a second is unusable.
My short term solution is - I have changed my B1 for OSRAM zigbee bulbs.