Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/copilot-instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ This is a Python based repository providing an application for controlling batte

### Required Before Each Commit

- Only use ASCII characters in code, log messages, and documentation. Avoid non-ASCII characters to ensure compatibility and readability across different environments.
- Only use ASCII characters in source code and log messages. Avoid non-ASCII characters to ensure compatibility and readability across different environments. This rule does not apply to documentation in `docs/`.
- Remove excessive whitespaces.
- Follow PEP8 standards. Use autopep8 for that.
- Check against pylint. Target score is like 9.0-9.5, if you can achieve 10, do it.
Expand Down Expand Up @@ -44,5 +44,5 @@ This is a Python based repository providing an application for controlling batte
4. Document public APIs and complex logic. Suggest changes to the `docs/` folder when appropriate
5. Lay test scripts for verification and simple testing into the folder `scripts`.
6. Never commit content of `tmp`.
7. If you have new documentation for the wiki, add files to the `docs/` folder. Prefix is `WIKI_`.
7. User documentation lives in the `docs/` folder and is published via MkDocs to https://mastr.github.io/batcontrol/ — add or update pages there and register new pages in `mkdocs.yml`.
8. Ensure compatibility with supported Python versions (3.9 to 3.13)
55 changes: 55 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Deploy Documentation

on:
push:
branches:
- main
paths:
- 'docs/**'
- 'mkdocs.yml'
- '.github/workflows/docs.yml'
workflow_dispatch:

permissions:
contents: read
pages: write
id-token: write

# Allow only one concurrent deployment, do not cancel in-progress runs.
concurrency:
group: pages
cancel-in-progress: false

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'

- name: Install documentation dependencies
run: pip install "mkdocs-material>=9.5,<10"

- name: Build documentation
run: mkdocs build --strict

- name: Upload Pages artifact
uses: actions/upload-pages-artifact@v3
with:
path: site

deploy:
needs: build
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
2 changes: 1 addition & 1 deletion .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
run: |
uv run pytest tests/ --cov=src/batcontrol --cov-report=xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v6
uses: codecov/codecov-action@v7
with:
files: ./coverage.xml
fail_ci_if_error: false
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -186,3 +186,4 @@ bin
lib64
lib

site/
2 changes: 1 addition & 1 deletion CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ src/batcontrol/

## Known Pitfalls

