BG Sync EV charger — customised OCPP integration (fork of lbbrhzn/ocpp)

For anyone with a BG Sync EV charger. The standard OCPP integration mostly works but I hit a few device specific issues, so I’ve forked it and fixed them. Sharing in case it saves someone else the pain.

Full credit to @lbbrhzn, this is built entirely on top of the original OCPP integration. Fair warning, a decent chunk of the code was written with AI help (Claude), but it’s all been tested on my own charger.

Fixes:

  • Switches no longer get stuck after an HA restart
  • Better handling of BG Sync’s protocol quirks

Added:

  • Cable release protection, toggle whether the cable auto releases at the end of charging or stays locked until you release it in HA
  • LED brightness control for the outside charging port
  • EVCC compatible, useful for excess solar charge control

Plus all the usual OCPP stuff, start/stop charging, current limiting, power/voltage/temp monitoring, configurable meter intervals.

Install:

Repo: GitHub - jgogoes/hass_ocpp_bg_sync_ev: Home Assistant integration for electric vehicle chargers that support the Open Charge Point Protocol (OCPP). · GitHub

Install via HACS (add the repo as a custom repository), or grab the latest release or just clone it and copy custom_components/ocpp into your custom_components directory. Full steps in the repo README.

Then restart HA, add the OCPP integration via Settings > Devices & Services (it listens on port 9000 by default), and point your charger at Home Assistant by setting its OCPP server URL to ws://<your_HA_IP>:9000. That last step is the one that catches people out, with OCPP the charger connects to HA, not the other way round.

Example, LED brightness automation:

This is the one I actually run. Dims the indicator LED to 1% at dusk so it doesn’t light up the drive all night, back to 30% at dawn.

alias: Charger LED Day/Night Brightness
description: Full brightness at sunrise, dims to 1% at sunset
triggers:
  - trigger: sun
    event: sunrise
    id: day
  - trigger: sun
    event: sunset
    id: night
actions:
  - choose:
      - conditions:
          - condition: trigger
            id: day
        sequence:
          - action: number.set_value
            target:
              entity_id: number.charger_indicator_led_brightness
            data:
              value: 30
      - conditions:
          - condition: trigger
            id: night
        sequence:
          - action: number.set_value
            target:
              entity_id: number.charger_indicator_led_brightness
            data:
              value: 1
mode: single

Swap charger for your charger’s entity prefix.

main tracks upstream unchanged, the default bg-sync-custom branch carries the BG Sync changes on top, so upstream improvements merge in easily.

Been running it for a while now, no issues. Raise anything BG Sync specific on my repo, anything general OCPP belongs upstream.

Happy to answer questions.