Freeze sonoff touch

Hello everyone. I am having problems with a device which is frozen every so often. In the esphome panel it appears online but in my dashboard it appears as unavailable. It is a two-channel sonoff touch. It started to fail after I modified the electrical installation. Could it be that the cables are reversed or if so, it would never have turned on?

I forgot to say that before it crashes, it just turns the light on and off several times.

Yesterday I checked and the neutral and the phase are fine. I don’t know if the password flashed too many times may have made the firmware got corrupted. Today I’m going to take out the board and write it by uart and see if it works. The electrical change was simply the thickness of the wire. All the cables were not standardized and that is why there were many tests to see which was neutral and which was phase. I imagine that turning the power off and back on so many times may have broken the firmware. I hope it’s that and not the plate. I don’t understand if those errors can be explaining something to me so I can check it. Now what it is doing is turning it off and on more than 5 times and so on every half hour or so.

Hello. Here I show you what is happening with my sonoff touch. Every time I connect it, it works for a few seconds and starts to turn on and off and stays stuck.

video Sonoff touch

Turn on and off 10 times. I imagine it is something that is programmed to report something

What version of your sonoff?
Post the esphome configuration.

I don’t know what version it is. But it is the newest one that has the front with squares on each road and not circles. It’s two-gang. It’s been running for a long time. By changing the thickness of the electricity cables, the electricity was removed and reconnected many times. This happened only with this device. I have several and none had a problem. The sonoff has a fixed ip from my router and if I do a ping it responds.

esphome:
  name: tecla-wifi-comedor

esp8266:
  board: esp01_1m

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password
  # Optional manual IP
  manual_ip:
    static_ip: 192.168.1.10
    gateway: 192.168.1.1
    subnet: 255.255.255.0
  ap:
    ssid: "tecla-comedor-AP"
    password: !secret wifi_password  

api:

logger:

ota:

captive_portal:

binary_sensor:
  - platform: gpio
    pin:
      number: GPIO0
      mode:
        input: true
        pullup: true
      inverted: true
    name: "comedor-estado-1"
    on_press:
      - switch.toggle: relay_1    
  - platform: gpio
    pin:
      number: GPIO9
      mode:
        input: true
        pullup: true
      inverted: true
    name: "comedor-estado-2"
    on_press:
      - switch.toggle: relay_2    
  - platform: gpio
    pin:
      number: GPIO10
      mode:
        input: true
        pullup: true
      inverted: true
    name: "comedor-estado-3"
    on_press:
      - switch.toggle: relay_3    

  - platform: status
    name: "Sonoff T1 UK 3 Gang Status"

switch:
  - platform: gpio
    name: "comedor_1"
    pin: GPIO12
    id: relay_1
  - platform: gpio
    name: "comedor_2"
    pin: GPIO5
    id: relay_2
  - platform: gpio
    name: "comedor_3"
    pin: GPIO4
    id: relay_3


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

light:
  # ... and then make a light out of it.
  - platform: monochromatic
    name: "comedor-led"
    output: blue_led
    

What version of esphome are you using? Try to remove the LED part.

I am using the latest version of esphome. Delete the lines that have to do with the led but it’s still the same. It works for a couple of seconds and does the same

I noticed your code is for 3 switches, but your hardware is 2 switches.

If you leave the code with just the connection configuration, does it crash too?

Have you checked if you have any other devices using the same IP?

It is true. The third switch I have to remove from the code. The code works fine because it’s been like this for months. This started to fail after this wiring modification. Try fing and the device responds. There can be no other because by DHCP it goes from IP 100 onwards.
I hope it’s something stupid that I’m not seeing. Because here in Argentina they cost 4 times or what it is really worth. If I have to buy it on Aliexpress it takes about 4 months to arrive. And we are going through a bad economic moment in the country to have to buy it.

But you are putting fixed ip, if you configure 2 Devices with the same address, you will have a problem.

What happens if you remove the device from the box?

Have you tried turning off the loads? Leaving only the device on?

Perhaps the amount of wires in the box or the thickness is causing some sort of interference.

But it is a sonoff of two gangs, it works with a single IP. Today I am going to take it out and I am going to test it if it loads. I have several sonoff touch working for a long time and they still work after the modification. The sonoff has a plate that can be easily removed. When I put it back on in the first two seconds I can turn the two lamps off and on but right away it freezes and blinks again.

What I mean is, the tecla-wifi-comedor uses the IP 192.168.1.10 if you put the tecla-wifi-quarto with the same IP 192.168.1.10 you will have problems.

I bought 3 of these devices with 3 switches, they will arrive today. Maybe I can help after installing them

Oh, okay. I did not understand. I have several working and reserve an ip for each key. There is nothing else with that ip. but I had them working for a long time. Don’t just install them

It’s already friends. It totally stopped working. Or there is an electrical error that I checked and I don’t think so. Or the sonoff was failing. Thank you very much for all the help you provide in the forum. Greetings.