Sonoff T1 US ESPHome Switches turning on by themselves

I have 2 Sonoff T1 US switches running on ESPHome software that randomly turn themselves on. Switches are remotely located in my garage so they are connected via a WiFi extender. Lights randomly switch on but typically early morning hours between 12 and 2am.

Any way to figure out what is switching them on?

esphome:
  name: garage
  platform: ESP8266
  board: esp01_1m
  # Automation turning on the blue status LED once T1 is booted up
  on_boot:
    priority: -10
    then:
      - light.turn_on: led

wifi:
  ssid: "xxxx_EXT"
  password: "xxxxxxxx"

# Enable logging
logger:

# Enable Home Assistant API
api:

ota:

binary_sensor:
  - platform: gpio
    pin:
      number: GPIO0
      mode: INPUT_PULLUP
      inverted: True
    name: "Garage Lights"
    on_press:
      - switch.toggle: relay
  - platform: status
    name: "Sonoff T1 UK 3 Gang Status"

switch:
  - platform: gpio
    name: "Garage Lights"
    pin: GPIO12
    id: relay

output:
  # Register the blue LED as a dimmable output ....
  - platform: esp8266_pwm
    id: basic_blue_led
    pin: GPIO13
    inverted: True

light:
  # ... and then make a light out of it.
  - platform: monochromatic
    name: "Garage Lights Blue LED"
    output: basic_blue_led
    internal: true
    id: led

Look at your logbook and see if any automations are running at the times the switches change state.

Look at your error log and see if anything is occurring about the same time.

This looks more like the device rebooting itself. This happens when the esp fw is unable to reach the ha server or looses the WiFi.
Try disabling the reboot timeout. Also you might want to enable the status sensor so you can track the api uptime.

I have two of those, no issues with esphome.

I see a lot of “Garage lights changed to unavailable” in the log.

Means they loose their connection to ha could be WiFi coverage. Maybe disabling the reboot timeout is not the best option. Try to set restore state of relay to RESTORE_DEFAULT_OFF

added this

api:
  reboot_timeout: 0s

Your link shows

  • RESTORE_DEFAULT_OFF (Default)

So no need to change right?

Thanks for your help!

switch:
  - platform: gpio
    name: "Garage Lights"
    pin: GPIO12
    id: relay
    restore_mode: RESTORE_DEFAULT_OFF

However you sould also fix the wifi coverage problem.

Still having issues with this. I got rid of the extender and connected directly to my main router but the problem persists.

Capture

Trying out this:

restore_mode: ALWAYS_OFF
1 Like