# Tuya Smart Plug

Quelle: https://docs.evcc.io/de/meters/tuya-smart-plug

Lokale Verbindung über das Tuya-Protokoll für Steckdosen mit Energiemessung (Apps: „Smart Life“, „Tuya“).
Device ID und Local Key müssen einmalig ermittelt werden, z. B. mit `tinytuya wizard`, das dafür ein Konto auf der Tuya-IoT-Plattform benötigt. Im Betrieb ist kein Cloud-Zugang nötig. Das Gerät erlaubt nur eine lokale Verbindung gleichzeitig, andere lokale Integrationen (z. B. LocalTuya, Tuya Local) müssen deaktiviert werden.

## Parameter

| Name | Beschreibung | Standard / Beispiel | |
| --- | --- | --- | --- |
| host | IP-Adresse oder Hostname | 192.0.2.2 |  |
| id | Device ID |  |  |
| localkey | Local Key |  |  |

## Konfigurationsbeispiel für evcc.yaml

```yaml
meters:
    - name: my_pv
      type: template
      template: tuya
      usage: pv
      host: 192.0.2.2 # IP-Adresse oder Hostname
      id: # Device ID
      localkey: # Local Key
```

```yaml
meters:
    - name: my_charger
      type: template
      template: tuya
      usage: charge
      host: 192.0.2.2 # IP-Adresse oder Hostname
      id: # Device ID
      localkey: # Local Key
```
