Skip to content

Commit

Permalink
[goecharger] Added maxCurrTemp, tma1, tma2 and powerAll
Browse files Browse the repository at this point in the history
Added changes
- replacing usage of tmp to tma1 and tma2
- new field powerAll for combined power of 3 phases
- new field maxCurrTemp to use the non-EEPROM value for max. current (amx)
- maxCurrent is still available (amp)
  • Loading branch information
chilobo committed Jun 17, 2021
1 parent 98a04d3 commit 0bffd03
Show file tree
Hide file tree
Showing 6 changed files with 44 additions and 11 deletions.
22 changes: 14 additions & 8 deletions bundles/org.openhab.binding.goecharger/README.md
Expand Up @@ -22,6 +22,7 @@ Currently available channels are
| Channel ID | Item Type | Description |
|--------------------------|--------------------------|---------------------------------------------------------------|
| maxCurrent | Number:ElectricCurrent | Maximum current allowed to use for charging |
| maxCurrTemp | Number:ElectricCurrent | Maximum current temporary (not written to EEPROM) |
| pwmSignal | String | Signal status for PWM signal |
| error | String | Error code of charger |
| voltageL1 | Number:ElectricPotential | Voltage on L1 |
Expand All @@ -33,16 +34,19 @@ Currently available channels are
| powerL1 | Number:Power | Power on L1 |
| powerL2 | Number:Power | Power on L2 |
| powerL3 | Number:Power | Power on L2 |
| powerAll | Number:Power | Power over all three phases |
| phases | Number | Amount of phases currently used for charging |
| sessionChargeEnergyLimit | Number:Energy | Wallbox stops charging after defined value, disable with 0 |
| sessionChargedEnergy | Number:Energy | Amount of energy that has been charged in this session |
| totalChargedEnergy | Number:Energy | Amount of energy that has been charged since installation |
| allowCharging | Switch | If `ON` charging is allowed |
| cableCurrent | Number:ElectricCurrent | Specifies the max current that can be charged with that cable |
| temperature | Number:Temperature | Temperature of the Go-eCharger |
| temptma1 | Number:Temperature | Temperature 1 of the Go-eCharger |
| temptma1 | Number:Temperature | Temperature 2 of the Go-eCharger |
| firmware | String | Firmware Version |
| accessConfiguration | String | Access configuration, for example OPEN, RFID ... |


## Full Example

demo.things
Expand All @@ -55,6 +59,7 @@ demo.items

```
Number:ElectricCurrent GoEChargerMaxCurrent "Maximum current" {channel="goecharger:goe:garage:maxCurrent"}
Number:ElectricCurrent GoEChargerMaxCurrTemp "Maximum current temporary" {channel="goecharger:goe:garage:maxCurrentTemp"}
String GoEChargerPwmSignal "Pwm signal status" {channel="goecharger:goe:garage:pwmSignal"}
String GoEChargerError "Error code" {channel="goecharger:goe:garage:error"}
Number:ElectricPotential GoEChargerVoltageL1 "Voltage l1" {channel="goecharger:goe:garage:voltageL1"}
Expand All @@ -78,12 +83,6 @@ Number:Temperature GoEChargertemptma1 "Temperature_tma
String GoEChargerFirmware "Firmware" {channel="goecharger:goe:garage:firmware"}
String GoEChargerAccessConfiguration "Access configuration" {channel="goecharger:goe:garage:accessConfiguration"}
```
Changes 13.06.21:
Temperature is not supported any more, GO-E added two temperatures tma1 and tma2.

Added channel "Power over all" showing the combinde power of all three phases


## Setting charge current of Go-eCharger based on photovoltaik output

You can easily define rules to charge with PV power alone.
Expand All @@ -95,9 +94,16 @@ when
Item availablePVCurrent received update
then
logInfo("Amps available: ", receivedCommand.state)
MaxAmpere.sendCommand(receivedCommand.state)
MaxCurrTemp.sendCommand(receivedCommand.state)
end
```
You can also define more advanced rules if you have multiple cars that charge with a different amount of phases.
For example if your car charges on one phase only, you can set maxAmps to output of PV power, if your car charges on two phases you can set maxAmps to `pv output / 2`, and for 3 phases `pv output / 3`.
In general the calculation would be ´maxAmps = pvOutput / phases`.

Changes 06.21 (chilobo):
Since V3 of the GO-E-Charger Temperature is not supported any more, GO-E added two temperatures tma1 and tma2.
Added channel "Power over all" showing the combined power of all three phases
Added channel "Maximum current temporary": This changes the current. But this value is not written to the EEPROM.

