Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/gbbirkisson/hass-pid-thermostat
PID controller designed to run on Raspberry PI that is controlled by Home Assistant
https://github.com/gbbirkisson/hass-pid-thermostat
home-assistant home-automation homeassistant raspberry-pi
Last synced: about 2 months ago
JSON representation
PID controller designed to run on Raspberry PI that is controlled by Home Assistant
- Host: GitHub
- URL: https://github.com/gbbirkisson/hass-pid-thermostat
- Owner: gbbirkisson
- Created: 2019-08-14T07:53:52.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2021-08-24T14:54:05.000Z (over 3 years ago)
- Last Synced: 2024-04-16T04:09:35.166Z (8 months ago)
- Topics: home-assistant, home-automation, homeassistant, raspberry-pi
- Language: Python
- Homepage:
- Size: 711 KB
- Stars: 9
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
hass-pid-thermostat
A PID (climate) controller for [Home Assistant](https://www.home-assistant.io/) to heat something using a thermometer and a SSR relay. Here is an example of a card that shows up in Home Assistant:
- [Setup](#setup)
- [Home Assistant](#home-assistant)
- [Deploy with Balena.io](#deploy-with-balenaio)
- [Configuration](#configuration)
- [Home Assistant](#home-assistant-1)
- [Dashboard](#dashboard)
- [Electrical Components](#electrical-components)
- [Parts I used](#parts-i-used)
- [Wiring](#wiring)## Setup
### Home Assistant
Enable [mqtt discovery](https://www.home-assistant.io/docs/mqtt/discovery).
### Deploy with Balena.io
- Add a custom fleet configuration variable in project:
- `BALENA_HOST_CONFIG_dtoverlay=w1-gpio`
- Add remote your balena remote:
- `git remote add balena @git.balena-cloud.com:/.git`
- Push to balena:
- `git push balena master`## Configuration
| Environmental variable | Required | Default | Description |
| ---------------------- | -------- | --------- | ---------------------------------------------------------------------------------------------------------------------------- |
| LOG_LEVEL | no | info | Log level for application, i.e debug, info, warn, error |
| HA_COMPONENT_PREFIX | no | Brew | Prefix for component names |
| HA_AVAILABLE | no | false | Send available message to HA on startup |
| HA_AUTO | no | false | Send auto discovery messages to HA on startup |
| HA_PRINT_CONFIG | no | false | Print HA config on startup |
| SSR_PIN | no | GPIO18 | [Pin name](https://gpiozero.readthedocs.io/en/stable/recipes.html#pin-numbering) on the Raspberry PI the SSR is connected to |
| MQTT_HOST | no | localhost | The host of the MQTT server to communicate with HA |
| MQTT_USER | no | | MQTT user |
| MQTT_PASS | no | | MQTT pass |
| PID_P_GAIN | no | 2 | PID proportional gain |
| PID_I_GAIN | no | 5 | PID integral gain |
| PID_D_GAIN | no | 1 | PID derivative gain |
| PID_OUTPUT_LIMIT | no | 5 | PID output limit when calculating control percentage |
| PID_SAMPLE_TIME | no | 8 | Amount of time between each PID update |
| SIMULATE | no | false | Set this to true if you want to simulate thermometer and relays |
| SLEEP_PER_ITERATION | no | 0 | Sleep per loop iteration, useful to set while simulating |## Home Assistant
Component names may differ, but for simulation you can use the [HA config](./hass/configuration.yaml) and [HA dash config](./hass/lovelace.yaml) in this repository.
## Dashboard
Here is how the dashboard can look like in HA:
![Card](docs/hass.png)
## Electrical Components
> **_VERY IMPORTANT NOTE:_** THIS IS NOT A HOW-TO instructional guide. This explains how I used a Raspberry Pi to control electric current. However, I am NOT an electrician, and just because I did something doesn’t mean YOU should, particularly if you are unfamiliar with how to wire electrical devices safely. If you choose to follow the method I used, you do so at your own risk.
### Parts I used
- [Raspberry PI model B](https://www.google.com/search?q=Raspberry+PI+Model+B)
- [Kudom 40 A Solid State Relay](https://www.google.com/search?q=Kudom+40+A+Solid+State+Relay)
- [DS18b20 temperature sensor](https://www.google.com/search?q=ds18b20+temperature+sensor)
- [4.7k ohm resistor](https://www.google.com/search?q=4.7k+ohm+resistor)### Wiring
![Wiring1](docs/wiring1.jpg)