- ASCII-only in all files — no umlauts, special chars, emoji, even in log messages.
- ASCII-only in source code — no umlauts, special chars, emoji, even in log messages. Does not apply to documentation in `docs/`.
- Peak shaving config is nested inside calculation parameters (not top-level).
- `§14a EnWG` dynamic network fees live in `dynamictariff/network_fees.py`.
- `resilient_wrapper.py` wraps inverter calls — test with the wrapper, not the raw backend.
Expand Down
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ To integrate batcontrol with Home Assistant, use the following repository: [batc
[![Docker Image CI](https://github.com/MaStr/batcontrol/actions/workflows/docker-image.yml/badge.svg?branch=main)](https://github.com/MaStr/batcontrol/actions/workflows/docker-image.yml)


[Wiki/Documentation](https://github.com/MaStr/batcontrol/wiki)
[Documentation](https://mastr.github.io/batcontrol/)

## Prerequisites:

Expand Down Expand Up @@ -61,8 +61,8 @@ inverter:
mqtt_password: secret
base_topic: inverter
capacity: 10000 # Battery capacity in Wh (required)
min_soc: 10 # Minimum SoC % (default: 10)
max_soc: 95 # Maximum SoC % (default: 95)
min_soc: 5 # Minimum SoC % (default: 5)
max_soc: 100 # Maximum SoC % (default: 100)
max_grid_charge_rate: 5000 # Maximum charge rate in W (required)
```

Expand Down Expand Up @@ -178,7 +178,7 @@ docker run -d \
--name batcontrol \
-v /path/to/config:/app/config \
-v /path/to/logs:/app/logs \
muexx/batcontrol:latest
mastr950/batcontrol:latest
```

### Docker-compose example
Expand All @@ -190,7 +190,7 @@ version: '3.8'

services:
batcontrol:
image: muexx/batcontrol:latest
image: mastr950/batcontrol:latest
volumes:
- ./config:/app/config
- ./logs:/app/logs
Expand All @@ -211,7 +211,7 @@ docker run -d \
-v /path/to/config:/app/config \
-v /path/to/logs:/app/logs \
-e TZ=Europe/Berlin \
muexx/batcontrol:latest
mastr950/batcontrol:latest
```

#### Docker-compose example
Expand All @@ -223,7 +223,7 @@ version: '3.8'

services:
batcontrol:
image: muexx/batcontrol:latest
image: mastr950/batcontrol:latest
volumes:
- ./config:/app/config
- ./logs:/app/logs
Expand Down
16 changes: 8 additions & 8 deletions config/batcontrol_config_dummy.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#--------------------------
# Batcontrol Configuration
# See more Details in: https://github.com/MaStr/batcontrol/wiki/Batcontrol-Configuration
# See more Details in: https://mastr.github.io/batcontrol/configuration/batcontrol-configuration/
#--------------------------
timezone: Europe/Berlin #your time zone. not optional.
time_resolution_minutes: 60 # Time resolution for forecasts: 15 (quarter-hourly) or 60 (hourly). Default: 60
Expand All @@ -23,7 +23,7 @@ battery_control:

#--------------------------
# Battery Control Expert Tuning Parameters
# See more Details in: https://github.com/MaStr/batcontrol/wiki/battery_control_expert
# See more Details in: https://mastr.github.io/batcontrol/features/battery-control-expert/
#--------------------------
battery_control_expert:
charge_rate_multiplier: 1.1 # Increase (>1) calculated charge rate to compensate charge inefficiencies.
Expand Down Expand Up @@ -69,7 +69,7 @@ peak_shaving:

#--------------------------
# Inverter
# See more Details in: https://github.com/MaStr/batcontrol/wiki/Inverter-Configuration
# See more Details in: https://mastr.github.io/batcontrol/configuration/inverter-configuration/
#
# IMPORTANT: This configuration uses a "dummy" inverter for demonstration purposes.
# The dummy inverter returns static values to make batcontrol work out of the box.
Expand Down Expand Up @@ -110,7 +110,7 @@ inverter:

#--------------------------
# Dynamic Tariff Provider
# See more Details in: https://github.com/MaStr/batcontrol/wiki/Dynamic-tariff-provider
# See more Details in: https://mastr.github.io/batcontrol/configuration/dynamic-tariff-provider/
#--------------------------
utility:
type: awattar_de # [tibber, awattar_at, awattar_de, evcc, energyforecast, tariff_zones]
Expand Down Expand Up @@ -148,7 +148,7 @@ dynamic_network_fees:

#--------------------------
# MQTT API
# See more Details in: https://github.com/MaStr/batcontrol/wiki/MQTT-API
# See more Details in: https://mastr.github.io/batcontrol/integrations/mqtt-api/
#--------------------------
mqtt:
enabled: false
Expand All @@ -170,7 +170,7 @@ mqtt:

#--------------------------
# Forecast Solar
# See more Details in: https://github.com/MaStr/batcontrol/wiki/Solar-Forecast
# See more Details in: https://mastr.github.io/batcontrol/configuration/solar-forecast/
#
# Supported providers:
# - fcsolarapi: Third-party solar forecast API (configured below, default)
Expand Down Expand Up @@ -205,7 +205,7 @@ pvinstallations:

#--------------------------
# Forecast Consumption
# See more Details in: https://github.com/MaStr/batcontrol/wiki/Consumption-forecast
# See more Details in: https://mastr.github.io/batcontrol/configuration/consumption-forecast/
#
# Option 1: CSV-based forecast (default)
# Option 2: HomeAssistant API-based forecast
Expand All @@ -232,7 +232,7 @@ consumption_forecast:
#--------------------------
# evcc connection
# listen to evcc mqtt messages to lock the battery if the car is charging
# See more Details in: https://github.com/MaStr/batcontrol/wiki/evcc-connection
# See more Details in: https://mastr.github.io/batcontrol/integrations/evcc-connection/
#--------------------------
evcc:
enabled: false
Expand Down
175 changes: 0 additions & 175 deletions docs/WIKI_peak_shaving.md

This file was deleted.

Binary file added docs/assets/battery_limits_parameter.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/charge_rate_multiplier.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading