YAML for Hiking | Tomzn | Tuya | DDS238-2 WIFI Din Rail Energy Meter

Hi All,

I purchased one of these din rail energy meters with the Tuya MCU and ESP8266 inside, and couldn’t find any good or full examples of an ESPHome yaml config for them. I found some guides for tasmota, like this one (good guild for flashing), but I thought it would be worth sharing my config so others don’t need to figure it out.

After compiling the config, I flashed with tasmotizer with no issues. Hope it helps someone out.

MQTT bit is optional, i use it as i have a separate server running emoncms for my energy devices.

substitutions:
  device_name: energy_meter
  friendly_name: "Car Energy Meter"

esphome:
  name: ${device_name}
  platform: ESP8266
  board: esp01_1m

wifi:
  ssid: !secret wifissid
  password: !secret wifipassword
  ap:
    ssid: ${friendly_name}
    password: !secret esphome_admin_password

captive_portal:

logger:
  baud_rate: 0

api:

ota:

mqtt:
  broker: !secret mqtt_ip
  username: !secret mqtt_username
  password: !secret mqtt_password
  topic_prefix: emon/${device_name}

uart:
  rx_pin: GPIO3
  tx_pin: GPIO1
  baud_rate: 9600

tuya:

switch:
  - platform: "tuya"
    name: "${friendly_name} Switch"
    id: power
    switch_datapoint: 1

binary_sensor:
  - platform: gpio
    pin: 16
    id: button
    on_press:
      then:
        - switch.toggle: power
        
sensor:   
  - platform: "tuya"
    name: "${friendly_name} Current"
    sensor_datapoint: 18
    accuracy_decimals: 2
    unit_of_measurement: "A"
    icon: "mdi:flash"
    filters:
    - multiply: 0.001
    
  - platform: "tuya"
    name: "${friendly_name} Power"
    sensor_datapoint: 19
    accuracy_decimals: 1
    unit_of_measurement: "W"
    icon: "mdi:flash"
    filters:
    - multiply: 0.1

  - platform: "tuya"
    name: "${friendly_name} Voltage"
    sensor_datapoint: 20
    unit_of_measurement: "V"
    accuracy_decimals: 1
    icon: "mdi:flash"
    filters:
    - multiply: 0.1

  - platform: "tuya"
    name: "${friendly_name} kWh +"
    sensor_datapoint: 101
    unit_of_measurement: "kWh"
    accuracy_decimals: 3
    icon: "mdi:flash"
    filters:
    - multiply: 0.01
    
  - platform: "tuya"
    name: "${friendly_name} kWh -"
    sensor_datapoint: 9
    unit_of_measurement: "kWh"
    accuracy_decimals: 3
    icon: "mdi:flash"
    filters:
    - multiply: 0.01
2 Likes

Could you add it here please? https://www.esphome-devices.com/

Yes sure, will do it tomorrow.

1 Like
3 Likes

Is it really 65A max rated? My house has a breaker of 40A, so can it hold the whole houses current?

Are you sure your whole house is protected by only a 40A MCB? Most houses in the UK will have a 80A or 100A supply, with a cutout fuse rated to this. The consumer unit would then normally have breakers for each circuit between 6A and 40A typically. If you wanted to put this before all circuits it would likely need to be rated at 100A. I have also got a 100a Tuya MCB from Aliexpress, i have not tried getting ESPHome on it yet.
As with all mains rated stuff from China, i would just be a bit cautious.

1 Like

Opened up the 100A MCB this evening and it has got the WR4 Module, based on the RTL8710BN chip, so not going to be able to flash.

I see that HiKing also make an identical looking zigbee breaker Hiking Single Phase 65A DIN Rail Energy Meter (DDS238-2) Zigbee compatibility

What about apparent power, reactive power, power factor, energy today, energy total, energy yesterday? If flashing Tasmota we get these values too. Does anybody know what other sensor_datapoint are available and what measurements can we get from them? I want to stay on ESPHome.

Thank you! Added this in ESPHome YAML and got the values.
Now, if you don’t mind, I still have one more question: which one do I have to add in HA’s energy configuration as total (from grid)?

your total sensor from device or if you use energy_tariffs then sensors from it for day and night.

I have a DDS238-7 , with 3 Phase, as a possivel get especify phase power, voltage ?

i also plan to get the 3phase wifi version, how would i add that one?