|
| 1 | +# ⚡ Vattenfall Charger Controller 🔌 |
| 2 | + |
| 3 | +*Because manually walking to your EV charger is so 2023* 🚗💨 |
| 4 | + |
| 5 | +Welcome to the most electrifying Python package you'll ever use! This nifty little tool lets you remotely control your Vattenfall EV charging station from the comfort of your couch, office, or anywhere with an internet connection. |
| 6 | + |
| 7 | +## 🚀 Features That'll Shock You |
| 8 | + |
| 9 | +- **Remote Start**: Start charging your EV without leaving your warm bed |
| 10 | +- **WebSocket Magic**: Real-time communication with your charging station |
| 11 | +- **Selenium-Powered**: Automates the login process like a digital ninja |
| 12 | +- **Environment-Friendly**: Uses environment variables (and saves the planet!) |
| 13 | +- **Async/Await**: Because we're not living in the stone age |
| 14 | + |
| 15 | +## 🏗️ Installation |
| 16 | + |
| 17 | +```bash |
| 18 | +pip install vattenfall-charger |
| 19 | +``` |
| 20 | + |
| 21 | +Or if you're feeling adventurous and want to build from source: |
| 22 | + |
| 23 | +```bash |
| 24 | +git clone https://github.com/bram/vattenfall-charger.git |
| 25 | +cd vattenfall-charger |
| 26 | +pip install -e . |
| 27 | +``` |
| 28 | + |
| 29 | +## 🎮 Quick Start |
| 30 | + |
| 31 | +### Environment Setup |
| 32 | + |
| 33 | +Create a `.env` file or set these environment variables: |
| 34 | + |
| 35 | +```bash |
| 36 | +export USERNAME="your@email.com" |
| 37 | +export PASSWORD="your_super_secret_password" |
| 38 | +export STATION_NAME="EVB-P1234567" |
| 39 | +export RFID="12345AB6789C01" |
| 40 | +export SUBSCRIPTION_KEY="your_subscription_key_here" |
| 41 | +``` |
| 42 | + |
| 43 | +### Command Line Usage |
| 44 | + |
| 45 | +```bash |
| 46 | +# Start charging like a boss |
| 47 | +vattenfall-charger |
| 48 | +``` |
| 49 | + |
| 50 | +### Python API Usage |
| 51 | + |
| 52 | +```python |
| 53 | +import asyncio |
| 54 | +from vattenfall_charger import send_remote_start |
| 55 | + |
| 56 | +# Charge your car like it's 2024 |
| 57 | +asyncio.run(send_remote_start()) |
| 58 | +``` |
| 59 | + |
| 60 | +## 🔧 Development Setup |
| 61 | + |
| 62 | +Want to contribute? Awesome! Here's how to get started: |
| 63 | + |
| 64 | +```bash |
| 65 | +# Clone the repo |
| 66 | +git clone https://github.com/bram/vattenfall-charger.git |
| 67 | +cd vattenfall-charger |
| 68 | + |
| 69 | +# Install development dependencies |
| 70 | +pip install -e ".[dev]" |
| 71 | + |
| 72 | +# Run the linter (because clean code is happy code) |
| 73 | +ruff check . |
| 74 | + |
| 75 | +# Format your code (make it pretty) |
| 76 | +black . |
| 77 | + |
| 78 | +# Run tests (when we have them) |
| 79 | +pytest |
| 80 | +``` |
| 81 | + |
| 82 | +## 🏗️ Project Structure |
| 83 | + |
| 84 | +``` |
| 85 | +vattenfall-charger/ |
| 86 | +├── src/ |
| 87 | +│ └── vattenfall_charger/ |
| 88 | +│ ├── __init__.py |
| 89 | +│ ├── charger.py # Main charging logic |
| 90 | +│ ├── login.py # Authentication magic |
| 91 | +│ ├── command_utils.py # API utilities |
| 92 | +│ └── consts.py # Configuration constants |
| 93 | +├── .github/ |
| 94 | +│ └── workflows/ |
| 95 | +│ ├── lint.yml # Code quality checks |
| 96 | +│ └── publish.yml # Automated publishing |
| 97 | +├── setup.py # Package setup |
| 98 | +├── requirements.txt # Dependencies |
| 99 | +├── pyproject.toml # Modern Python packaging |
| 100 | +└── README.md # This awesome file |
| 101 | +``` |
| 102 | + |
| 103 | +## 🌟 How It Works |
| 104 | + |
| 105 | +1. **Login**: Uses Selenium to authenticate with Vattenfall's portal |
| 106 | +2. **Get Tokens**: Retrieves bearer tokens and command IDs |
| 107 | +3. **WebSocket Connection**: Establishes a real-time connection |
| 108 | +4. **Send Commands**: Sends remote start commands to your charging station |
| 109 | +5. **Profit**: Your car starts charging! 🎉 |
| 110 | + |
| 111 | +## 🚨 Important Notes |
| 112 | + |
| 113 | +- **Chrome Required**: This package uses Chrome for authentication |
| 114 | +- **Credentials**: Keep your credentials safe and never commit them to version control |
| 115 | +- **Rate Limits**: Don't spam the API (be nice to the servers) |
| 116 | +- **Testing**: Always test in a safe environment first |
| 117 | + |
| 118 | +## 🤝 Contributing |
| 119 | + |
| 120 | +Found a bug? Want to add a feature? PRs are welcome! Just make sure to: |
| 121 | + |
| 122 | +1. Write clean, documented code |
| 123 | +2. Follow the existing code style |
| 124 | +3. Add tests (when we have a test framework) |
| 125 | +4. Update this README if needed |
| 126 | + |
| 127 | +## 📄 License |
| 128 | + |
| 129 | +MIT License - feel free to use this for your own EV charging adventures! |
| 130 | + |
| 131 | +## 🎯 Roadmap |
| 132 | + |
| 133 | +- [ ] Add support for multiple charging stations |
| 134 | +- [ ] Implement charging status monitoring |
| 135 | +- [ ] Add scheduling capabilities |
| 136 | +- [ ] Create a web dashboard |
| 137 | +- [ ] Add support for other EV providers (because sharing is caring) |
| 138 | + |
| 139 | +## 💬 Support |
| 140 | + |
| 141 | +Having issues? Found a bug? Want to share your success story? |
| 142 | + |
| 143 | +- 🐛 [Report bugs](https://github.com/bram/vattenfall-charger/issues) |
| 144 | +- 💡 [Request features](https://github.com/bram/vattenfall-charger/issues) |
| 145 | +- 📚 [Read the docs](https://github.com/bram/vattenfall-charger#readme) |
| 146 | + |
| 147 | +--- |
| 148 | + |
| 149 | +*Made with ❤️ and lots of ☕ by developers who are tired of walking to their EV chargers* |
| 150 | + |
| 151 | +**Disclaimer**: This is an unofficial tool and is not affiliated with Vattenfall. Use at your own risk and always follow local regulations regarding EV charging. |
0 commit comments