Home Assistant & MQTT
Your EMS runs its own MQTT broker on your home network. Home Assistant (or another home automation system) can use it to read your energy data live and control a limited set of functions. Everything stays local: nothing goes over the internet.
Connecting
| Setting | Value |
|---|---|
| Broker | The IP address of your EMS on your home network |
| Port | 1883 (plain) or 8883 (encrypted with TLS) |
| Username | automation |
| Password | Unique to your device, see below |
Example for Home Assistant (configuration.yaml, or through the MQTT integration in the
settings):
mqtt:
broker: 192.168.1.50 # IP address of your EMS
port: 1883
username: automation
password: <your password>
Your password
Every device has its own random password. Ask your installer or our support for it, and give your installation number.
The password used to be derived from your device number (for example
EMS-501-mqtt-2025). For security reasons it has been replaced by a random password per
device. If your integration worked until a recent update and now reports "not authorised"
or "connection refused", ask for your new password.
Keep your password to yourself: anyone who knows it can control your charger and home battery from your home network.
Reading data
Connect with a tool such as MQTT Explorer to see every topic
and its live value. The most useful ones are under sensor/<id>/, where <id> is the
number of your installation as shown in MQTT Explorer:
| Topic | Meaning | Unit |
|---|---|---|
sensor/<id>/net | Grid power | kW |
sensor/<id>/pv | Solar power | kW |
sensor/<id>/bat | Battery power | kW |
sensor/<id>/soc | Battery level | % |
Power is always in kW, not W.
EMS status (read only)
Besides sensor/#, you can follow what the EMS decides and what you set in the portal.
You can only read these topics: you change them in the portal or with the commands
below, not by sending something to them yourself. The content is JSON.
| Topic | What you see | When it appears |
|---|---|---|
state/charger_connected | Whether a car is plugged into your charger (connected: true or false) | If you have a charger; updated every 2 minutes |
state/charger_user_override | Whether your own charging choice (portal or MQTT) takes priority over your charging plan | Only if you have a charging plan |
state/curtailing/pv_budget_w | How much solar power (in W) the EMS allows when it limits your panels | Only while the EMS limits your panels, for example at negative prices |
desired/charging_plan | Your charging plan as you set it in the portal (target time, target %, preference, days); null when there is no plan | When you change your charging plan in the portal |
desired/ev_state | What the EMS knows about your car: battery level, capacity, maximum charging power and whether it is plugged in | Only if your car is linked through the portal |
If you do not see a topic, the condition in the last column does not apply to you.
Controlling your charger
The automation user may send these commands. They do the same as the matching choice in
the portal (see EV charging).
| Topic | Payload | Effect | Package |
|---|---|---|---|
charger/set_mode | 6 | Slim laden (Smart charging) | Full, and only with a Day and night or Dynamic energy plan |
2 | Zon + minimum (Solar + minimum) | Always included | |
3 | Nu laden (Charge now) | Light · Full | |
5 | Niet laden (Don't charge) | Light · Full | |
charger/set_manual | current in A, e.g. 10 | Aangepast laden (Custom charging) at that fixed current | Light · Full |
charger/set_number_of_phases | 1 or 3 | Number of phases; only works in Aangepast laden | Light · Full |
car/SoC | battery level in %, e.g. 64 | Tells the EMS how full your car is (for example from your car's integration in Home Assistant) |
A mode you choose through MQTT counts as your own choice: a charging plan from the cloud does not overwrite it.
Example: a Home Assistant script that switches to Charge now.
script:
ev_charge_now:
sequence:
- action: mqtt.publish
data:
topic: charger/set_mode
payload: "3"
Controlling your home battery
Light · Full · see Packages
You can tell the EMS to charge or discharge your home battery at a fixed power for a while.
This works for every inverter brand, even though the topic starts with sofar.
| Topic | Payload | Effect |
|---|---|---|
sofar/setWorkingMode/passive | power in W, e.g. 3000 | Charge at 3000 W |
negative power in W, e.g. -2500 | Discharge at 2500 W | |
0 | Ends your manual command: the EMS controls the battery again |
- The power is for your whole installation. With several inverters that have a battery, the EMS splits it across them.
- Your command stays active until you send
0. Do not forget that at the end of your automation, or the battery keeps charging or discharging at that power. - The EMS may keep the power below what you asked, for example to respect your capacity tariff or because the inverter cannot deliver more.
- Do not use
sofar/setWorkingMode/autoto stop. It puts the inverter in its own built-in mode and does not end your manual command. Send0tosofar/setWorkingMode/passive: the EMS then takes the battery back. - Does your installation not react to your command? Then it still needs a software update. Please contact us.
Example: charge at 3000 W and hand control back to the EMS after one hour.
script:
battery_charge_1h:
sequence:
- action: mqtt.publish
data:
topic: sofar/setWorkingMode/passive
payload: "3000"
- delay: "01:00:00"
- action: mqtt.publish
data:
topic: sofar/setWorkingMode/passive
payload: "0"
Sending external solar power
If you have panels on an inverter the EMS does not read itself, Home Assistant can send
their power to sensor-ha/1, in W (e.g. 1850). The EMS counts it as solar power.
Send it regularly, for example every minute, and use one topic only: each value replaces
the previous one.
What you cannot control over MQTT
Relays (for example a boiler or heat pump on a smart relay) cannot be switched on, off or to automatic over MQTT; use the portal for that. Every topic not listed above is blocked for writing or ignored, so a mistake in your home automation cannot disturb the energy control.
Troubleshooting
- "not authorised" or "connection refused" when connecting: the password is wrong. Ask for your current password (see above).
- Connected, but some values or controls do nothing: your integration uses a topic that is not in the list above. Reading or writing it is refused.
- No connection at all: check that Home Assistant and your EMS are on the same network and that you use the right IP address.