{"id":13585800,"url":"https://github.com/gbbirkisson/hass-pid-thermostat","last_synced_at":"2025-07-18T10:03:23.092Z","repository":{"id":129112171,"uuid":"202302109","full_name":"gbbirkisson/hass-pid-thermostat","owner":"gbbirkisson","description":"PID controller designed to run on Raspberry PI that is controlled by Home Assistant","archived":false,"fork":false,"pushed_at":"2021-08-24T14:54:05.000Z","size":728,"stargazers_count":9,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-04-16T04:09:35.166Z","etag":null,"topics":["home-assistant","home-automation","homeassistant","raspberry-pi"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gbbirkisson.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-08-14T07:53:52.000Z","updated_at":"2024-08-01T16:31:45.472Z","dependencies_parsed_at":"2023-04-19T22:17:34.977Z","dependency_job_id":null,"html_url":"https://github.com/gbbirkisson/hass-pid-thermostat","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gbbirkisson%2Fhass-pid-thermostat","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gbbirkisson%2Fhass-pid-thermostat/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gbbirkisson%2Fhass-pid-thermostat/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gbbirkisson%2Fhass-pid-thermostat/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gbbirkisson","download_url":"https://codeload.github.com/gbbirkisson/hass-pid-thermostat/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247636606,"owners_count":20970963,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["home-assistant","home-automation","homeassistant","raspberry-pi"],"created_at":"2024-08-01T15:05:09.215Z","updated_at":"2025-04-07T10:31:45.572Z","avatar_url":"https://github.com/gbbirkisson.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"\u003cimg align=\"right\" width=\"128\" height=\"128\" src=\"logo.png\"\u003e\n\u003ch1\u003ehass-pid-thermostat\u003c/h1\u003e\n\nA 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:\n\n- [Setup](#setup)\n  - [Home Assistant](#home-assistant)\n  - [Deploy with Balena.io](#deploy-with-balenaio)\n- [Configuration](#configuration)\n- [Home Assistant](#home-assistant-1)\n- [Dashboard](#dashboard)\n- [Electrical Components](#electrical-components)\n  - [Parts I used](#parts-i-used)\n  - [Wiring](#wiring)\n\n## Setup\n\n### Home Assistant\n\nEnable [mqtt discovery](https://www.home-assistant.io/docs/mqtt/discovery).\n\n### Deploy with Balena.io\n\n- Add a custom fleet configuration variable in project:\n  - `BALENA_HOST_CONFIG_dtoverlay=w1-gpio`\n- Add remote your balena remote:\n  - `git remote add balena \u003cUSERNAME\u003e@git.balena-cloud.com:\u003cUSERNAME\u003e/\u003cAPPNAME\u003e.git`\n- Push to balena:\n  - `git push balena master`\n\n## Configuration\n\n| Environmental variable | Required | Default   | Description                                                                                                                  |\n| ---------------------- | -------- | --------- | ---------------------------------------------------------------------------------------------------------------------------- |\n| LOG_LEVEL              | no       | info      | Log level for application, i.e debug, info, warn, error                                                                      |\n| HA_COMPONENT_PREFIX    | no       | Brew      | Prefix for component names                                                                                                   |\n| HA_AVAILABLE           | no       | false     | Send available message to HA on startup                                                                                      |\n| HA_AUTO                | no       | false     | Send auto discovery messages to HA on startup                                                                                |\n| HA_PRINT_CONFIG        | no       | false     | Print HA config on startup                                                                                                   |\n| 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 |\n| MQTT_HOST              | no       | localhost | The host of the MQTT server to communicate with HA                                                                           |\n| MQTT_USER              | no       |           | MQTT user                                                                                                                    |\n| MQTT_PASS              | no       |           | MQTT pass                                                                                                                    |\n| PID_P_GAIN             | no       | 2         | PID proportional gain                                                                                                        |\n| PID_I_GAIN             | no       | 5         | PID integral gain                                                                                                            |\n| PID_D_GAIN             | no       | 1         | PID derivative gain                                                                                                          |\n| PID_OUTPUT_LIMIT       | no       | 5         | PID output limit when calculating control percentage                                                                         |\n| PID_SAMPLE_TIME        | no       | 8         | Amount of time between each PID update                                                                                       |\n| SIMULATE               | no       | false     | Set this to true if you want to simulate thermometer and relays                                                              |\n| SLEEP_PER_ITERATION    | no       | 0         | Sleep per loop iteration, useful to set while simulating                                                                     |\n\n## Home Assistant\n\nComponent 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.\n\n## Dashboard\n\nHere is how the dashboard can look like in HA:\n\n![Card](docs/hass.png)\n\n## Electrical Components\n\n\u003e **_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.\n\n### Parts I used\n\n- [Raspberry PI model B](https://www.google.com/search?q=Raspberry+PI+Model+B)\n- [Kudom 40 A Solid State Relay](https://www.google.com/search?q=Kudom+40+A+Solid+State+Relay)\n- [DS18b20 temperature sensor](https://www.google.com/search?q=ds18b20+temperature+sensor)\n- [4.7k ohm resistor](https://www.google.com/search?q=4.7k+ohm+resistor)\n\n### Wiring\n\n![Wiring1](docs/wiring1.jpg)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgbbirkisson%2Fhass-pid-thermostat","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgbbirkisson%2Fhass-pid-thermostat","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgbbirkisson%2Fhass-pid-thermostat/lists"}