Skip to content

Latest commit

 

History

History
136 lines (101 loc) · 3.53 KB

README.md

File metadata and controls

136 lines (101 loc) · 3.53 KB

stars last_commit

Wallbox Monitor

A Python script for monitoring a local wallbox charging station and sending notifications via Discord.

Currently supported wallboxes:

  • NewMotion / Shell Recharge [tested with Business Pro 2.1]

Features

  • Reads charging rate and consumed energy from a web-based wallbox interface.
  • Uses Selenium to extract data dynamically.
  • Supported notification channels: Discord, ntfy, Pushover
  • Sends notifications when charging starts, stops, and after 5 minutes: charging rate.
  • Sends a notification after charging stopped or interrupted, summarizing consumed energy and time.
  • If a fixed price per kWh is configured, the energy consumed between cable connected/disconnected will be summarized in Euro.
  • Sends a notification when the cable was connected or disconnected. Also handles short-time unavailabilities of the status page to avoid false-positives.
  • Typically, wallboxes sometimes consume energy as long as a cable is connected. Prevents false positives by only detecting charging rates above 1.0 kW.

Setup & Installation

1️⃣ Install Dependencies

On a Raspberry Pi, run:

sudo apt update
sudo apt install -y chromium-browser chromium-chromedriver
sudo apt install -y python3-requests python3-selenium python3-bs4 python3-urllib3

2️⃣ Clone This Repository

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

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>
  • and/or ntfy:
NTFY_TOPIC = <your_ntfy_topic>
  • and/or Pushover:
PUSHOVER_USER_KEY = <your_pushover_user_key>
PUSHOVER_API_TOKEN = <your_pushover_api_token>

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

📢 Notifications

🔌 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.
💶 total: 15.92 kWh = 5.57 €

📝 Logging

Check logs in:

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

If you want to show additional debug output in wallbox_monitor.log, add this in crontab:

DEBUG_MODE=True

.. or in your shell to debug manually:

export DEBUG_MODE=True
./wallbox_monitor.py

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