I was curious if anyone flashed ESPhome onto a KS-602f WiFi 3-way switch. I’m going to be installing one probably tomorrow. I found a yaml file for the Moes one, hopefully they are the same.
I finally got around to trying to flash this guy. Tuya Convert didn’t work.l, but there was a header for all the needed pins. Turns out everything is controlled by the MCU and the esp is just for communication. I flashed Tasmota and used the Tuya Dimmer base. I can control the light and get current state from Power1.
No, just an on/off 3-way switch. All controls are handled in the mcu with serial commands. I chose the Tuya Dimmer base because it communicates to the mcu through the Tuya Rx/Tx. It worked so I didn’t spend any more time on it trying to figure out the codes.
Hey there - do you have an article of how to communicate with the MCU? I’ve written my own firmware for the esp8266ex however since it talks to the MCU I’m at a bit of a loss of how the hardware serial was working - that being said, is there places to get the default bin files for a bin walk of any kind? The MCU has no marking whatsoever so I have no idea what pinouts are - and the TX/RX on the board for the MCU doesn’t seem to do anything either. Looks like only GPIO0 is connected and the rest of them from the 8266ex are not connected to anything - Or, can you help me duplicate your efforts in some way?
Nick is right, look at the Tasmota source. I’m of no help when it comes to how the code works. From the esp, it uses the regular GPIO 1 for tx and GPIO 3 for rx. I’d love to hear if you can figure it out because ideally I’d like to switch this over to ESPhome since that is what everything else I have is.
Do you happen to have documentation of how to do that part? I’ve never done that Tuya flashing or tasmota? Losing my mind over this one. don’t know how to make the wifi talk to the mcu as I know nothing about hardware serial
Yeah, that’s how I wired it. I use a NodeMCU with EN pulled to ground for flashing, but it’s the same as the usb to serial adapter. I didn’t solder, I just push the wires in place and hold at an angle to make contact. I think I got it to flash on the first try.
Did any of you get the KS-602F working with ESPHome? I successfully used Tuya Convert to get custom flash on it no problem, but having trouble finding an ESPHome yaml config that lets me actually operate the switch. https://esphome.io/components/light/tuya.html Isn’t too much help as the GPIOs and such in the example aren’t necessarily for this particular model of switch.
Ok, just kidding. I got the right UART pins and it’s working now. Here is the config I used in case anybody else happens along this thread looking for info. (My .common.yaml includes all the other config you need (api, wifi creds, etc.))
ESPHome makes you define a dimmer ‘datapoint’ even though this is not a dimmer, just a 3-way switch. It seems to work fine as it is and I just used the example value form the ESPHome docs.
I don’t see any way to control the LEDs or interface with the button or relay directly, which is a real bummer as I change the normal LED pattern on my other switches to be off when the light is off. The default for this switch is green when off and red when on. I would also love to access double-press or long-press functionality, but not seeing a way here…
substitutions:
device_name: kitchencounters # hostname & entity_id
friendly_name: Kitchen Counters # Displayed in HA frontend
logger:
baud_rate: 0
<<: !include .common.yaml
esphome:
name: ${device_name}
platform: ESP8266
board: esp01_1m
uart:
rx_pin: GPIO3
tx_pin: GPIO1
baud_rate: 9600
# Register the Tuya MCU connection
tuya:
# Create a light using the dimmer
light:
- platform: "tuya"
name: "${friendly_name}"
dimmer_datapoint: 3
switch_datapoint: 1
I haven’t actually noticed what mine specifically does yet (I just got it installed), but one of the (imo very few) advantages of the separate MCU model is that you can flash the chip all day and it won’t affect the basic switch functionality or state of the switch since that is all controlled separately. So, neither event should affect the light unless you ESP code was actually altering the state on boot or something like that.