Skip to content

Repository files navigation

SolarHeaterController

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.

Apps

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

Heater programs

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.

Local configuration (not in git)

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

houses.yaml

  • production_sensor / consumption_sensor: Home Assistant sensors in watts
  • heater_watt: nominal power of one heater
  • cycle_interval: seconds between surplus checks
  • min_minutes_program_C: daily minimum ON time for program C
  • houses: map of house id → heater entity, program, and optional temp_sensor (required for program D)

Use any labels you like for the house keys. They never need to be street addresses.

apps.yaml

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 device
  • output_dir: folder for CSV files (for example /config/solarlog_data on Home Assistant OS)

Install on Home Assistant / AppDaemon

  1. Install the AppDaemon add-on (or a standalone AppDaemon talking to Home Assistant).
  2. Copy the three .py files into AppDaemon's apps/ folder.
  3. Put your filled-in houses.yaml and apps.yaml in that same apps/ folder (SolarHeaterController loads <config_dir>/apps/houses.yaml).
  4. 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.

What is not published

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.

License

CC0 1.0 (public domain dedication).

About

Control of large set of houses heaters based on several programs. Based on HomeAssistant AppDaemon.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages