Hi everyone. I've bought a few EARU EAMPDW-TY-63 devices, and it seems like there's a new revision with T1-3S module instead.
Everything else remains the same. I've managed to successfully flash OBK for BK7238(T1). Attaching the backup of the original firmware to the post.
This is my first experience with OBK and smart homes in general. So after some time researching the topic I began to dig into the dpIDs for this device as I couldn't find complete breakdown. Here's my autoexec.bat with everything I've managed to decode:
clearIO
SetFlag 46 1
startDriver TuyaMCU
tuyaMcu_setBaudRate 9600
tuyaMcu_defWiFiState 4
linkTuyaMCUOutputToChannel 1 val 1
setChannelType 1 EnergyTotal_kWh_div100
setChannelLabel 1 "Total Energy"
linkTuyaMCUOutputToChannel 6 RAW_TAC2121C_VCP
setChannelType 2 Voltage_div10
setChannelLabel 2 "Voltage"
setChannelType 3 Power
setChannelLabel 3 "Power"
setChannelType 4 Current_div1000
setChannelLabel 4 "Current"
linkTuyaMCUOutputToChannel 9 raw 9
setChannelType 9 ReadOnly
setChannelLabel 9 "Fault"
linkTuyaMCUOutputToChannel 11 bool 11
setChannelType 11 toggle
setChannelLabel 11 "Prepayment"
linkTuyaMCUOutputToChannel 12 bool 12
setChannelType 12 toggle
setChannelLabel 12 "Clear Energy Counters"
linkTuyaMCUOutputToChannel 13 val 13
setChannelType 13 EnergyTotal_kWh_div100
setChannelLabel 13 "Total Prepaid Energy"
linkTuyaMCUOutputToChannel 14 val 14
setChannelType 14 TextField
setChannelLabel 14 "Purchased Energy [kWh*100], i.e. 1kWh = 100"
linkTuyaMCUOutputToChannel 15 val 15
setChannelType 15 Current_div1000
setChannelLabel 15 "Leakage Current"
linkTuyaMCUOutputToChannel 16 bool 16
setChannelType 16 toggle
setChannelLabel 16 "Breaker"
linkTuyaMCUOutputToChannel 17 val 17
setChannelType 17 TextField
setChannelLabel 17 "Leakage Current Protection Settings"
linkTuyaMCUOutputToChannel 18 raw 18
setChannelType 18 ReadOnly
setChannelLabel 18 "UVP, OVP, OVC"
linkTuyaMCUOutputToChannel 102 val 19
setChannelType 19 TextField
setChannelLabel 19 "E-C"
linkTuyaMCUOutputToChannel 103 val 20
setChannelType 20 Temperature
setChannelLabel 20 "Temperature, C"
linkTuyaMCUOutputToChannel 104 bool 21
setChannelType 21 toggle
setChannelLabel 21 "E-C Enable"
linkTuyaMCUOutputToChannel 105 val 22
setChannelType 22 TextField
setChannelLabel 22 "Toggle with delay (-2s), i.e. 10 = toggle in 8s"
linkTuyaMCUOutputToChannel 106 val 23
setChannelType 23 TextField
setChannelLabel 23 "106"
linkTuyaMCUOutputToChannel 107 val 24
setChannelType 24 TextField
setChannelLabel 24 "Reclose delay time"
linkTuyaMCUOutputToChannel 109 val 25
setChannelType 25 TextField
setChannelLabel 25 "109"
linkTuyaMCUOutputToChannel 110 val 26
setChannelType 26 TextField
setChannelLabel 26 "110"
linkTuyaMCUOutputToChannel 111 enum 27
setChannelType 27 TextField
setChannelLabel 27 "111"
linkTuyaMCUOutputToChannel 134 enum 28
setChannelType 28 TextField
setChannelLabel 28 "Power On State: 0=OFF, 1=ON, 2=Last State"
tuyaMcu_sendQueryState
So,
1) dp 15 (leakage current enable and value) are "write-only". They're always being read as 0, however writing to the dp has immediate effect.
2) there's some setting in the device which isn't present in the manual. Screen says "E-C" and possible values are 0-99. Channel 102 sets this value and channel 104 is true if the value is not zero. Couldn't manage to find out what does it do.
3) dp 105 acts strangely - it sets a countdown timer and toggles the relay when timer reaches value 2. So if I set 10s, it begins to decrement, toggles the relay and remains 2.
4) dp 103 is temperature
5) dp 107 sets power on delay time
6) dp 134 defines default power-on state (off, on or last active state)
7) 106, 109, 110, 111 behavior is unknown
What's more, it seems like this device has less Flash memory and it's impossible to upload the custom html page shared previously in this topic. Thus I've removed all the prepaid functionality (as I won't use it anyway), removed all the visibility toggling logic and used html minifier before uploading. Attaching non-minified version of the page as well.
If someone could suggest what other dp's are doing that would be great.
On a side note, during the debug I've encountered an issue when the device was not responding on the network several times. I couldn't ping it and it did not load any webpages. The only cure was power reset. I'm wondering, how common is this? Has someone else encountered similar issue?
I'm asking as I'm planning to use it for some power automations for my off-grid power station and after installation it would be quite hard to reset the power in case of freezing like this.