I have 2 new S31 Lite Sonoff smart switches. When I opened them to reprogram them with ESPHome, I noticed that the processor board looked identical to my S31 Sonoff smart switches with a few parts depopulated. So I created a new ESPHome device using the S31 YAML here as a base. That worked! I can control the switch from my HAOS box. So my S31 Lite Sonoff switch is the same as a S31 Sonoff switch with out some parts (probably the power monitoring chip).
Question 1: Why did both YAMLs work on my S31 Lite Sonoff smart switches?
Question 2: Poking around the web, I came across a YouTube video where he opens a S31 Sonoff and an S31 Lite Sonoff smart switch. The S31 Lite’s processor circuit board does not look like mine. It does not look like a depopulated S31 Sonoff smart switch. Are there several versions of the S31 Lite Sonoff smart switch?
Works because esphome and esp chip only care about input and output. If you enter a correct input and output it will work. Especially true for relays and sensors. Gets complicated with cameras, audio or displays but a simple config with WiFi and switch will work across multiple devices.
From a parts inventory aspect, reusing the same circuit board for both models and just omitting the unwanted parts makes sense.
Your code should also load as it is the same processor SOC, and the missing input and output pins components means that portion of code will not work.
Those comments sound reasonable. Thanks. Recently I found that some of my confusion may have been because there apparently are 3 different Sonoff S31 products. Correct me if I’m wrong … I think there is the original S31 which measures power and can be updated to use ESPHome firmware. The S31 Lite which does not measure power and can also be updated to use ESPHome firmware. And the S31 Lite ZB which does not measure power and can not be updated to use ESPHome.