Australia - Electrically Certified Hardware

I couldn’t get it to flash using this USB to serial. I constantly got stuck on

Connecting…

A fatal error occurred: Failed to connect to Espressif device: Timed out waiting for packet header

I wired it like this:

3.3v to VCC (top left in the picture)
Ground to GND (bottom left)
TXD to TXD (bottom right)
RXD to RXD (2nd from bottom right)
CTS to GPIO0 (3rd from bottom left).

I think I stuffed that last one up… my switch still works though. Actually, the LED on the board didn’t even come on while I plugged it into the serial adapter.

I’ll have a crack again on the weekend if someone has any ideas?

Note: My board looks more like this and this one, without the holes on the right hand side where the VCC/GND/TX/RX stuff is.

boc,
I can also recommend the Fronius system for integration into HA. But I think it also needs to have the Smart Meter. It looks like an entire meter, but is only the size of a breaker switch, so like the size of a matchbox really. I am using the integration to trigger my AC to turn on and heat/cool if there is enough sustained export - leveraging the system.

https://www.fronius.com/en/photovoltaics/products/all-products/system-monitoring/hardware/fronius-smart-meter/fronius-smart-meter-50ka-3

1 Like

Thanks mate, will keep an eye out for it.

Struggling to find installers at the minute, so it’s possible this won’t be as short term as I’d hoped for!

Normally you would need to connect RX to TX and TX to RX between the FTDI adapter and the ESP.

1 Like

You dont need the Fronius smart meter. The inverter will provide generation figures and you can use any of many methods to determine grid import / export. eg: I use IotaWatt

1 Like

I have the iSwitchOz dimmer working.
It can be flashed successfully using tuya-convert.
The one I have definitely does power monitoring.

It works in both Tasmota and esphome (although I haven’t looked at getting the power monitoring working in esphome yet).

tasmota template:

{"NAME":"iSwitchOZ Dimmer","GPIO":[255,255,255,255,255,255,0,0,255,255,54,255,255],"FLAG":0,"BASE":54}

Tasmota additional console commands :

TuyaMCU 21,2 ; TuyaMCU 33,6 ; TuyaMCU 31,5 ; TuyaMCU 32,4 ; DimmerRange 1,24

esphome yaml:

substitutions:
  plug_id: eh_iswitch_dimmer_101
  plug_name: rumpus

esphome:
  name: ${plug_id}
  platform: ESP8266
  board: esp8285
  #board: esp01_1m

# Make sure logging is not using the serial port
logger:
  baud_rate: 0

wifi:
  blah blah blah

ota:

api:

uart:
  baud_rate: 9600
  tx_pin: GPIO1
  rx_pin: GPIO3

# Register the Tuya MCU connection
tuya:

# Create a light using the dimmer
light:
  - platform: "tuya"
    name: "${plug_name} Dimmer"
    id: "${plug_id}_dimmer"
    dimmer_datapoint: 2
    switch_datapoint: 1
    min_value: 1
    max_value: 24

Thanks BradAU,
I have completed my first tuya-convert. The Gen 2 Kogan Smart Plugs with USB are up and running in ESPhome now with power monitoring. Great plug for the price.

I had some difficulty with errors while compiling in ESPhome I had to remove web_server and captive_portal, as these threw errors that I could not resolve.

Thanks Again

You’ve completely thrown me off now. (Too many acronyms)

So all I did wrong (apart from the GPIO0 wire, doh!) was not hook the RX to the TX and the TX to the RX?

What is FTDI?

That’s really odd, I use the same base config for all my ESPHome units.

Just to confirm, are you using the ESPHome add-on in Hassio?

Well, that’s just one bit that I noticed.
One more thing to double-check is that the voltage of your USB to serial adapter is indeed set to 3.3V.

Sorry, didn’t want to confuse you. FTDI adapter is just a usual synonym for the USB to serial adapter that you have.

1 Like

You are a gem and a half! Thanks, I managed to get it to work first time with your guidance.

Here are a few photos:

This is the serial setup. https://newadventuresinwi-fi.blogspot.com/2019/10/brilliant-smart-elite-glass-wall.html has really good information on it. I found using the ground from the headers which connect to the 240v board worked great. The loosey goosey purple one was connected to the RST for 3 seconds while I plugged the usb cable in and then removed it let it float about.

And this is what my 3 gang board looks like.

I used Tasmotizer to flash it. Backed up the flash using esptool.py (sudo esptool.py read_flash 0 0x100000 firmware.bin) before I attempted it.

And here is a (mostly) working Tasmota template. I couldn’t find the ledlink but that doesn’t bother me.

 {"NAME":"DETA 3G Switch","GPIO":[0,0,0,92,91,21,0,0,23,157,22,0,90],"FLAG":0,"BASE":18}
1 Like

Just did one this evening. I wish the relays were a little quieter and that it had tactile buttons. I guess I can pretend that the relay click is audio feedback :stuck_out_tongue:

I think you mean GPIO0 rather than RST?

You got ahead of me, I didn’t find time this weekend to flash my 4-gang.
But I rung out the pins, my best guess for the control
relay1 : gpio16
relay2: gpoi4
relay3: gpio2
relay4: gpoi13
led: !gpio15

Completely untested. Does that match your 3-gang?
But I’m a bit concerned, that the 1 & 2 Gangs may no longer tuya-convert.

I just realised, I forgot about the buttons. So all my relays above could be buttons.
Chcking…, Someone has already added this device https://templates.blakadder.com/deta_6904HA.html

I’ve got it completely wrong.

I think you mean GPIO0 rather than RST?

The purple wire which is floating around in my picture was touching the top right hand leg of the TYWE3S chip when I powered it on. If I removed the GPIO0 wire then it would stop reading/flashing the device.


@diramu - thanks for that link. GPIO0 works for my LEDLink too. I’ve submitted it to the repo, lets see if it gets approved.

The only way I could get it to work was to short GPIO0 to GND and then connect my FTDI to USB.

Yep that is pretty much the standard way to flash an esp chip.

Jaycar have smart plugs that look like the Kogan ones

https://www.jaycar.com.au/smart-plug-wifi-controlled-main-switch-and-energy-monitor-with-2-x-usb-sockets/p/MS6104

Just wanted to check in with the folks who have the Grid Connect ceiling fans. Have there been any updates to the Tuya component that makes them visible in HA yet?

Cheers,

Linton

Decent markup on the Kogan prices tho!

1 Like

That’s what I thought when I saw them a while back. But if you need in a hurry you can the. from a bricks and mortar store

1 Like