Skip to content

syssi/homeassistant-goecharger-mqtt

Repository files navigation

homeassistant-goecharger-mqtt

GitHub actions GitHub actions GitHub actions GitHub stars GitHub forks GitHub watchers "Buy Me A Coffee"

This is a custom component for Home Assistant to integrate the go-eCharger HOME+, HOMEfix and Gemini using the MQTT API (v2). If you are using the go-eController there's another project covering that.

Lovelace entities card

Setup and Configuration

  1. Use HACS to install this custom component
  2. Restart HA
  3. Make sure you have an MQTT Broker (e.g. Mosquitto broker) and a working MQTT integration in HA
  4. (Recommended) Access to messages on MQTT Broker via client such as MQTT Explorer
  5. Enable the MQTT API of your charger at the go-eCharger App
    • Internet -> Advanced settings -> scroll to bottom -> Enable MQTT API (See also here)
    • at the field URL enter your MQTT broker URL, e.g. mqtt://192.168.178.3:1883 for a broker running on a server with IP 192.168.178.3 on default port 1883 alt text
    • (optional) Add MQTT keys and certificates as needed
    • Press the SAVE symbol in the top right to apply the settings
  6. (Optional) Make sure you see a new topic on the MQTT broker using your MQTT client
    • New messages appear under go-eCharger/[your serial number]/
  7. In HA, add new integration
    • Settings -> Devices & services -> ADD INTEGRATION -> go-eCharger (MQTT)
    • enter serial number (6 digits) of your device (find via App or MQTT client)
    • make sure base topic matches what you see in the MQTT broker, in some cases the default /go-eCharger has to be changed to go-eCharger
  8. See your go-e data pour into HA

Entities

Binary sensors

Topic Friendly name Category Enabled per default Supported Unsupported reason
car Car connected diagnostic ✔️ ✔️
pha Phase L1 after contactor diagnostic ✔️
pha Phase L2 after contactor diagnostic ✔️
pha Phase L3 after contactor diagnostic ✔️
pha Phase L1 before contactor diagnostic ✔️
pha Phase L2 before contactor diagnostic ✔️
pha Phase L3 before contactor diagnostic ✔️
cca Cloud websocket use client auth config 1
ocuca OTA cloud use client auth config 1
sbe Secure boot enabled 1
adi 16A adapter attached diagnostic ✔️ ✔️
cpe Charge control requests the cp signal enabled or not immediately diagnostic 1
cpr CP enable request diagnostic 1
cws Cloud websocket started diagnostic 1
cwsc Cloud websocket connected diagnostic 1
fsp Force single phase diagnostic ✔️ ✔️ Is always false. Please use psm instead
lwcf Last failed WiFi connect diagnostic 1
tlf Test charging finished diagnostic 1
tls Test charging started diagnostic 1
sua Simulate unplugging permanently config 1

Buttons

Topic Friendly name Category Enabled per default Supported Unsupported reason
rst Restart device config ✔️ ✔️
frc Force state neutral config ✔️
frc Force state dont charge config ✔️
frc Force state charge config ✔️

Sensors

