# enecess ecoMain

Source: https://docs.evcc.io/en/meters/enecess-ecomain

Grid metering uses the ecoMain main circuit; PV, charging, and auxiliary metering can use branch channels on the ecoMain or an ecoSub.

Requires ecoMain firmware 139 or later.

## Parameters

| Name | Description | Default / example | |
| --- | --- | --- | --- |
| modbus | Modbus Type (tcpip) |  |  |
| phasecount | Number of phases For single-phase metering, configure phase 1 only. For three-phase metering, also configure phases 2 and 3. (1, 3) | 1 |  |
| device1 | Device (phase 1) Selects the device to which the CT for phase 1 is connected. 0 = ecoMain, 1–3 = ecoSub. (0, 1, 2, 3) | 0 |  |
| channel1 | Meter channel (phase 1) Selects the meter channel to which the CT for phase 1 is connected. (1, 2, 3, 4, 5, 6, 7, 8, 9, 10) | 1 |  |
| invert1 | Invert direction (phase 1) Enable if the power for phase 1 is measured with the opposite sign. | false |  |
| device2 | Device (phase 2) Only required for three-phase measurement.  Selects the device to which the CT for phase 2 is connected. 0 = ecoMain, 1–3 = ecoSub. (0, 1, 2, 3) | 0 |  |
| channel2 | Meter channel (phase 2) Only required for three-phase measurement.  Selects the meter channel to which the CT for phase 2 is connected. (1, 2, 3, 4, 5, 6, 7, 8, 9, 10) | 2 |  |
| invert2 | Invert direction (phase 2) Enable if the power for phase 2 is measured with the opposite sign. | false |  |
| device3 | Device (phase 3) Only required for three-phase measurement.  Selects the device to which the CT for phase 3 is connected. 0 = ecoMain, 1–3 = ecoSub. (0, 1, 2, 3) | 0 |  |
| channel3 | Meter channel (phase 3) Only required for three-phase measurement.  Selects the meter channel to which the CT for phase 3 is connected. (1, 2, 3, 4, 5, 6, 7, 8, 9, 10) | 3 |  |
| invert3 | Invert direction (phase 3) Enable if the power for phase 3 is measured with the opposite sign. | false |  |

## Configuration example for evcc.yaml

```yaml
meters:
    - name: my_grid
      type: template
      template: enecess-ecomain
      usage: grid
      
      # Modbus TCP
      modbus: tcpip
      id: 255
      host:  # Hostname
      port: 502 # Port
```

```yaml
meters:
    - name: my_pv
      type: template
      template: enecess-ecomain
      usage: pv
      
      # Modbus TCP
      modbus: tcpip
      id: 255
      host:  # Hostname
      port: 502 # Port
      phasecount: 1 # Number of phases, For single-phase metering, configure phase 1 only. For three-phase metering, also configure phases 2 and 3. [1, 3]
      device1: 0 # Device (phase 1), Selects the device to which the CT for phase 1 is connected. 0 = ecoMain, 1–3 = ecoSub. [0, 1, 2, 3]
      channel1: 1 # Meter channel (phase 1), Selects the meter channel to which the CT for phase 1 is connected. [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
      invert1: false # Invert direction (phase 1), Enable if the power for phase 1 is measured with the opposite sign. (optional)
      device2: 0 # Device (phase 2), Only required for three-phase measurement.  Selects the device to which the CT for phase 2 is connected. 0 = ecoMain, 1–3 = ecoSub. [0, 1, 2, 3] (optional)
      channel2: 2 # Meter channel (phase 2), Only required for three-phase measurement.  Selects the meter channel to which the CT for phase 2 is connected. [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] (optional)
      invert2: false # Invert direction (phase 2), Enable if the power for phase 2 is measured with the opposite sign. (optional)
      device3: 0 # Device (phase 3), Only required for three-phase measurement.  Selects the device to which the CT for phase 3 is connected. 0 = ecoMain, 1–3 = ecoSub. [0, 1, 2, 3] (optional)
      channel3: 3 # Meter channel (phase 3), Only required for three-phase measurement.  Selects the meter channel to which the CT for phase 3 is connected. [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] (optional)
      invert3: false # Invert direction (phase 3), Enable if the power for phase 3 is measured with the opposite sign. (optional)
```

