Connecting a Ratio Laadpaal to Home Assistant via OCPP
- Andrea Leandri
- 4 days ago
- 7 min read
Skill level: Intermediate | Time to complete: 45-60 minutes
What you'll build: A direct, local connection between your Ratio EV charger and Home Assistant using the OCPP protocol - pulling charging status, power, and session data straight into HA, and giving you full local control without relying on the Ratio cloud backend or a third-party app.
What This Actually Achieves
Ratio chargers normally talk to a backoffice - a cloud service like Ratio Cloud, Tap Electric, or Plugchoice - to handle authentication, dynamic tariff charging, and remote monitoring. That works well for most users, but it means your charger's data lives outside Home Assistant, and any automation built around it depends on a cloud round-trip.
OCPP (Open Charge Point Protocol) lets you replace that cloud backoffice with Home Assistant itself, running locally. Your Ratio charger connects directly to your HA instance, reporting real-time charging status, power draw, and session data as native HA entities - exactly the kind of data the Solar EV Charging guide and the Alexa voice command guide on this site are built to use.
Which sensors you actually get depends on your charger model. Not all Ratio laadpalen report the same set of OCPP measurands - an io6 may expose a different range of sensors than a Ratio Solar model, and even within a model, firmware versions can vary what is reported. The OCPP integration auto-detects whatever your specific charger supports; you will not know exactly which entities you will end up with until it actually connects.
Trade-off to understand upfront: once your charger is set to use HA as its OCPP backoffice, it disconnects from the Ratio cloud and any RFID-based authorization stops working unless HA itself handles it. If you rely on charge cards for guests or shared use, factor that in.
You also lose manual start/stop from the Ratio app. Once OCPP is pointed at Home Assistant, the charger is no longer talking to the Ratio backend, so the start/stop controls inside the Ratio app stop working entirely. You are not without manual control though - you can toggle charging directly from the OCPP device's charge control switch in HA, or expose that switch to a voice assistant using the Alexa voice command patterns on this site - "Alexa, start charging" instead of opening an app.
What You'll Need
Home Assistant - any recent version, with HACS already installed
HACS - covered in the How to Install HACS guide on this site
HTTPS / SSL certificate for HA - required, Ratio chargers only accept secure wss:// connections. Covered in the DuckDNS guide on this site
A Ratio laadpaal (io6, Solar, or similar) - connected to your home WiFi/network and reachable from HA
The Ratio app - installed on your phone, with Bluetooth access to the charger for setup
Part 1: Install the OCPP Integration via HACS
The OCPP integration (lbbrhzn/ocpp) is a community integration installed through HACS - it is not in the default HA integration list.
1.1 Add the integration via HACS
HACS - Integrations - search OCPP - select the OCPP integration by lbbrhzn - Download - choose the latest version - restart Home Assistant.
1.2 Add the integration in HA
Settings - Devices & Services - Add Integration - search OCPP. You'll be asked for connection details: Central System Host = 0.0.0.0 (leave as default, listens on all network interfaces). Central System Port = 9000 (default, can be changed if in use). Central System Identity = central, leave as the default. Secure connection (SSL/TLS) = tick this on, required for Ratio chargers which only accept wss:// connections.
Why leave Central System Identity at the default? The OCPP integration's own documentation specifically recommends this. If you set a custom identity, future integration updates sometimes add new entities back under the default prefix anyway, leaving you with a confusing mix of identifiers. Leaving it at central avoids this entirely.
With Secure connection ticked, you will be asked for the paths to your SSL certificate and key files - typically /ssl/fullchain.pem and /ssl/privkey.pem. This requires HTTPS to already be set up on your HA instance via the DuckDNS guide on this site.
If you get the certificate paths wrong, the integration fails to set up with no clear error message. Double-check the exact paths before moving on - this is the single most common stumbling block in this whole setup.
1.3 Note your WebSocket URL
Once the integration is added, your OCPP server is reachable at:
wss://YOUR_DUCKDNS_HOSTNAME:9000For example: wss://yourhouse.duckdns.org:9000. Because the connection is secure (wss://), it must use your DuckDNS hostname rather than a bare local IP address - this is what matches the SSL certificate configured in step 1.2. This is the address you will enter on the Ratio charger side in Part 2.
Part 2: Configure the Ratio Charger to Use HA as Its OCPP Backoffice
This part happens entirely in the Ratio app, connected to the charger via Bluetooth.
2.1 Connect to the charger via Bluetooth
Open the Ratio app and ensure your phone is within Bluetooth range of the charger, with the charging cable not plugged into the car or the charger. If the advanced settings options appear greyed out, this is almost always the reason - Ratio requires the charger to be idle and the phone connected via Bluetooth to make these changes.
If options stay greyed out even when in range: go to your phone's Bluetooth settings, remove the pairing with the Ratio charger, then re-add it in the Ratio app using the Bluetooth pairing code that came with the charger. This resolves most cases where the advanced settings will not unlock.
2.2 Navigate to OCPP settings
In the Ratio app: Settings - Advanced settings - OCPP settings.
Note: without a Ratio account, you cannot activate OCPP from advanced settings - make sure you are logged in.
2.3 Select your OCPP provider
Tap Open Charge Point Provider. You will see a list of supported backoffices (Ratio Cloud, Tap Electric, Plugchoice/Volt Time, E-Flux, and others). Since you are connecting to your own Home Assistant instance rather than any of these commercial backoffices, look for a custom/manual server option, or if your Ratio app version does not expose one directly, the underlying configuration screen is what you actually need.
2.4 Set the Central System Server Address
This is the critical field - enter your HA WebSocket URL from Part 1.3:
wss://yourhouse.duckdns.org:9000Replace this with your actual DuckDNS hostname. The charger also needs to know the Central System Identity you configured in HA - enter central exactly, matching what was left at default in step 1.2. If this does not match, the charger will be able to open a connection but HA will not recognise it as a valid client.
2.5 Note your Charge Point ID (CPID)
The Ratio app displays a Charge Point ID (CPID) - a unique identifier for your charger. Copy this down. While third-party backoffices like Tap or E-Flux require you to register this ID on their platform, for a Home Assistant connection you generally do not need to register it anywhere else - HA accepts the connection based on the Central System Identity configured in Part 1.2.
2.6 Save and verify the connection
Save the settings. The charger should now attempt to connect to your HA instance's OCPP server.
Part 3: Verify the Connection in Home Assistant
Settings - Devices & Services - OCPP. You should see a new device appear, named charger (or charger Connector 1 if your charger reports per-connector entities). A successfully connected charger typically exposes: Status (Available, Preparing, Charging, SuspendedEV, Finishing), Power (current charging power in watts/kW), Energy session (energy delivered in the current session), Voltage and Current (live electrical readings while charging), and a Charge control switch to start/stop charging from HA.
Some entities show Unavailable until the charger connects, and Unknown until their value has actually been read. This is normal - they populate once a charging session has actually run at least once.
In the OCPP device page, scroll to the bottom of the Entities panel and click Add to Lovelace to quickly get a dashboard card showing your charger's live status.
Part 4: Building Automations With OCPP Data
Once connected, the charger's entities behave like any other HA entity - they can trigger automations, appear in templates, or feed into the patterns covered elsewhere on this site.
conditions:
- condition: state
entity_id: sensor.charger_status_connector_1
state: "Charging"The Solar EV Charging automation on this site uses a generic switch.turn_on/switch.turn_off pattern. With OCPP connected, you can replace that with the OCPP charge control switch directly, and add richer conditions using the actual charger status rather than guessing from power draw alone.
alias: "EV charging finished"
triggers:
- trigger: state
entity_id: sensor.charger_status_connector_1
to: "Finishing"
actions:
- action: notify.mobile_app_iphone_XXXXXX
data:
title: "Charging finished"
message: >
The car has finished charging.
Total energy this session: {{ states('sensor.charger_energy_session') }} kWh.Troubleshooting
Charger never appears as a device in HA: Confirm the WebSocket URL entered in the Ratio app exactly matches your DuckDNS hostname and port 9000, and that the Central System Identity entered on the charger is exactly central. Check your DuckDNS hostname resolves correctly and port 9000 is reachable.
Advanced settings greyed out in Ratio app: Phone must be within Bluetooth range, charger must be idle. Re-pair Bluetooth if the issue persists.
Charger connects then immediately disconnects in a loop: Check Settings - System - Logs in HA for OCPP errors. Some charger firmware has compliance issues with automatic measurand detection - check the OCPP integration's supported devices documentation for known device-specific workarounds.
RFID/charge card no longer works: Expected - once HA is the backoffice, card authorization needs to be configured through HA's own authorization settings, or accept local-only charging without card auth for a single-user setup.
Certificate path errors when setting up WSS: Double-check the exact paths to fullchain.pem and privkey.pem, typically under /ssl/. This is required, not optional, for Ratio chargers.
Charger shows as connected but no entities update: Some entities only populate after a real charging session has run at least once. Plug in and start a charge to populate session-related sensors.
Lost dynamic tariff charging after switching to HA: Expected - Tap Electric/Plugchoice dynamic tariff features run through their own backoffice. Choose one connection at a time, or replicate the dynamic charging logic with your own HA automation using energy price sensors.
Guide written by a Home Assistant enthusiast in Utrecht. Cutting out the cloud middleman between your charger and your automations is one of the more satisfying upgrades you can make.



Comments