Skip to content

A Python script for monitoring a local wallbox charging station from NewMotion / Shell Recharge and sending notifications via Discord.

License

Notifications You must be signed in to change notification settings

bjoerrrn/shellrecharge-wallbox-monitor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

stars last_commit

Wallbox Monitor

A Python script for monitoring a local wallbox charging station from NewMotion / Shell Recharge and sending notifications via Discord.

Features

  • 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.

Setup & Installation

1️⃣ Install Dependencies

On a Raspberry Pi, run:

sudo apt update
sudo apt install -y chromium-browser chromium-chromedriver
pip install requests selenium beautifulsoup4 urllib3

2️⃣ Clone This Repository

git clone https://github.com/bjoerrrn/wallbox-monitor.git
cd wallbox-monitor/

3️⃣ Configure Your Script

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>"

4️⃣ Run the Script

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.

📡 Expected Output

📢 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.

📝 Logging

Check logs in:

cat /home/pi/wallbox-monitor/wallbox_monitor.log

🛠 Troubleshooting

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

🤝 Contributing

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

📜 License

This project is open-source under the GPL-3.0 License.