AppDaemon apps for Home Assistant that switch a set of water heaters (and optional heating loads) so they use solar surplus first, with fallback schedules when the sun is gone.
The Python code is generic. Site-specific data — house names, Home Assistant entity IDs, LAN addresses, TLS fingerprints — lives only in local YAML files that are not in this repository.
| App | File | Role |
|---|---|---|
SolarHeaterController |
SolarHeaterController.py |
Cycle heaters according to program and measured solar surplus |
DailySolarlog |
daily_solarlog.py |
Fetch the previous day's SolarLog counters into a CSV |
MonthlySolarlog |
monthly_solarlog.py |
On the 1st of each month, fetch the previous month into one CSV |
Each house in houses.yaml has a program:
| Program | Behaviour |
|---|---|
| A | Always ON |
| B1 | ON except peak-tariff window 17:00–22:00 |
| B2 | ON except peak-tariff window 17:00–22:40 |
| C | ON when there is solar surplus; also forced ON in some evening/afternoon windows; guaranteed a minimum number of minutes per day (min_minutes_program_C) |
| D | ON when there is solar surplus, or when the tank temperature is low (needs a temp_sensor) |
| Z | Always OFF |
Daytime control uses production minus consumption (from two Home Assistant sensors) and the configured heater wattage to decide how many C/D heaters can run.
Copy the example files and fill in your entities and device settings. Keep the copies named houses.yaml and apps.yaml; they are gitignored.
cp houses.example.yaml houses.yaml
cp apps.example.yaml apps.yamlproduction_sensor/consumption_sensor: Home Assistant sensors in wattsheater_watt: nominal power of one heatercycle_interval: seconds between surplus checksmin_minutes_program_C: daily minimum ON time for program Chouses: map of house id →heaterentity,program, and optionaltemp_sensor(required for program D)
Use any labels you like for the house keys. They never need to be street addresses.
AppDaemon app registrations. For the SolarLog apps, set:
solarlog_url: base URL of your SolarLog (typically a LAN IP)sha1_fingerprint: TLS certificate fingerprint of that deviceoutput_dir: folder for CSV files (for example/config/solarlog_dataon Home Assistant OS)
- Install the AppDaemon add-on (or a standalone AppDaemon talking to Home Assistant).
- Copy the three
.pyfiles into AppDaemon'sapps/folder. - Put your filled-in
houses.yamlandapps.yamlin that sameapps/folder (SolarHeaterControllerloads<config_dir>/apps/houses.yaml). - Restart AppDaemon and check its logs for
Start initialisation.
Python dependencies used by the SolarLog apps: urllib3 (usually already present). The controller uses PyYAML, which AppDaemon already provides.
Do not commit houses.yaml or apps.yaml. They contain house identifiers, switch entity IDs (often device MACs), and the SolarLog URL/fingerprint. The .gitignore in this repo blocks those filenames.
CC0 1.0 (public domain dedication).