Key Friendly name Category Unit Enabled per default Supported Unsupported reason
+/result Last set config key result config ✔️ ✔️
ama Maximum current limit config A ✔️ ✔️
ate Automatic stop energy config Wh ✔️ ✔️
att Automatic stop time config s ✔️ ✔️
awc Awattar country config 1
awp Awattar maximum price threshold config ¢ ✔️
cch Color charging config ✔️
cco Car consumption config App only
cfi Color finished config ✔️
cid Color idle config ✔️
clp Current limit presets config A ✔️
ct Car type config App only
cwc Color wait for car config ✔️
fna Friendly name config 1
frc Force state config ✔️ ✔️
frc Force state code config ✔️
lbr LED brightness config ✔️
lmo Logic mode config ✔️ ✔️
lof Load balancing fallback current config A 1
log Load balancing group id config 1
lop Load balancing priority config 1
lot Load balancing total ampere config A 1
loty Load balancing type config 1
map Load mapping config 1
mca Minimum charging current config A ✔️ ✔️
mci Minimum charging interval config ms 1
mcpd Minimum charge pause duration config ms 1
mptwt Minimum phase toggle wait time config ms 1
mpwst Minimum phase wish switch time config ms 1
pass User password config 1
psmd Force single phase duration config ms 1
sch_satur Scheduler saturday config 1
sch_sund Scheduler sunday config 1
sch_week Scheduler weekday config 1
spl3 Three phase switch level config W ✔️ ✔️
sumd Simulate unplugging duration config ms 1
tds Timezone daylight saving mode config 1
tof Timezone offset in minutes config 1
ts Time server config 1
tssi Time server sync interval config 1
tssm Time server sync mode config 1
tsss Time server sync status config 1
ust Cable unlock mode config ✔️ ✔️
ust Cable unlock mode code config ✔️
wak WiFi accesspoint encryption key config 1
wan WiFi accesspoint network name config 1
wifis WiFi configurations config 1
apd Firmware description 1
arv App recommended version 1
ecf ESP CPU frequency 1
eci ESP Chip info 1
eem ESP CPU frequency 1
efi ESP Flash info 1
facwak WiFi accesspoint key reset value 1
fem Flash encryption mode 1
ffna Factory friendly name 1
fwan Factory WiFi accesspoint network name 1
fwc Firmware from car control 1
fwv Firmware version ✔️
mod Hardware version 1
oem Manufacturer 1
otap Active OTA partition 1
part Partition table 1
pto Partition table offset in flash 1
sse Serial number 1
typ Device type 1
var Device variant kW ✔️
del Delete card config 1
delw Delete STA config config 1
lrn Learn card config 1
oct Firmware update trigger config 1
acu Maximum allowed current diagnostic A ✔️ ✔️
amt Current temperature limit diagnostic °C ✔️ ✔️
atp Next trip plan data diagnostic 1
awcp Awattar current price diagnostic ¢ ✔️
awpl Awattar price list diagnostic 1
car Car state diagnostic ✔️ ✔️
cbl Cable maximum current diagnostic A ✔️
ccu Charge controller update progress diagnostic 1
ccw Connected WiFi diagnostic JSON decoding required. Values non-essential
cdi Charging duration diagnostic ms ✔️ ✔️
cdi Charging duration counter diagnostic ✔️
cus Cable unlock status code diagnostic ✔️
cus Cable unlock status diagnostic ✔️ ✔️
cwsca Cloud websocket connected diagnostic ms 1
efh ESP free heap diagnostic 1
efh32 ESP free heap 32bit aligned diagnostic 1
efh8 ESP free heap 8bit aligned diagnostic 1
ehs ESP heap size diagnostic 1
emfh ESP minimum free heap since boot diagnostic 1
emhb ESP maximum size of allocated heap block since boot diagnostic 1
err Error diagnostic ✔️ ✔️
err Error code diagnostic ✔️
esr RTC reset reason diagnostic 1
eto Total energy diagnostic Wh ✔️ ✔️
etop Total energy persisted diagnostic Wh 1
ffb Lock feedback diagnostic 1
ffba Lock feedback age diagnostic ms 1
fhz Grid frequency diagnostic Hz ✔️
fsptws Force single phase toggle wished since diagnostic ms 1
host Hostname on STA interface diagnostic 1
lbp Last button press diagnostic ✔️
lccfc Last car state changed from charging diagnostic ms ✔️ ✔️
lccfi Last car state changed from idle diagnostic ms ✔️ ✔️
lcctc Last car state changed to charging diagnostic ms ✔️ ✔️
lck Effective lock setting diagnostic 1
led LED animation details diagnostic 1
lfspt Last force single phase toggle diagnostic ms 1
lmsc Last model status change diagnostic ms ✔️
loa Load balancing available current diagnostic A ✔️ ✔️
loc Local time diagnostic Valueless with a high update interval of 1s
lom Load balancing members diagnostic 1
los Load balancing status diagnostic 1
lssfc WiFi station disconnected since diagnostic 1
lsstc WiFi station connected since diagnostic 1
mcpea Minimum charge pause ends at diagnostic ms 1
mmp Maximum measured charging power diagnostic W 1
modelStatus Status diagnostic ✔️ ✔️
modelStatus Status code diagnostic ✔️
msi Reason why we allow charging or not diagnostic 1
nrg Voltage L1 diagnostic V ✔️ ✔️
nrg Voltage L2 diagnostic V ✔️ ✔️
nrg Voltage L3 diagnostic V ✔️ ✔️
nrg Voltage N diagnostic V ✔️ ✔️
nrg Current L1 diagnostic A ✔️ ✔️
nrg Current L2 diagnostic A ✔️ ✔️
nrg Current L3 diagnostic A ✔️ ✔️
nrg Power L1 diagnostic W ✔️ ✔️
nrg Power L2 diagnostic W ✔️ ✔️
nrg Power L3 diagnostic W ✔️ ✔️
nrg Power N diagnostic W ✔️ ✔️
nrg Current power diagnostic W ✔️ ✔️
nrg Power factor L1 diagnostic % ✔️ ✔️
nrg Power factor L2 diagnostic % ✔️ ✔️
nrg Power factor L3 diagnostic % ✔️ ✔️
nrg Power factor N diagnostic % ✔️ ✔️
oca OTA cloud app description diagnostic 1
ocl OTA from cloud length diagnostic 1
ocm OTA from cloud message diagnostic 1
ocp OTA from cloud progress diagnostic 1
ocs OTA from cloud status diagnostic 1
ocu List of available firmware versions diagnostic ✔️
onv Newest OTA version diagnostic 1
pwm Phase wish mode for debugging diagnostic 1
pgrid Power from Grid ✔️ ✔️
ppv Power from Solar Panels ✔️ ✔️
pakku Power from External Battery ✔️ ✔️
qsc Queue size cloud diagnostic 1
qsw Queue size web diagnostic 1
rbc Reboot counter diagnostic ✔️ ✔️
rbt Uptime diagnostic TODO: Convert to a timestamp first
rcd Residual current detection diagnostic 1
rfb Relay feedback diagnostic 1
rr ESP reset reason diagnostic 1
rssi WiFi signal strength diagnostic dBm ✔️
scaa WiFi scan age diagnostic 1
scan WiFi scan result diagnostic 1
scas WiFi scan status diagnostic 1
tma Temperature sensor 1 diagnostic °C ✔️ ✔️
tma Temperature sensor 2 diagnostic °C ✔️ ✔️
tpa Total power average diagnostic W ✔️ ✔️
trx Transaction diagnostic ✔️ ✔️
tsom Time server operating mode diagnostic 1
utc UTC time diagnostic Valueless with a high update interval of 1s
wcch Clients via http diagnostic 1
wccw Clients via websocket diagnostic 1
wh Charged energy diagnostic Wh ✔️ ✔️
wsms WiFi state machine state diagnostic 1
wst WiFi station status diagnostic 1
psm Configured phases config ✔️ ✔️
cards Charged energy card 1 diagnostic Wh ✔️ ✔️
cards Charged energy card 2 diagnostic Wh ✔️
cards Charged energy card 3 diagnostic Wh ✔️
cards Charged energy card 4 diagnostic Wh ✔️
cards Charged energy card 5 diagnostic Wh ✔️
cards Charged energy card 6 diagnostic Wh ✔️
cards Charged energy card 7 diagnostic Wh ✔️
cards Charged energy card 8 diagnostic Wh ✔️
cards Charged energy card 9 diagnostic Wh ✔️
cards Charged energy card 10 diagnostic Wh ✔️