Beware: Because of changes in V3 this binding is working for V1 and V2, but not for V3.
Binary file not shown.
Expand Up @@ -31,6 +31,7 @@ public class GoEChargerBindingConstants {

// List of all Channel ids
public static final String MAX_CURRENT = "maxCurrent";
public static final String MAX_CURR_TEMP = "maxCurrTemp";
public static final String ACCESS_CONFIGURATION = "accessConfiguration";
public static final String PWM_SIGNAL = "pwmSignal";
public static final String ERROR = "error";
Expand All @@ -53,7 +54,6 @@ public class GoEChargerBindingConstants {
public static final String SESSION_CHARGE_CONSUMPTION_LIMIT = "sessionChargeEnergyLimit";
public static final String TOTAL_CONSUMPTION = "totalChargedEnergy";
public static final String FIRMWARE = "firmware";

public static final String API_URL = "http://%IP%/status";
public static final String MQTT_URL = "http://%IP%/mqtt?payload=%KEY%=%VALUE%";
}
Expand Up @@ -30,9 +30,12 @@ public class GoEStatusResponseDTO {
@SerializedName("ast")
public Integer accessConfiguration;

@SerializedName("amx")
@SerializedName("amp")
public Integer maxCurrent;

@SerializedName("amx")
public Integer maxCurrTemp;

@SerializedName("nrg")
public Integer[] energy;

Expand Down
Expand Up @@ -21,6 +21,7 @@
import static org.openhab.binding.goecharger.internal.GoEChargerBindingConstants.ERROR;
import static org.openhab.binding.goecharger.internal.GoEChargerBindingConstants.FIRMWARE;
import static org.openhab.binding.goecharger.internal.GoEChargerBindingConstants.MAX_CURRENT;
import static org.openhab.binding.goecharger.internal.GoEChargerBindingConstants.MAX_CURR_TEMP;
import static org.openhab.binding.goecharger.internal.GoEChargerBindingConstants.PHASES;
import static org.openhab.binding.goecharger.internal.GoEChargerBindingConstants.POWER_ALL;
import static org.openhab.binding.goecharger.internal.GoEChargerBindingConstants.POWER_L1;
Expand Down Expand Up @@ -110,6 +111,13 @@ private State getValue(String channelId, GoEStatusResponseDTO goeResponse) {
return UnDefType.UNDEF;
}
return new QuantityType<>(goeResponse.maxCurrent, Units.AMPERE);
case MAX_CURR_TEMP:
if (goeResponse.maxCurrTemp == null) {
return UnDefType.UNDEF;
}
logger.debug("MAX_CURR_TEMP, amx ?", goeResponse.maxCurrTemp);

return new QuantityType<>(goeResponse.maxCurrTemp, Units.AMPERE);
case PWM_SIGNAL:
if (goeResponse.pwmSignal == null) {
return UnDefType.UNDEF;
Expand Down Expand Up @@ -283,7 +291,7 @@ private State getValue(String channelId, GoEStatusResponseDTO goeResponse) {
if (goeResponse.energy == null) {
return UnDefType.UNDEF;
}
return new QuantityType<>(goeResponse.energy[11] * 100, Units.WATT);
return new QuantityType<>(goeResponse.energy[11] * 10, Units.WATT);
}
return UnDefType.UNDEF;
}
Expand All @@ -300,6 +308,14 @@ public void handleCommand(ChannelUID channelUID, Command command) {
String value = null;
switch (channelUID.getId()) {
case MAX_CURRENT:
key = "amp";
if (command instanceof DecimalType) {
value = String.valueOf(((DecimalType) command).intValue());
} else if (command instanceof QuantityType<?>) {
value = String.valueOf(((QuantityType<ElectricCurrent>) command).toUnit(Units.AMPERE).intValue());
}
break;
case MAX_CURR_TEMP:
key = "amx";
if (command instanceof DecimalType) {
value = String.valueOf(((DecimalType) command).intValue());
Expand Down Expand Up @@ -345,6 +361,7 @@ public void handleCommand(ChannelUID channelUID, Command command) {
default:
}
if (key != null && value != null) {
logger.debug("sendData: ", key, value);
sendData(key, value);
} else {
logger.warn("Could not update channel {} with key {} and value {}", channelUID.getId(), key, value);
Expand Down
Expand Up @@ -10,6 +10,7 @@

<channels>
<channel id="maxCurrent" typeId="current"/>
<channel id="maxCurrTemp" typeId="amx"/>
<channel id="pwmSignal" typeId="pwm"/>
<channel id="error" typeId="err"/>
<channel id="voltageL1" typeId="vl1"/>
Expand Down Expand Up @@ -67,6 +68,12 @@
<description>Maximum current per phase allowed to use for charging</description>
<state pattern="%d %unit%" readOnly="false"/>
</channel-type>
<channel-type id="amx">
<item-type>Number:ElectricCurrent</item-type>
<label>Maximum Current Temporary</label>
<description>Maximum current per phase not stored in EEPROM</description>
<state pattern="%d %unit%" readOnly="false"/>
</channel-type>
<channel-type id="pwm">
<item-type>String</item-type>
<label>PWM signal status</label>
Expand Down

0 comments on commit 0bffd03

Please sign in to comment.