R3 WIFI3 from tuya, distributed as a magnetothermal differential switch


This device is currently distributed in Italy by EttroIT, it’s identified by Tuya as R3_WIFI3, it’s an electromechanical switch remotely controllable attached to a differential magnetothermal switch, in this case a C32 (32Amps, 6.6Kw).

I managed to disassembly it by removing the rivets, you can replace the rivets with a m2 bolt and nut, just ensure to enlarge holes by drilling them only on the surface with an 5.5 drill, then enlarge the central holes with a 2.5 drill.

The procedure is somewhat similar to any CBU - (generic-bk7231n-qfn32-tuya), you can take 3.3v and ground from there (red circles, check for ground by touching metal shell of cbu, the other pin is 3v3):

Config is really simple, down below, what you won’t find is the remote lock, commented out, since I haven’t found any way to communicate the lock with the apparatus, but AFAIC it’s not a functionality I would use anyway.

substitutions:
  name: R3_WIFI3
  friendly_name: Your Preferred Name
  
bk72xx:
  board: generic-bk7231n-qfn32-tuya

esphome:
  name: $name
  friendly_name: $friendly_name
  min_version: 2024.11.0
  name_add_mac_suffix: false

preferences:
  flash_write_interval: 
    seconds: 30

# Enable logging
logger:
  level: DEBUG

# Enable Home Assistant API
api:
  encryption:
    key: !secret api
  reboot_timeout: 120min

ota:
  - platform: esphome
    password: !secret ota

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: $name
    password: !secret ap
  reboot_timeout: 0s #120min  

captive_portal:

button:
  - platform: restart
    name: "Restart"
    id: button_restart

mdns:

debug:
  update_interval: 30s

text_sensor:
  - platform: libretiny
    version:
      name: LibreTiny Version

sensor:
  - platform: wifi_signal
    name: "RSSI"
    id: sensor_rssi
    update_interval: 30s
    entity_category: "diagnostic"
  - platform: uptime
    name: "Uptime"
    id: sensor_uptime
    update_interval: 60s
    entity_category: "diagnostic"
  - platform: tuya
    sensor_datapoint: 102
    name: Mechanic Lock
  #- platform: tuya
  #  sensor_datapoint: 103
  #  name: Remote Lock
  - platform: tuya
    sensor_datapoint: 104
    name: Local Lock

uart:
  rx_pin: RX1
  tx_pin: TX1
  baud_rate: 115200

tuya:

switch:
  - platform: tuya
    switch_datapoint: 1
    name: Switch
    restore_mode: RESTORE_DEFAULT_OFF

Nice job.
Where is the reclosing motor configured?

DP1 of the mcu is the reclosing motor switch. It’s already wrote in the configuration. mcu is controlling the reclosing, if any lock is active, it won’t start the reclosing motor.

What is DP1? I don’t see…

In what configuration?

So do you have control of reclosing??

I’ve pasted an ESPhome configuration example in the first post (I don’t know if you can’t see it), you have control on the reclosing by using the datapoint 1 of tuya mcu, while the datapoint 102 is for mechanical lock and 104 is for local lock. 103 is a remote lock switch, in original device it wouldn’t allow you to remotely control the device, but considering the nature of esphome you can provide such a lock in any other way (you could use a placeholder for that and prevent any control by using a virtual switch or sensor)

Yes, I can see your yaml.
Like you can see from my questions, I have (luckily) never configured Tuya devices, so the device slang is unfamiliar to me.
But I might try, since I actually need a RCD that I can freely configure for reclosing.
The “normal” ones try to reclose two times in few seconds and then give up. We have lot of interferences on mains lines and I need completely different timing pattern.
Thank’s.

The input is prior to output of the C32, so the device is still controllable in the case the thing has be put to off for whatever reason (reopened) but mains should be present of course, the switch can be controlled also within a yaml script inside the esphome configuration, and it’s possible to use a timing for those, but as you can imagine, you have to be extra cautious with what you automatically decide to do in those cases.
The device itself doesn’t do any ground or short-circuit check, so the magnetothermal differential will just reopen if the reclosing has any of those things (and the wifi module will get the DP1 switch immediately open after the reclosing, in this case); you can use any timings, but as an electrician, I would suggest extreme caution with anything you do when controlling such devices automatically or remotely.
If you turn on the local lock, anyway, the device wouldn’t rearm automatically (it’s a switch into the tuya module, visible and usable outside)
But, anyway, it’s possible, yes.

Thank’s for your advices. My plan is not to abuse safety device, opposite.
When we have those interferences on mains, the whole neighborhood suffers from ridiculous RCD problem, it’s not a problem of residual current . I have tried every possible class of RCDs but they all fail. So instead of reclosing after 2s and 5s, I prefer 2s, 5min for example. Flashed directly to device of course, I never do important automations out of the device.

For curiosity, did you ever ask EttroIT to provide certifications for that device?
I have always serious doubts when there is Tuya used, generally they are chinese stuff with no certifications/fake certifications…

BT-ESR3532 is probably a certified device (will confirm when I get the answer from ettroit), but it’s not intended to be used as an automatic recloser, but instead as a wifi controlled recloser, tuya in fact lacks the ability to do such a reclosing automatically.
The tuya module is only attached to the original certified module (they are kept together with two clips in plastic), the certification number and specifications are as below (in Italian, lacks CEI certs, will report when I get answer from ettroit):

Modello    ESR3532
Tipologia    Interruttore Magnetotermico Smart
Moduli    3
Poli    1P+N
Corrente In    32A
Tensione    230V/400 VAC
Consumo in Stand-by    <3W
Tempo di intervento    ≤0.1 sec
Tempo di cortocircuito    ≤0.04 sec
Curva    C
Metodo di Controllo    Integrato manuale e automatico
Metodo di comunicazione    WiFi, Contatto Pulito
Gestione Remota    Si mediante App Tuya
WiFi    Si
Potere d'interruzione Inc    4.500A
Indice di protezione IP    IP20
Normativa    GB/T10963.1-2020
Certificazione    CE

I will ask anyway the ettroit people for the certificate for the EU (just out of curiosity), since this is what I did find on the specs module, will put an answer here when I get it

1 Like