Switch entities

Key Friendly name Category Enabled per default Supported Unsupported reason
bac Allow current change by button config ✔️ ✔️
ara Automatic stop mode config ✔️ ✔️
wen WiFi enabled config 1
tse Time server enabled config 1
sdp Button allow force change config 1
nmo Norway mode config 1
lse LED off on standby config 1
awe Awattar mode config ✔️ ✔️
acp Allow charge pause config ✔️ 1
esk Energy set config App only
fup Charge with PV surplus config ✔️ ✔️
su Simulate unplugging config 1
hws HTTP STA reachable config 1
hsa HTTP STA authentication config 1
loe Load balancing enabled config 1
upo Unlock power outage config 1
cwe Cloud websocket enabled config 1
psm Force single phase diagnostic ✔️ ✔️
acs Card authorization required config ✔️ ✔️

Number entities

Key Friendly name Category Enabled per default Supported Unsupported reason
ama Maximum current limit config ✔️ ✔️
amp Requested current config ✔️ ✔️
ate Automatic stop energy config ✔️ ✔️
att Automatic stop time config ✔️ ✔️
awp Awattar maximum price threshold config ✔️ ✔️
dwo Charging energy limit config ✔️ ✔️
lop Load balancing priority config 1
pgt Grid target config ✔️ ✔️ 2

