Custom component goecharger_mqtt - go-eCharger HOMEfix EV charger integration

Ok thanks again! That is by now quite enough. So I will have a look to the three systems wattpilot, victron Wallbox and openWB.
Best
Daniel

SOLVED :slight_smile:

Hi @syssi - and thanks for an integration that seems to be just what I need for my PV system :v:

So I still have an issue like a couple of users above: My MQTT broker is working just fine with a lot of other integrations - and I see the go-eCharger (MQTT) integration using the serial number, but none of the entities are active and reachable…

I think the issue is with my mqtt URL in my app. I’ve given mqtt://192.168.1.3:1883 as this IP is where my HA is. And also I am not aware of any mqtt specific credentials. Any way to check the correct URL?

BTW my HA is installed as a virtual machine on my QNAP NAS

In my MQTT Broker log I now see this:

1661078345: New connection from 192.168.1.104:54005 on port 1883.
error: received null username or password for unpwd check
1661078345: Client disconnected, not authorised.
1661078360: New connection from 192.168.1.104:54006 on port 1883.
error: received null username or password for unpwd check

The go-eCharger is having 192.168.1.104 so it is trying but definitely need a specific username and pw. Hmm…

Gave one of my HA user credentials - now works!
(btw only use mqtt broker and charger locally)

Good job! If you find out how to add new users to your MQTT broker please share your knowledge. :slight_smile:

1 Like

Hi again,

As probably many others go-eCharger owners with solar panels on the roof I so much want to make an automation that charge my Tesla with excess solar power that would otherwise be exported to the grid…
I also acknowledge that there is a specific Tesla API available that some HA users have successfully taped into and hereby control the charging entirely from the Tesla + a grid power meter sensor.

However, with the new go-eCharger we now have the ability to control the charging entirely from the charger alone making it EV car independent. At least with the go-eCharger app alone I can now manually control the charging profile so that the total household consumption match the solar power produced:

I did this tedious manual job just to show that it was possible to match the solar power quite precisely.
And furthermore I did this without touching my Tesla - and I was even able to switch between 1 and 3 phases and back again on the fly. Well, it gave some short pauses in charging as can be seen but that is due to my Tesla wanting to think about the new charge situation. Go-eCharger just waited patiently!

But boy, would I want to have a script and automation just doing the same thing? Sure! :sweat_smile:

But in order to make the necessary calculation I need to know the actual charge power at all times. I can easily access the PSM key that control the phase switch (1 or 3) and the AMP key that control the current on the phases but the total power is “hidden” in place 12 (Total) of the NRG key that is an array:
U (L1, L2, L3, N), I (L1, L2, L3), P (L1, L2, L3, N, Total), pf (L1, L2, L3, N)

Question is how do I filter out “Total” from that key?

I would probably know how to do this if I was doing HA automations every day - but unfortunately I am nowhere near that…

Thanks for any guidance

As I see it the automation algorithm is then to:

  1. Check if sun is up(!)
  2. Check if EV is connected to the charger
  3. Increase or decrease AMP until “Household Power + EV Charge Power” is just below “Solar Power”
  4. If AMP increase with 1 phase cannot get it up to match Solar Power then switch to 3 phases
  5. If AMP decrease with 3 phases cannot get it down to match Solar Power then switch to 1 phase

Step 3-5 should then be a script running frequently (every 5 min?) to adjust the AMP and PSM

But I still need to isolate EV Charge Power from the NRG key - @syssi is that the same value as the “Total power average” in your Diagnostic section of your component?
Edit: No, it seems to be “Current power” that you also supported, but it is not in your Diagnostic section or?

May be the sensor definitions of the custom component could help here:

The sensor your are looking for is “current power”.

Thought so - thanks @syssi !

Hi, my sensors state remain in state unavailable

The goe-Charger is connected to my Mosquitto broker, I can see the values in MQTT Explorer.

I have a goe-Charger V1 Firmware 0.40

Is there anything that needs to be set, e.g. in configuration.yaml?

Edit: ok, I have seen that API V1 is not supported.

Thanks for the integration. I’m looking forward to get this working.

