A Python script for monitoring a local wallbox charging station from NewMotion / Shell Recharge and sending notifications via Discord.
- Reads charging rate and consumed energy from a web-based wallbox interface.
- Uses Selenium to extract data dynamically.
- Sends notifications to Discord when charging starts, stops, and after 5 minutes: charging rate.
- Sends a notification to Discord after charging stopped, summarizing consumed energy and time.
- Sends a notification to Discord when the cable was connected or disconnected.
- Prevents false positives by only detecting charging above 1.0 kW.
- Handles missing values gracefully.
On a Raspberry Pi, run:
sudo apt update
sudo apt install -y chromium-browser chromium-chromedriver
pip install requests selenium beautifulsoup4 urllib3
git clone https://github.com/bjoerrrn/wallbox-monitor.git
cd wallbox-monitor/
Open wallbox_monitor.credo and set:
- Wallbox URL: Change
WALLBOX_URL = "http://<your-local-wallbox-ip>:12800/user/user.html"
- Discord Webhook: Replace
DISCORD_WEBHOOK_URL = "<your-discord-webhook-url>"
Manual Execution
python3 wallbox_monitor.py
Run Every Minute with Crontab
crontab -e
Add the following line at the bottom:
* * * * * /usr/bin/python3 /home/pi/wallbox-monitor/wallbox_monitor.py
Save and exit.
📢 Discord Notifications
🔌 02.02.25, 21:50: Cable connected.
⚡ 02.02.25, 22:20: charging started.
⏳ charging power: 2.30 kW
🔋 02.02.25, 22:30: charging stopped.
🔍 consumed: 1.25 kWh in 00:10 h
🔌 02.02.25, 23:50: Cable disconnected.
🔌 02.02.25, 09:50: Cable connected.
⚡ 02.02.25, 22:20: charging started.
⏳ charging power: 3.55 kW
🔋 02.02.25, 23:30: charging stopped.
🔍 consumed: 3.75 kWh of 15.92 kWh in 01:10 h
🔌 02.02.25, 23:50: Cable disconnected.
Check logs in:
cat /home/pi/wallbox-monitor/wallbox_monitor.log
Selenium Fails: “NoSuchDriverException”
Try reinstalling chromedriver:
sudo apt install --reinstall chromium-chromedriver
Charging or Consumed Energy Not Detected
Run debug script:
python3 test_consumed_debug.py
Feel free to open issues or pull requests to improve the script! 🚀
if you want to contact me directly, feel free to do so via discord: https://discordapp.com/users/371404709262786561
This project is open-source under the GPL-3.0 License.