Select entities

Key Friendly name Category Enabled per default Supported Unsupported reason
lmo Logic mode config ✔️ ✔️
ust Cable unlock mode config ✔️ ✔️
frc Force state config ✔️ ✔️
trx Transaction config ✔️ ✔️

Charge with PV Surplus

Setable only PV-surplus entities

This feature requires firmware 0.55.6 or newer.

Key Friendly name Category Enabled per default Supported Unsupported reason
ids Input avail Power config ✔️

ids is used to input values to the ECO PV-surplus charging mode. (PV = Photo Voltaic aka Solar Panels)

ids is set with a JSON list: {"pGrid":0.0,"pAkku":0.0,"pPv":0.0} - If values are accepted they can be read back thru the pgrid, pakku and ppv sensors. pGrid is required. The others are optional.

ids values decays, so must be updated every 10s or faster. No update for 10-15s means no PV-surplus is available. pgrid/pakku/ppv will thus all become unknown.

Only pGrid is used in calculations. Negative pGrid means power is exported, and thus available to the charger. Charger is then constantly calculating available power and adjusting charge power up and down multiple times per minute (on every update). If 1/3 phase is set to automatic, it will switch between 1 and 3 phases. The 1->3 phase switch level is set in spl3

By feeding ids values, ECO charging can be controlled (on/off) in the go-eCharger App. It is safe and expected to set this value often.

For PV surplus charging to be enabled, lmo (Logic mode) most be set to 4 (Eco mode), and fup (Use PV surplus) must be set to true.

See template example below for how to continuously update ids

Automation example

alias: go-e Surplus Charging
description: "Simple automation to update values needed for using solar surplus with go-e Chargers"
trigger:
  - platform: time_pattern
    seconds: /5
condition: []
action:
  - service: mqtt.publish
    data:
      qos: "0"
      # Change to your charger ID here
      topic: go-eCharger/999999/ids/set
      # Please provide your own entities here, as described above
      payload: {{'{"pGrid": '}}{{states('sensor.meter_active_power_raw')}}{{', "pPv":'}}{{states('sensor.total_dc_power')}}{{', "pAkku":0}'}}
      retain: false

Platform services

Service goecharger_mqtt.set_config_key

Sets a config key to a value.

Service data attribute Optional Description
serial_number no The serial number of the go-e device
key no The key of the config parameter you want to change
value no The new value

Tips and tricks

How to suspend the access point of the go-e charger

Per default the WiFi network of the charger is always active even if the device is connected as station to your WiFi network. If cloud access is enabled the API key wda can be used to suspend the access point as soon as the connection to the cloud is established:

# Suspend access point mode on cloud connection
curl -s "http://192.168.xx.xx/api/set?wda=true"

# Pretty print the full status
curl -s "http://192.168.xx.xx/api/status" | json_pp

# Check the value of the `wda` key
curl -s "http://192.168.1.11/api/status" | jq '.wda'

The wda key can be changed via the HTTP-API v2 only. The device doesn't accept the setting via MQTT. For more details please see goecharger/go-eCharger-API-v2#35.

References

Footnotes

  1. Not exposed via MQTT in firmware 053.1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119

  2. Exposed via MQTT since firmware 056.2