I’m unfortunately not getting any data, most likely due to this error from the logs:

Logger: homeassistant
Source: components/mqtt/client.py:214
First occurred: 3:23:25 PM (3 occurrences)
Last logged: 3:29:27 PM

Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/util/logging.py", line 151, in async_wrapper
    await async_func(*args)
  File "/usr/src/homeassistant/homeassistant/components/mqtt/discovery.py", line 282, in async_integration_message_received
    result = await hass.config_entries.flow.async_init(
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 225, in async_init
    flow, result = await task
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 252, in _async_init
    result = await self._async_handle_step(flow, flow.init_step, data, init_done)
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 367, in _async_handle_step
    result: FlowResult = await getattr(flow, method)(user_input)
  File "/config/custom_components/goecharger_mqtt/config_flow.py", line 79, in async_step_mqtt
    assert subscribed_topic == "/go-eCharger/+/var"
AssertionError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/util/logging.py", line 153, in async_wrapper
    log_exception(format_err, *args)
  File "/usr/src/homeassistant/homeassistant/util/logging.py", line 115, in log_exception
    friendly_msg = format_err(*args)
  File "/usr/src/homeassistant/homeassistant/components/mqtt/client.py", line 214, in <lambda>
    f"Exception in {msg_callback.__name__} when handling msg on "
AttributeError: 'functools.partial' object has no attribute '__name__'

This assert seems to be blowing up async_step_mqtt

assert subscribed_topic == "/go-eCharger/+/var"

At the very least, the config process should probably be aborted with self.async_abort there so that there is feedback to the user.

Also, that assert is a bit odd given that there are two topic names listed in the manifest.json

  "mqtt": [
    "/go-eCharger/+/var",
    "go-eCharger/+/var"
  ],

Thanks for your bug report! Could you create an issue at github? I will have a look.

Will do. And thanks for the quick response.

FYI, I just got it working by

  1. Comment out
assert subscribed_topic == "/go-eCharger/+/var"
  1. Change base topic from /go-eCharger to go-eCharger during setup

Works great after that.

1 Like

For posterity, the issue is: Setup failing due to AssertionError · Issue #55 · syssi/homeassistant-goecharger-mqtt · GitHub

can anyone tell me - where can I find the go-eCharger app or integration?

HA is talking with my go-eCharger but i can only see it in the log!

Thank you!

I also get nothing in Home Assustant using the current version. I even tried an older one - does not work either. I am using the newest goEcharger (Gemini flex) which should be the same as the Home+. I do get Mqtt sensor values in MqttExplorer when i connect to my broker, but Home Assistant gets nothing. I use EQMX as MQTT broker, and it shows that the Charger is connected, but in the integration nothing is available.

Also, it is possible to enter a random serial number and still get the integration added.

One thing is odd: In MQTT Explorer, there is no prefix shown, and if i try to set one in the GoOecharger app, i no longer receive data.

Did you add the mqtt integration to your HA instance first? Could you check at the mqtt integration (pub/sub features) the HA instance is able to send and receive MQTT messages in general? And please make sure you are using the latest release 0.14.2 of the custom component.

Wait. :wink: Did I understand the screenshot correctly: All topics aren’t prefixed by /go-eCharger/SERIAL/var? Please talk to the customer support. The custom component expects one of these prefixes:

  • /go-eCharger/SERIAL/var
  • go-eCharger/SERIAL/var

If you choose another prefix at the config flow the first part of the topic will be replaced. The structure stays unchanged:

  • /alternative/prefix/SERIAL/var

I am also struggling with the integration.

Finally I managed that the MQTT messages are going into the Mosquitto topic - but the wallbox data is still not shown in the UI. (see screenshot)

Tried everything. Reload. Reinstall. Reboot.
But to no avail.

Firmware 054.7
Hardware V4 (Gemini)

Here is what i did to get it working:

  1. Changed my MQTT broker from EQMX to mosquitto
  2. Added /go-eCharger/200466/ as prefix in the Go-e app
  3. Disabled API v1 which i had runnig before to use the API V1 integration as an interim solution
1 Like