I went down this same path using Kogan branded Tuya smart plugs & flashing with Tasmota. I found that if you use the latest version of Tasmota (6.5.0) there are more options in the ‘Configuration Module’ drop-down. Went through a bunch of them and found that the Gosund SP1 module does the trick.
Everything appears to work great including all the power monitoring. Only thing that does not work is the button on the unit - nice to have but not a deal breaker for me.
I opened them up to flash - very easy to do & all the required connection points are labelled - (I just didn’t have all the necessary bits to do OTA flash)
With Monitoring. I worked out what all the pins are so it seems to be working just great. It’s a very basic module so you have to calibrate your self (otherwise known as a 60w bulb…).
GPIO0 = Button1 (17)
GPIO4 = HLW8012 CF (133)
GPIO5 = HLWBL CF1 (132)
GPIO12 = HLWBL SELi (131)
GPIO13 = LED1i (56)
GPIO14 = Relay1 (21) - main relay, controls ring LED
Note that you will need to translate some of those onto esphome. However the GPIO13 is an inverted led (so off when on…?) and of the esphome support the HLW 8012 power/wattage/current sensor that should be easy anough to work out (3 pins, CF, CF1 and a selector pin).
Edit2: The Sel pin in inverted too… if you don’t do this you will end up with huge Watts and very small volts
Seems like everything is working just need to calibrate the plug. To get the button to work correctly I needed to set the mode to input pull-up for the button.
To find voltage (Australia is 230v +/- 10%, so quite wide) use a pre or self-calibrated meter. If you have a solar system then that should also have your current voltage which is going to be fairly good. Worst case, take the reading from one of the Kogans before you flash it.
Watts comes from the bulb. Incandescent bulbs are best for this.
Here are the are the Kogan Smart Plug Tasmota settings as a template string: {"NAME":"KoganSmartPlug","GPIO":[17,255,255,255,133,132,255,255,131,56,21,255,255],"FLAG":0,"BASE":18}
You can apply this template string configuration in Tasmota (v6.5 upwards) by:
Upgrade to latest Tasmota version, if v6.4 or below (from Main HTTP menu): [Firmware Upgrade] | Upgrade by web server: [Start Upgrade]
Enter the custom template string above (from Main HTTP menu): [Configuration] | [Configure Other] | Template: paste template string from above
Check the [Activate] box below the template string [Save]
Hi @JustinP do you have an update on this? Would you mind sharing the ESPhome code for the Kogan plugs? I’m just trying to code mine now but a few things are guesses at this stage…
EDIT: worked nicely, cheers. I just had to play around with the voltage divider to calibrate the reading to match my tested voltage. Out of curiosity where did you get the original values from?