Skip to content

Commit

Permalink
Add HTTP provider with jq ability (#72)
Browse files Browse the repository at this point in the history
  • Loading branch information
andig committed Apr 30, 2020
1 parent 532e6bd commit e809c4d
Show file tree
Hide file tree
Showing 7 changed files with 265 additions and 42 deletions.
41 changes: 31 additions & 10 deletions README.md
Expand Up @@ -21,20 +21,19 @@ EVCC is an extensible EV Charge Controller with PV integration implemented in [G
## Index

- [Installation](#installation)
- [Configuration](#configuration)
- [Charge Modes](#charge-modes)
- [PV generator configuration](#pv-generator-configuration)
- [Charger configuration](#charger-configuration)
- [General concepts](#general-concepts)
- [Charge modes](#charge-modes)
- [PV generator setup](#pv-generator-setup)
- [Charger setup](#charger-setup)
- [Configuration](#configuration)
- [Charger](#charger)
- [Wallbe hardware preparation](#wallbe-hardware-preparation)
- [OpenWB slave mode](#openwb-slave-mode)
- [Meter](#meter)
- [Vehicle](#vehicle)
- [Plugins](#plugins)
- [Modbus](#modbus-read-only)
- [MQTT](#mqtt-readwrite)
- [Script](#script-readwrite)
- [HTTP](#http-readwrite)
- [Combined status](#combined-status-read-only)
- [Developer](#developer)
- [Background](#background)
Expand Down Expand Up @@ -70,9 +69,9 @@ To build EVCC from source, [Go](2) 1.13 is required:
EVCC requires a supported charger and a combination of grid, PV and charge meter.
All components **must** be installed by a certified professional.

## Configuration
## General concepts

### Charge Modes
### Charge modes

Multiple charge modes are supported:

Expand All @@ -83,7 +82,7 @@ Multiple charge modes are supported:

In general, due to the minimum value of 5% for signalling the EV duty cycle, the charger cannot limit the current to below 6A. If the available power calculation demands a limit less than 6A, handling depends on the charge mode. In **PV** mode, the charger will be disabled until available PV power supports charging with at least 6A. In **Min + PV** mode, charging will continue at minimum current of 6A and charge current will be raised as PV power becomes available again.

### PV generator configuration
### PV generator setup

For both PV modes, EVCC needs to assess how much residual PV power is available at the grid connection point and how much power the charger actually uses. Various methods are implemented to obtain this information, with different degrees of accuracy.

Expand Down Expand Up @@ -111,7 +110,7 @@ For both PV modes, EVCC needs to assess how much residual PV power is available

The *battery meter* is expected to deliver negative values when charging, positives values signal discharging and are ignored.

### Charger configuration
### Charger setup

When using a *grid meter* for accurate control of PV utilization, EVCC needs to be able to determine the current charge power. There are two configurations for determining the *current charge power*:

Expand Down Expand Up @@ -320,6 +319,28 @@ cmd: /home/user/my-script.sh ${enable:%b} # format boolean enable as 0/1
timeout: 5s
```

### HTTP (read/write)

The `http` plugin executes HTTP requests to read or update data. Includes the ability to read and parse JSON using jq-like queries.

Sample read configuration:

```yaml
type: http
uri: https://volkszaehler/api/data/<uuid>.json?from=now
method: GET # default HTTP method
headers:
- content-type: application/json
jq: .data.tuples[0][1] # parse response json
```

Sample write configuration:

```yaml
...
body: %v # only applicable for PUT or POST requests
```

### Combined status (read only)

The `combined` status plugin is used to convert a mixed boolean status of plugged/charging into an EVCC-compatible charger status of A..F. It is typically used together with OpenWB MQTT integration.
Expand Down
1 change: 1 addition & 0 deletions go.mod
Expand Up @@ -15,6 +15,7 @@ require (
github.com/gregdel/pushover v0.0.0-20200330145937-ee607c681498
github.com/grid-x/modbus v0.0.0-20200108122021-57d05a9f1e1a
github.com/influxdata/influxdb1-client v0.0.0-20191209144304-8bf82d3c094d
github.com/itchyny/gojq v0.10.1
github.com/joeshaw/carwings v0.0.0-20191118152321-61b46581307a
github.com/jsgoecke/tesla v0.0.0-20190206234002-112508e1374e
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51
Expand Down

0 comments on commit e809c4d

Please sign in to comment.