# ioBroker

Source: https://docs.evcc.io/en/meters/iobroker

The `rest-api` adapter (not `simple-api`) must be installed on the ioBroker instance being used. It must be configured as an extension of a web adapter.
Authentication can only be performed using `basic` authentication. If no password is provided, no authentication will be performed.
When specifying the entities for the individual measured values, ensure that they are correctly URL-encoded.
For example, `shelly.0.SHEM-3#8CAAB561991E#1.Total.ConsumedPower` becomes `shelly.0.SHEM-3%238CAAB561991E%231.Total.ConsumedPower`

## Parameters

| Name | Description | Default / example | |
| --- | --- | --- | --- |
| uri | The full uri of the host to query HTTP(S) address | https://iobroker.homelab.lan:8082 |  |
| user | Username e.g. email address, user id, etc. |  |  |
| password | Password Service account password |  |  |
| power | Power |  W |  |
| soc | State of Charge |  % |  |
| 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 for grid charging. | 100 % |  |
| cache | Cache Time interval for data refresh | 5m | advanced |
| energy | Meter reading |  kWh | advanced |
| currentL1 | L1 current |  A | advanced |
| currentL2 | L2 current |  A | advanced |
| currentL3 | L3 current |  A | advanced |
| maxchargepower | Maximum charge power For forced charging of the battery. |  W | advanced |
| maxdischargepower | Maximum discharge power Maximum discharge power of the storage. |  W | advanced |
| maxacpower | Maximum AC power of the hybrid inverter | 0 W | advanced |

## Configuration example for evcc.yaml

```yaml
meters:
    - name: my_grid
      type: template
      template: iobroker
      usage: grid
      uri: https://iobroker.homelab.lan:8082 # The full uri of the host to query, HTTP(S) address
      user: # Username, e.g. email address, user id, etc. (optional)
      password: # Password, Service account password (optional)
      power: # Power (W), optional
      soc: # State of Charge (%), optional
      cache: 5m # Cache, Time interval for data refresh (optional)
      energy: # Meter reading (kWh), optional
      currentL1: # L1 current (A), optional
      currentL2: # L2 current (A), optional
      currentL3: # L3 current (A), optional
```

```yaml
meters:
    - name: my_pv
      type: template
      template: iobroker
      usage: pv
      uri: https://iobroker.homelab.lan:8082 # The full uri of the host to query, HTTP(S) address
      user: # Username, e.g. email address, user id, etc. (optional)
      password: # Password, Service account password (optional)
      power: # Power (W), optional
      soc: # State of Charge (%), optional
      cache: 5m # Cache, Time interval for data refresh (optional)
      energy: # Meter reading (kWh), optional
      currentL1: # L1 current (A), optional
      currentL2: # L2 current (A), optional
      currentL3: # L3 current (A), optional
      maxacpower: 0 # Maximum AC power of the hybrid inverter (W), optional
```

```yaml
meters:
    - name: my_battery
      type: template
      template: iobroker
      usage: battery
      uri: https://iobroker.homelab.lan:8082 # The full uri of the host to query, HTTP(S) address
      user: # Username, e.g. email address, user id, etc. (optional)
      password: # Password, Service account password (optional)
      power: # Power (W), optional
      soc: # State of Charge (%), optional
      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 for grid charging. (optional)
      cache: 5m # Cache, Time interval for data refresh (optional)
      energy: # Meter reading (kWh), optional
      currentL1: # L1 current (A), optional
      currentL2: # L2 current (A), optional
      currentL3: # L3 current (A), optional
      maxchargepower: # Maximum charge power (W), For forced charging of the battery. (optional)
      maxdischargepower: # Maximum discharge power (W), Maximum discharge power of the storage. (optional)
```

```yaml
meters:
    - name: my_charger
      type: template
      template: iobroker
      usage: charge
      uri: https://iobroker.homelab.lan:8082 # The full uri of the host to query, HTTP(S) address
      user: # Username, e.g. email address, user id, etc. (optional)
      password: # Password, Service account password (optional)
      power: # Power (W), optional
      soc: # State of Charge (%), optional
      cache: 5m # Cache, Time interval for data refresh (optional)
      energy: # Meter reading (kWh), optional
      currentL1: # L1 current (A), optional
      currentL2: # L2 current (A), optional
      currentL3: # L3 current (A), optional
```
