# Huawei SmartAssistant (EMMA)

Source: https://docs.evcc.io/en/meters/huawei-smartassistant-emma

Modbus TCP has to be enabled on the EMMA with the installer account in the FusionSolar app (Commission device, Communication settings, Modbus TCP). The EMMA answers at unit ID 0, which the template uses.

The EMMA accepts a single Modbus TCP client at a time; further connections are reset. To share it with other systems, e.g. Home Assistant, use the [Modbus proxy](https://docs.evcc.io/en/reference/configuration/modbusproxy) of evcc.

The battery readings of the EMMA are read-only. For active battery control, configure the battery with the SUN2000 Hybrid template instead, using the address of the EMMA and the unit ID of the inverter: the EMMA forwards these requests to the inverter. The unit ID is assigned dynamically and can be found in FusionSolar or by trial. When evcc controls the battery, disable the EMMA's own AI energy optimization in the FusionSolar app and leave it in maximum self-consumption mode: only one system should schedule the battery.

## Parameters

| Name | Description | Default / example | |
| --- | --- | --- | --- |
| modbus | Modbus Type (tcpip) |  |  |
| capacity | Battery capacity | 50 kWh |  |
| minsoc | Minimum charge Lower limit as configured on the battery system. Used by optimizer. | 0 % |  |
| maxsoc | Maximum charge Upper limit as configured on the battery system. Used by optimizer and, on some devices, for grid charging. | 100 % |  |
| maxchargepower | Maximum charge power Highest power the battery system can charge with. The optimizer plans with charging up to this power. Some devices also use it as grid charging power. |  W | advanced |
| maxdischargepower | Maximum discharge power Highest power the battery system can discharge with. The optimizer plans with discharging up to this power. Smart mode assumes the battery supplies at most this power to vehicle charging. |  W | advanced |

## Configuration example for evcc.yaml

```yaml
meters:
    - name: my_grid
      type: template
      template: huawei-emma
      usage: grid
      
      # Modbus TCP
      modbus: tcpip
      id: 1
      host:  # Hostname
      port: 502 # Port
```

```yaml
meters:
    - name: my_pv
      type: template
      template: huawei-emma
      usage: pv
      
      # Modbus TCP
      modbus: tcpip
      id: 1
      host:  # Hostname
      port: 502 # Port
```

```yaml
meters:
    - name: my_battery
      type: template
      template: huawei-emma
      usage: battery
      
      # Modbus TCP
      modbus: tcpip
      id: 1
      host:  # Hostname
      port: 502 # Port
      capacity: 50 # Battery capacity (kWh), optional
      minsoc: 0 # Minimum charge (%), Lower limit as configured on the battery system. Used by optimizer. (optional)
      maxsoc: 100 # Maximum charge (%), Upper limit as configured on the battery system. Used by optimizer and, on some devices, for grid charging. (optional)
      maxchargepower: # Maximum charge power (W), Highest power the battery system can charge with. The optimizer plans with charging up to this power. Some devices also use it as grid charging power. (optional)
      maxdischargepower: # Maximum discharge power (W), Highest power the battery system can discharge with. The optimizer plans with discharging up to this power. Smart mode assumes the battery supplies at most this power to vehicle charging. (optional)
```
