i want to use the go-e charger to charge my EV with electricity from my photovoltaik system. Openhab should control the max current of the wallbox, so the car uses as much electricity from the sun as possible.
Therefor i want to create a binding, so others benefit from this as well. I already had a look at the fronius binding, which also gets data from a http API in json format. The go-e charger also has a REST API that can be used to control it. So i guess the easiest way to create a binding for this is to orientate on that binding.
API description:
Specs of charger:
What do you guys think? Does it make sense to create an own binding for this or is this a bit overkill because i can just use the http binding for this?
There is a MQTT and a REST API available, what do you think is the better choice?
Number MaxAmpere "Max ampere" {channel="goecharger:goe:garage:maxAmpere"}
Number PwmSignal "Pwm signal status" {channel="goecharger:goe:garage:pwmSignal"}
String Error "Error code" {channel="goecharger:goe:garage:error"}
Number VoltageL1 "Voltage l1" {channel="goecharger:goe:garage:voltageL1"}
Number VoltageL2 "Voltage l2" {channel="goecharger:goe:garage:voltageL2"}
Number VoltageL3 "Voltage l3" {channel="goecharger:goe:garage:voltageL3"}
Number CurrentL1 "Current l1" {channel="goecharger:goe:garage:currentL1"}
Number CurrentL2 "Current l2" {channel="goecharger:goe:garage:currentL2"}
Number CurrentL3 "Current l3" {channel="goecharger:goe:garage:currentL3"}
Number PowerL1 "Power l1" {channel="goecharger:goe:garage:powerL1"}
Number PowerL2 "Power l2" {channel="goecharger:goe:garage:powerL2"}
Number PowerL3 "Power l3" {channel="goecharger:goe:garage:powerL3"}
Number Phases "Phases" {channel="goecharger:goe:garage:phases"}
Number SessionChargeConsumptionLimit "Current session charge limit" {channel="goecharger:goe:garage:sessionChargeConsumptionLimit"}
Number SessionChargeConsumption "Current session charge amount" {channel="goecharger:goe:garage:sessionChargeConsumption"}
Switch AllowCharging "Allow charging" {channel="goecharger:goe:garage:allowCharging"}
Number CableEncoding "Cable encoding" {channel="goecharger:goe:garage:cableEncoding"}
Number Temperature "Temperature" {channel="goecharger:goe:garage:temperature"}
String Firmware "Firmware" {channel="goecharger:goe:garage:firmware"}
Number TotalConsumption "Total charge amount" {channel="goecharger:goe:garage:totalConsumption"}
Values of the binding can be used as always for example to set max amps from PV:
rule "Set max amps for PV charging"
when
Item availablePVCurrent received update
then
logInfo("Amps available: ", receivedCommand.toString)
MaxAmpere.sendCommand(receivedCommand.toString) // maybe more advanced logic
end
I can provide a first version of the addon as .jar for testing, however everything is implemented using a mock server, my goe charger will arrive next week.
i attached a zip file with the binding.jar to the github pull request linked above. You need to extract it and put the .jar to /usr/share/openhab2/addons.
If you take the samples from above, you already should see values, if i implemented the API correctly. If you use the vscode plugin you can also generate the items with vscode.
My PV-System will be installed in april/may, but it currently looks like it will be Fronius. Will use this Binding for it:
Will request the data every 5s or so, should be close enough.
BTW phases is calculated based on energy readings from Go-eCharger. If the energy meter in the wallbox says for example phase 1+2 have 220V and phase 3 0V i know that the car charges on two phases. This might be important, if you have different cars. For example my Ioniq charges 32A single phase, my eUP 16A dual phase. With phasesyou can then individually control the max amps and you have one rule for all cars.
For example:
Ioniq: max 32A 1 phase <- 7.4kW
eUP: max 16A 2 phases <- 7,4kW together
other car max 11A 3 phases <- 7,6kW together
If your PV system produces 8kW and you want to charge your car with full power, depending on phases your car can charge with the max amps need to be calculated dynamically.
In Amps formula would be something like
maxAmpsPerPhase = currentAmpsInverter / phases
I just tested it with a real device. Most things directly worked, had to adjust some others. I updated the .jar in the PR. It should now work correctly with the values mentioned above.
Hi, eventually i will add the other params as well, but for now i just added those, that are really relevant for pv based charging. Depending on the speed of the reviewers i might be able to add more items, however that is not my top prio right now. I just uploaded a new jar with some enhancedments to the github PR, can you please try that one also?
Guess you have no general understanding of Openhab yet, so maybe first try to learn how to setup things and items via files. This binding is not configured in the UI but with .thing and .items file as stated in the docs:
Go to your Openhab config folder and create a .item in the items folder and a .thing in things folder as described in the documentation.
You really should look into how to use Openhab and for what and so on. You can do a lot of things now and nothing of it is specific to one binding. All things you find about bindings and what you can do with them apply to almost all bindings including go-eCharger binding.
Now you can create rules or monitor stats or send notifications based on readings and so on.