Use Hiking DDS238-2 ZN/S Energy Meter with Home Assistant

Hiking DDS238-2 ZN/S is a cheap €25 single phase energy meter which can measure import and export energy in addition to all the standard parameters, and has a Modbus interface over RS485.

Home Assistant energy dashboard using Hiking DDS238-2 energy meter
Home Assistant energy dashboard using Hiking DDS238-2 energy meter.

I used this Modbus registry information to create this device template for Home Assistant where the meter is attached to the Protoss PE11 RS485 to TCP gateway (available for €25) available on IP 123.123.123.123 which must be adjusted for your setup or switched to a serial config:

modbus:
  - name: Protoss PE11
    type: tcp
    host: 123.123.123.123
    port: 502
    timeout: 0.5
    sensors:

      - name: DDS238-2 ZN-S Total Energy
        device_class: energy
        state_class: total
        unit_of_measurement: kWh
        address: 0
        count: 2
        data_type: uint32
        scale: 0.01
        precision: 2

      - name: DDS238-2 ZN-S Export Energy
        device_class: energy
        state_class: total_increasing
        unit_of_measurement: kWh
        address: 8
        count: 2
        data_type: uint32
        scale: 0.01
        precision: 2
    
      - name: DDS238-2 ZN-S Import Energy
        device_class: energy
        state_class: total_increasing
        unit_of_measurement: kWh
        address: 10
        count: 2
        data_type: uint32
        scale: 0.01
        precision: 2

      - name: DDS238-2 ZN-S Voltage
        device_class: voltage
        unit_of_measurement: V
        address: 12
        data_type: uint16
        scale: 0.1
        precision: 1

      - name: DDS238-2 ZN-S Current
        device_class: current
        unit_of_measurement: A
        address: 13
        data_type: uint16
        scale: 0.01
        precision: 2

      - name: DDS238-2 ZN-S Power
        device_class: power
        data_type: int16
        unit_of_measurement: W
        address: 14
        
      - name: DDS238-2 ZN-S Reactive Power
        device_class: apparent_power
        data_type: uint16
        unit_of_measurement: VAr
        address: 15
        
      - name: DDS238-2 ZN-S Power Factor
        device_class: power_factor
        unit_of_measurement: '%'
        data_type: uint16
        address: 16
        scale: 0.1
        precision: 1

      - name: DDS238-2 ZN-S Frequency
        device_class: frequency
        unit_of_measurement: Hz
        data_type: uint16
        address: 17
        scale: 0.01
        precision: 2

3 Comments

  1. Evaldas says:

    Hello,
    very great to have found Your blog. I use the same energy meter dds238 in a Home Assistant, but there is no way to get data from it.
    I have a different RS485 to TCP / IP converter, I use Moxa.
    I tried to use your settings, but didn’t get anything. I used to use the MajoDoMo smart home system and it had modbus running on it, nothing happens on the HA even with the parameters you write. If you could take the time to look at where I have an error, or have advice on where to look for an error, I would be very grateful.

    MOXA MGate MB3180 web console settings:

    Ethernet IP address 192.168.1.190
    Mode RTU Slave
    Baud rate 9600
    Data bit 8
    Stop bit 1
    Flow control None
    FIFO disable
    Interface RS-485 2wire
    type Modbus serial

    configuration.yaml

    modbus:
      - name: moxa
        timeout: 5
        type: tcp
        host: 192.168.1.190
        port: 502
        sensors:
          - name: dds238_V
            slave: 1
            address: 12
            precision: 1
            data_type: uint16
            scale: 0.1
            unit_of_measurement: V
            device_class: voltage
    
    • Kaspars says:

      Were you able to confirm that MOXA can communicate with the device via RS-485 or that the TCP service for the particular RS485 connection is actually exposed on port 502?

  2. Kutilak says:

    For version DD238-2 ZN/SR (with relay) need to use array command for change register insted single register change command (holding = 0x06 and this is dont work but holdings = 0x10 and work great):

    switches:
          - name: DDS238-2 ZN-SR Relay
            write_type: holdings
            address: 26
    

Leave a Reply