```yaml
meters:
    - name: my_charger
      type: template
      template: enecess-ecomain
      usage: charge
      
      # Modbus TCP
      modbus: tcpip
      id: 255
      host:  # Hostname
      port: 502 # Port
      phasecount: 1 # Number of phases, For single-phase metering, configure phase 1 only. For three-phase metering, also configure phases 2 and 3. [1, 3]
      device1: 0 # Device (phase 1), Selects the device to which the CT for phase 1 is connected. 0 = ecoMain, 1–3 = ecoSub. [0, 1, 2, 3]
      channel1: 1 # Meter channel (phase 1), Selects the meter channel to which the CT for phase 1 is connected. [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
      invert1: false # Invert direction (phase 1), Enable if the power for phase 1 is measured with the opposite sign. (optional)
      device2: 0 # Device (phase 2), Only required for three-phase measurement.  Selects the device to which the CT for phase 2 is connected. 0 = ecoMain, 1–3 = ecoSub. [0, 1, 2, 3] (optional)
      channel2: 2 # Meter channel (phase 2), Only required for three-phase measurement.  Selects the meter channel to which the CT for phase 2 is connected. [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] (optional)
      invert2: false # Invert direction (phase 2), Enable if the power for phase 2 is measured with the opposite sign. (optional)
      device3: 0 # Device (phase 3), Only required for three-phase measurement.  Selects the device to which the CT for phase 3 is connected. 0 = ecoMain, 1–3 = ecoSub. [0, 1, 2, 3] (optional)
      channel3: 3 # Meter channel (phase 3), Only required for three-phase measurement.  Selects the meter channel to which the CT for phase 3 is connected. [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] (optional)
      invert3: false # Invert direction (phase 3), Enable if the power for phase 3 is measured with the opposite sign. (optional)
```

```yaml
meters:
    - name: my_aux
      type: template
      template: enecess-ecomain
      usage: aux
      
      # Modbus TCP
      modbus: tcpip
      id: 255
      host:  # Hostname
      port: 502 # Port
      phasecount: 1 # Number of phases, For single-phase metering, configure phase 1 only. For three-phase metering, also configure phases 2 and 3. [1, 3]
      device1: 0 # Device (phase 1), Selects the device to which the CT for phase 1 is connected. 0 = ecoMain, 1–3 = ecoSub. [0, 1, 2, 3]
      channel1: 1 # Meter channel (phase 1), Selects the meter channel to which the CT for phase 1 is connected. [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
      invert1: false # Invert direction (phase 1), Enable if the power for phase 1 is measured with the opposite sign. (optional)
      device2: 0 # Device (phase 2), Only required for three-phase measurement.  Selects the device to which the CT for phase 2 is connected. 0 = ecoMain, 1–3 = ecoSub. [0, 1, 2, 3] (optional)
      channel2: 2 # Meter channel (phase 2), Only required for three-phase measurement.  Selects the meter channel to which the CT for phase 2 is connected. [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] (optional)
      invert2: false # Invert direction (phase 2), Enable if the power for phase 2 is measured with the opposite sign. (optional)
      device3: 0 # Device (phase 3), Only required for three-phase measurement.  Selects the device to which the CT for phase 3 is connected. 0 = ecoMain, 1–3 = ecoSub. [0, 1, 2, 3] (optional)
      channel3: 3 # Meter channel (phase 3), Only required for three-phase measurement.  Selects the meter channel to which the CT for phase 3 is connected. [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] (optional)
      invert3: false # Invert direction (phase 3), Enable if the power for phase 3 is measured with the opposite sign. (optional)
```
