This repository contains a custom component for Home Assistant that integrates your boiler thermostat with the Home Assistant system. It's designed for use with a Raspberry Pi 3B running Home Assistant in a container.
- Raspberry Pi 3B
- 5V-220V Relay Module
- DS18B20 Thermistor with 10kΩ Resistor
- Read current boiler temperature using the DS18B20 thermistor.
- Set target temperature for the boiler and control it using the relay module (requires a script to handle the logic).
- Home Assistant
- Python 3
Clone this repository into your Home Assistant custom_components
directory:
cd <config directory>/custom_components
git clone https://github.com/taka78/boiler-thermostat.git
Then restart Home Assistant.
The repo has a file named thermostat_script.py
in the boiler-thermostat
directory. This script should include the following functions:
read_temp()
: Reads the temperature from the DS18B20 sensor using a library like DallasTemperature (or your implementation).set_target_temp(target_temp)
: Activates the relay module based on the target and current temperature readings (replace with your implementation). A library likeRPi.GPIO
is recommended for controlling the GPIO pins connected to the relay.
Next, add the following to your Home Assistant configuration.yaml
file:
climate:
- platform: boiler_thermostat
- This integration relies on a separate script (
thermostat_script.py
) to interact with your boiler hardware. - Implement the logic for reading the DS18B20 sensor temperature and controlling the relay module.
- Ensure proper error handling for temperature readings and relay control failures.
- Consider using asynchronous functions for better responsiveness.
The provided hardware list assumes a basic setup for boiler temperature control. Depending on your specific boiler and functionalities, you might need additional components.
Ensure the required libraries (e.g., RPi.GPIO
) are installed within the Home Assistant container for the script to function correctly.
Feel free to submit pull requests for improvements or bug fixes.
This project is licensed under the MIT License. See the LICENSE
file for details.