You have Zendure batteries? And you charge your car at the same time? Not goooood…
Zendure EV Guard
Protect your Zendure batteries while charging your electric car
Compatible with Zendure SolarFlow 2400 AC • Shelly Pro 3EM • Smappee • your own sensor (Home Assistant, Jeedom, Tasmota…) • Windows, Linux, macOS
Do you have Zendure batteries and an electric car?
You know the deal: when your car plugs into the wallbox, it sucks up everything. Your Zendure batteries empty at lightning speed, the cycles pile up, and the lifespan of your precious cells melts like snow in the sun.
If your car is a company vehicle and your employer pays for the electricity, it's a shame to drain your batteries to recharge it when you'll have nothing left in the evening for your home's self-consumption.
Another scenario: even if it's not a company car, you may simply want to prevent your batteries from draining while charging, so you can make full use of the electricity produced by your solar panels in bright sunlight, without drawing from your Zendure batteries.
Zendure EV Guard solves this problem automatically. As soon as your car's charging is detected, the program pauses your batteries. When charging is complete, it reactivates them. Simple, automatic, risk-free.
How does it work?
1. Detection
Your Shelly Pro 3EM (or Smappee, or your own sensor) measures consumption. When the power exceeds the threshold (e.g.: 5000W), the program knows that your car is charging.
2. Protection
The Zendure batteries switch to OFF mode instantly. They no longer discharge, your cycles are preserved.
3. Resumption
Charging complete? The program automatically reactivates your batteries with your original settings. No manual intervention.
100% safe for your batteries
Zendure EV Guard uses exclusively the local HTTP API of your Zendure hub. It only touches two settings, the very ones you see in the Zendure app: minSoc (the discharge floor) and outputLimit (the output power). To pause, it sets minSoc exactly to the battery's current charge level and lowers the output to 0 W. To resume, it restores your usual values.
Why the current level, and not 100%? Because I measured it on my hub. With a floor at 100%, the hub starts recharging the battery from the grid, at 2,400 W, while the car is already drawing its 14 kW: your power peak takes 2.3 kW more, exactly what we want to avoid. With a floor 1% below the level, the battery leaks into the house. At the exact level: neither charging nor discharging, even when HEMS mode reopens the output. The floor is therefore recalculated every 5 seconds, and your usual setting comes back when it resumes.
Why both? Because one alone is not always enough. If your hub is running in HEMS mode, it sometimes reopens its output by itself during the pause. The program notices it within a few seconds and closes it again. Measurement made at my place on August 22, 2026, battery at 30%, car at 18 kW: two openings, closed again after 10 and then 5 seconds, 2 Wh in total.
No firmware changed, no cloud access, no risk. It is exactly the same thing as if you changed the setting manually in the Zendure app, but automatically and at the right time.
What else it does for you
- It sets itself up, more or less.
--setupfinds the Shelly and the hub on your network (or tests your own sensor), checks each device, measures your consumption to suggest the detection threshold, sets up Telegram, email and Pushover with a test message, then writesappsettings.jsonwhile keeping a copy of the old one. - It checks itself.
--doctorrereads the configuration, the devices, the notification channels and your license, without changing anything. With--notify, it sends a test message. - It gives you a report at the end of every charge : the kWh that went through the meter, the share from the car, the duration, the peak, the average, and the indicative cost if you give it the price of your kWh. Plus a summary of the week every Monday at 9 am.
- You can control it from Telegram, if you want :
/status,/pause,/resumeand/license, on a bot that you reserve for this use. - It sees the pause leak and closes it. A hub in HEMS mode can reopen its output during the pause : the program sees it in 5 seconds, quantifies it, closes it, and alerts you if it lasts.
- It never leaves you blind. If the meter goes silent, the battery is put out of harm's way as a precaution, and released on the first valid reading.
- It does not get tripped up by its own battery. What the battery supplies to the house is added to the meter reading (
"EvDetection": { "CompensateBatteryOutput": true }) : a battery that covers part of the charge does not hide it. - It puts your batteries back into service before stopping, even when the system is what stops it.
- It speaks French or English (
Messages:Language) and warns you up to 7 days before the end of your license or trial.
Prerequisites
| Equipment | Details |
|---|---|
| Zendure SolarFlow 2400 AC | Hub with local HTTP API enabled (port 80) |
| Shelly Pro 3EM, Smappee or your own sensor1 required | Current clamp (Shelly, real-time), Smappee energy monitor (cloud API, 5-minute blocks) or any meter that provides grid power in JSON on your local network (Home Assistant, Jeedom, Tasmota, ESPHome…) |
| Wallbox / Charging station | Any station: detection is based on consumption, not on the station itself |
| PC, Server or NAS | Windows, Linux or macOS, the program runs in the background 24 hours a day |
Installation
1. Unzip the archive
Extract the contents of the ZIP file into the directory of your choice, for example:
- Windows :
C:\ZendureEvGuard\ - Linux :
/home/ZendureEvGuard/ - macOS :
/Applications/ZendureEvGuard/
2. Execution permissions (Linux / macOS only)
On Linux and macOS, you must make the file executable before launching it:
chmod +x ZendureEvGuard
./ZendureEvGuard3. Configure appsettings.json
Open the appsettings.json file located next to the executable and fill in your settings (see the section below).
Or, much simpler, let the wizard do it. It asks the questions one by one, shows the current value in brackets (Enter keeps the value), tests each device as it goes and only touches the settings you change:
# Windows
ZendureEvGuard.exe --setup
# Linux / macOS
./ZendureEvGuard --setup
The required hardware is announced right away: a meter and Zendure batteries are required, a Smappee charging station is optional. For the meter, the assistant simply asks which one: 1 for the Shelly Pro 3EM (the default choice, Enter is enough), 2 for your own sensor. Threshold calibration is ideally done during a real car charging session: it measures the house with and without the vehicle and suggests the value. No car available? We skip the step and keep the current threshold. At the end, it offers to restart the service so that it applies the new settings, or gives the exact command to type if the service is not installed yet.
A doubt later? The diagnostic reads everything again without changing anything:
./ZendureEvGuard --doctor
./ZendureEvGuard --doctor --notify # envoie aussi un message de test4. Launch the program
# Windows
ZendureEvGuard.exe
# Linux / macOS
./ZendureEvGuardThe program displays the connection information at startup. Use P to pause manually, R to resume, and Ctrl+C twice to stop cleanly.
5. Install it as a service (recommended)
The program only protects your batteries if it is running. The archive contains one script per system: it installs the service, enables it at startup and launches it, from the folder where you unzipped it. Nothing is copied elsewhere.
# Linux
sudo sh install-linux.sh
# macOS
sudo sh install-macos.sh
# Windows (PowerShell en tant qu'administrateur)
powershell -ExecutionPolicy Bypass -File .\install-windows.ps1On Windows, the service runs under the SYSTEM account, which does not have the same data space as your session: make sure to enter Subscription.SecretKey in appsettings.json before installing.
The README.txt file included in the archive details every command, uninstallation and updating. And USER_GUIDE_FR.md covers all the settings, offline.
You prefer to write the service yourself? On Linux, here is the unit that the script installs. Two lines are not decorative: TimeoutStopSec=120 gives the program time to put your batteries back into service before systemd kills it, and network-online.target keeps it from starting before the network is really there.
[Unit]
Description=ZendureEvGuard - EV Charging Battery Protection Daemon
Wants=network-online.target
After=network-online.target
[Service]
Type=simple
WorkingDirectory=/home/ZendureEvGuard
ExecStart="/home/ZendureEvGuard/ZendureEvGuard"
Restart=on-failure
RestartSec=10
TimeoutStopSec=120
SyslogIdentifier=zendure-evguard
Environment=DOTNET_ENVIRONMENT=Production
[Install]
WantedBy=multi-user.targetThen the usual commands:
sudo systemctl daemon-reload
sudo systemctl enable --now zendure-evguard
# Voir le statut
sudo systemctl status zendure-evguard
# Voir les logs en temps reel
sudo journalctl -u zendure-evguard -f
# Redemarrer apres une mise a jour
sudo systemctl restart zendure-evguardDo not add a dedicated User= without thinking it through: the program writes its logs and its pause state next to the executable, and an account without permissions on that folder makes it fail on the first restart.
Configuration: appsettings.json
Here are all the settings you can configure. The Shelly and ZendureDevice sections are required.
Messages
The language of everything you read: emails, Pushover, Telegram, end-of-charge reports. Technical logs remain in English, so that an error message can still be searched for.
| Parameter | Description | Default |
|---|---|---|
Language | Message language: "en" or "fr". Any other value falls back to English, without preventing startup | "en" |
Pay attention to where you put it: this key goes under the Messages section, never at the root of the file. On Linux, a Language key placed at the root is overridden by the system's LANGUAGE environment variable, and your messages switch back to English without warning.
"Messages": {
"Language": "fr"
}Shelly required
Configuration of your Shelly Pro 3EM. It's the sensor that measures your home's electricity consumption. Don't have a Shelly? See "Your own sensor" just below.
| Parameter | Description | Example |
|---|---|---|
Enabled | Enable the Shelly as a measurement source | true |
Host | IP address of your Shelly Pro 3EM on your local network | "192.168.1.50" |
UseDigestAuth | Enable if you have protected your Shelly with a password | false |
Username | Username (if auth is enabled) | "admin" |
Password | Password (if auth is enabled) | "monmotdepasse" |
Your own sensor instead of the Shelly
Do you already have a meter that measures your connection, in Home Assistant, Jeedom, Tasmota, ESPHome or another Shelly? No need to buy a Shelly Pro 3EM: ZendureEvGuard will read one number from a URL on your local network that responds in JSON, every 5 seconds. With a Shelly Pro 3EM, simply ignore this section: without it, everything works as before.
"CustomMeter": {
"Enabled": true,
"Url": "http://192.168.1.50:8123/api/states/sensor.puissance_reseau",
"ValuePath": "state",
"Unit": "W",
"InvertSign": false,
"Authentication": "Bearer",
"BearerToken": "votre-jeton-longue-duree"
}The only slightly technical setting is ValuePath : the path to the number in the response. A few examples that work :
- Home Assistant (
/api/states/sensor.xxx, long-lived token inBearer) :state - Shelly Gen1 EM :
emeters[0].power - Shelly Gen2 (
/rpc/EM.GetStatus?id=0) :total_act_power - Tasmota (
/cm?cmnd=Status%208) :StatusSNS.ENERGY.Power - ESPHome (
/sensor/xxx) :value - Jeedom (
jeeApi.php, which returns the number alone) : leave blank
Unit is W or kW, InvertSign is used if your sensor counts solar export as positive, and Authentication accepts None, Basic (with Username and Password) or Bearer. --setup asks all these questions and performs a test reading that displays the raw value and the watts, for example lecture 1500 W (valeur lue : 1.5). Above 60 kW, it warns you: it is almost always confusion between W and kW.
Watch out for your sensor choice : you need the grid power, at the house meter, positive when you draw power and negative when you export. Not a « house consumption » sensor, which is already counting what the battery supplies and would make it look like a charge. And the safety remains the same as for the Shelly: a sensor that does not respond, takes more than 4 seconds or returns unavailable triggers the precautionary pause. The URL, password and token never appear in the logs.
Smappee charging station optional
The Smappee energy station can be used in two ways :
- As an EV detection source (alternative to the Shelly) : if the Shelly is disabled, Smappee becomes the power measurement source for detecting EV charging. Detection is done via the Smappee cloud API (5-minute blocks, less responsive than the Shelly in real time).
- In parallel with the Shelly : if the Shelly is active as the detection source, Smappee can still be activated to continuously display consumption information (solar, house, grid) and information about your Smappee EV Wall charging station (charging power, status, etc.) in the logs.
| Parameter | Description | Example |
|---|---|---|
Enabled | Enable Smappee (detection source if Shelly is disabled, or display of consumption/EV charger information in parallel) | false |
ClientId | Client ID of your Smappee application (API v3) | "votre-client-id" |
ClientSecret | Client Secret of your Smappee application | "votre-client-secret" |
Username | Username of your Smappee account | "user@email.com" |
Password | Password of your Smappee account | "motdepasse" |
ServiceLocationId | ID of your Smappee location (visible in the Smappee dashboard, it is not the serial number) | "190802" |
PollingIntervalSeconds | Smappee API polling frequency | 30 |
Battery Zendure required
Configuration of your Zendure SolarFlow 2400 AC hub or others. The IP address can be found in the Zendure app.
| Parameter | Description | Example |
|---|---|---|
Host | IP address of your Zendure hub on the local network | "192.168.1.127" |
Port | HTTP port of the local API (80 by default) | 80 |
DefaultOutputLimit | Maximum output power in watts to restore after EV charging | 2400 |
DefaultMinSoc | Discharge floor to restore after charging: the level below which your batteries will no longer discharge (the value is ×10: 100 = 10%, 200 = 20%). This is not the maximum charge level. | 100 |
TimeoutSeconds | Timeout for requests to the hub | 10 |
Understanding DefaultMinSoc
This parameter defines the discharge floor of your batteries: the level below which the hub will no longer let them drain. The value is multiplied by 10 in the Zendure API:
100= the batteries can go down to 10%200= the batteries can go down to 20%500= the batteries stop at 50%, and half your capacity is no longer any use
Do not confuse it with the charge ceiling. The level at which your batteries stop charging is socSet, another setting, the one you see in the Zendure app. Setting 950 here therefore does not mean "charge up to 95%" but "never go below 95%" : your batteries become unusable. The program refuses to start with a value outside 1 to 999, and warns you above 500.
It's up to you to choose! The lower the value, the more you use your batteries; the higher it is, the more you spare the cells, at the cost of the available capacity. Most users choose between 100 (10%) and 200 (20%).
EvDetection
Settings for detecting your electric vehicle's charging. The algorithm uses a hysteresis: several consecutive readings above the threshold are needed to confirm charging, and several readings below it are needed to confirm that it has stopped.
| Parameter | Description | Default |
|---|---|---|
PowerThresholdWatts | Power threshold (in watts) above which the program considers that a car is charging. Adapt it to your wallbox. | 5000 |
ConfirmationReadings | Number of consecutive readings above the threshold to confirm the start of charging | 2 |
ReleaseReadings | Number of consecutive readings below the threshold to confirm the end of charging (24 = ~2 minutes at 5s/reading) | 24 |
PollingIntervalSeconds | Measurement frequency in seconds | 5 |
PauseOnSourceUnreachableMinutes | Length of time during which the meter can remain unreachable before the batteries are paused as a precaution: blind, the program can no longer see your car plug in. The pause is lifted as soon as the first valid measurement arrives. Set it to 0 to disable this safeguard. | 3 |
NotifyPrecautionaryPauseAfterMinutes | A precautionary pause applies immediately, but you are only notified after this length of time: a meter blinking for three seconds is not worth an email | 30 |
SourceUnreachableReleaseMinutes | Length of time after which a precautionary pause is released while the meter is still silent | 10 |
ReleaseHysteresisWatts | Margin below the threshold to cross again to confirm the end of charging. Avoids back and forth when consumption fluctuates right around the threshold | 500 |
PostResumeCooldownSeconds | Delay after a resumption during which a new detection is ignored | 60 |
Energy
At the end of each charge, the program tells you how many kWh have been used. Give it the price of your kWh and it adds the amount. It is indicative, not an invoice: nobody measures the charging station itself, and the price is fixed while yours may not be.
The use case I have in mind: several cars plug in at your place, and each one needs to know what it has consumed.
| Parameter | Description | Default |
|---|---|---|
PricePerKwhCents | Price per kWh in whole cents (28 = 0.28 EUR). Set 0 to display nothing. A number with a decimal point is rejected and read as 0, without preventing startup | 28 |
The report gives figures for two amounts of energy. The one measured at the meter, which is a fact. And the vehicle's estimated share, which subtracts the house's usual consumption: an estimate, and a maximum when your panels were exporting at the time you plugged in.
Charge terminee : 1h03 | 11,30 kWh au compteur (3,16 EUR) |
~11,30 kWh pour le vehicule (3,16 EUR) | pointe 14627 W | moyenne 11169 WNotification optional
Receive emails when your batteries pause, resume, or in case of an error. Configure your SMTP server.
| Parameter | Description | Default |
|---|---|---|
Enabled | Enable email notifications | false |
SmtpHost | SMTP server (e.g.: smtp.gmail.com) | "" |
SmtpPort | SMTP port | 587 |
UseSsl | Use TLS/SSL | true |
Username / Password | SMTP credentials | "" |
FromAddress | Sender email address | "" |
ToAddress | Recipient(s), separated by ; for multiple | "" |
RateLimitMinutes | Minimum interval between two alerts (anti-spam) | 15 |
📴 Pushover optional
Push notifications on your phone via Pushover. Create an application on pushover.net to get your API Token. The simplest way: --setup asks you for the key and token, then sends a test message before activating the channel.
| Parameter | Description |
|---|---|
Enabled | Enable Pushover (true / false) |
ApiToken | API token for your Pushover application |
UserKey | Your Pushover user key |
RateLimitMinutes | Minimum interval between alerts (default: 15) |
💬 Telegram optional
Notifications via a Telegram bot. Create a bot with @BotFather and retrieve your Chat ID.
| Parameter | Description |
|---|---|
Enabled | Enable Telegram (true / false) |
Bots | List of bots. Each one has its Name, its BotToken and its ChatIds list. This is what makes it possible to notify different people in different groups |
RateLimitMinutes | Minimum interval between alerts (default: 15) |
You can notify several groups at once: two people via a first bot, three others via a second. Each send is isolated, an unreachable recipient no longer prevents the others from receiving the message.
"Telegram": {
"Enabled": true,
"RateLimitMinutes": 15,
"Bots": [
{
"Name": "Famille",
"BotToken": "123456:AAExxxxxxxxxxxxxxxxxxxx",
"ChatIds": [ "11111111", "22222222" ]
},
{
"Name": "Voisins",
"BotToken": "789012:BBEyyyyyyyyyyyyyyyyyyyy",
"ChatIds": [ "33333333", "44444444", "55555555" ]
}
]
}
And commands. A bot can also receive your orders. /status gives the battery and counter status, /pause and /resume do exactly what the P and R keys do, and /license <votre clé> activates a license (the bot immediately deletes the message containing the key). This is disabled by default and is enabled bot by bot:
{
"Name": "Commandes",
"BotToken": "345678:CCFzzzzzzzzzzzzzzzzzzzz",
"ChatIds": [ "11111111" ],
"CommandsEnabled": true
}Only the conversations listed in ChatIds are obeyed, a command more than 5 minutes old is ignored, and /resume is refused during charging (the battery would be paused again on the next cycle). Personally, I reserve one bot for these commands and don't put it in any group: anyone who can write in the conversation can pause your battery.
For a single bot, the short form works too: one BotToken and ChatIds separated by semicolons.
📈 Monitoring optional
| Parameter | Description | Default |
|---|---|---|
HealthCheckIntervalSeconds | Frequency of device connectivity checks | 30 |
LogStatusIntervalSeconds | Frequency of logging the full status in the log files | 300 |
PostResumeGuardSeconds | Length of time during which the program checks that the hub has kept your settings after a restart | 300 |
DeviceUnreachableAlertMinutes | Length of time a device is unreachable before you are alerted | 60 |
Update optional
The program does not update itself. It checks once an hour whether a newer version exists, and it simply lets you know: a reminder in the logs every hour until you have installed the new version, and a single message on the channels you have configured, with the direct download link.
Replacing the binary of a service that protects your batteries while it is running is the riskiest action in the product. You might as well be the one deciding when.
| Parameter | Description | Default |
|---|---|---|
CheckEnabled | Check every hour whether a newer version exists | true |
NotifyOnNewVersion | Send a message to your notification channels when a version is detected for the first time. Only once per version, never again | true |
License after trial
After the 30-day trial period, add your secret key to activate the PRO license. Your key can be found in your account at top right > "My Account". The license renews automatically in the background.
You can also send it to your Telegram bot, without touching the file: /license <votre clé>. The bot deletes the message, activates the license and replies with the result (activated until, refused, account suspended). Commands must be enabled on this bot.
| Parameter | Description | Example |
|---|---|---|
SecretKey | Your unique secret key (GUID) from your digital3d.com account. Leave empty to use trial mode. | d79d24cc-eb02-48d7-94f8-xxxxxxxxxxxx |
Minimal configuration example
Here is a ready-to-use example. Simply replace the IP addresses with those of your devices:
{
"Messages": {
"Language": "fr"
},
"Energy": {
"PricePerKwhCents": 28
},
"Shelly": {
"Enabled": true,
"Host": "192.168.1.50"
},
"ZendureDevice": {
"Host": "192.168.1.127",
"Port": 80,
"DefaultOutputLimit": 2400,
"DefaultMinSoc": 100
},
"EvDetection": {
"PowerThresholdWatts": 5000
},
"Subscription": {
"SecretKey": "d79d24cc-eb02-48d7-94f8-xxxxxxxxxxxx"
}
}With this configuration, the program monitors your Shelly, detects any consumption above 5000W (for example), and restores your batteries with a minimum of 10% (100 ÷ 10) and a maximum output of 2400W. The Subscription section is empty by default : the program works in trial mode for 30 days. To activate the PRO license, add your secret key from your account at the top right.
Free trial & Subscription
🎉 30-day free trial, no commitment!
Download Zendure EV Guard and try it for 30 full days, without paying anything and with no feature limit. You will have access to 100% of the features to make sure that the program is a perfect fit for your setup.
At the end of the 30 days, a Digital3D subscription is required to continue using the program. A single subscription gives you access to all Digital3D applications (CompactForIA, AutoMouseMove, Zendure EV Guard, etc.).
🔑 How to activate your license
- Subscribe to a subscription at "One for All"
- Log in to your account on digital3d.com and copy your secret key (a unique identifier in GUID format, for example :
f89f26cc-eb03-48d7-94f8-xxxxxxxxxxxx) - Open the
appsettings.jsonfile and add your key to theSubscriptionsection :"Subscription": { "SecretKey": "votre-clef-secrete-guid" } - Restart the program : the PRO license is activated automatically and renews without any intervention on your part.
Shorter, if Telegram commands are enabled : send /license <votre clé> to your bot, without restarting anything.
Ready to protect your batteries?
Download for free, configure in 5 minutes, and sleep soundly.
Subscription " One for All ": one subscription for all Digital3D applications.
Join the conversation
You need an account to comment on this article. Creating one is free and takes under a minute.
No comments yet.