Skip to content

Latest commit

 

History

History
150 lines (107 loc) · 5.25 KB

README.md

File metadata and controls

150 lines (107 loc) · 5.25 KB

Thermod Button-LED monitor

Thermod monitor for Raspberry Pi with one button and one RGB LED.

The LED reports the current status of the thermostat, while the button can be used to change the status in a sequential way: from any status to auto and from auto to tmax on first pressing, then from tmax to tmin, from tmin to antifreeze, and so on.

License

Thermod Button-LED monitor v1.2.0
Copyright (C) 2018-2020 Simone Rossetto [email protected]
GNU General Public License v3

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>.

How to install

Requirements

Thermod Button-LED monitor requires Python3 (at least version 3.5) and the following packages:

Note: this monitor is already included in Thermod v1.0.0, then it has been removed and put in a separate repository since commit 82a92f8.

Installation

To install Button-LED monitor you need to have Python3 and virtualenv already installed on the system, then the basic steps are:

  1. download and uncompress the source tarball (or clone the repository)

  2. create e virtualenv somewhere

  3. install thermod package in that virtualenv (see its readme on how to install)

  4. using the same virtualenv, install dependecies and Button-LED monitor with

    pip install -r requirements.txt
    python3 setup.py install
  5. copy the config file monitor-buttonled.conf in one of the following folder (the top-most take precedence)

    • ~/.thermod/
    • ~/.config/thermod/
    • /usr/local/etc/thermod/
    • /var/lib/thermod/
    • /etc/thermod/

    and adjust it to your needs.

Building and installing on Debian-based system

Note: this method only works till version 1.1.0 and with Debian stretch because Python 3.5 has been remove from Debian buster onward.

A Debian package can be build using git-buildpackage.

Assuming you have already configured your system to use git-buildpackage (if not see Debian Wiki for git-pbuilder, cowbuilder, Packaging with Git and Using Git for Debian Packaging) and cloned the repository, then do:

cd thermod-monitor-buttonled
git branch --track pristine-tar origin/pristine-tar
git checkout -b debian/master origin/debian/master
gbp buildpackage

The package can then be installed as usual:

dpkg -i thermod-monitor-buttonled_{version}_{arch}.deb

Starting/Stopping the monitor

After having edited the config file monitor-buttonled.conf you can start Button-LED monitor simply executing

thermod-monitor-buttonled

To have the full list of available options run the monitor with --help option.

Systemd

If systemd is in use, copy the file thermod-monitor-buttonled.service to /lib/systemd/system or to /usr/local/lib/systemd/system, change it to your needs then execute the following commands to automatically start the monitor at system startup.

systemctl daemon-reload
systemctl enable thermod-monitor-buttonled.service

LED flickering issue

If you use a very low value for brightness (like 0.2-0.3) and your LED suffers from flickering, probably the PWM of your board is controlled via software.

To avoid the flickering you can try to use pigpio as backend driver for gpiozero:

  1. make sure to have the pigpiod daemon running on the system

  2. install the pigpio package in the same virtualenv of thermod-monitor-buttonled

    pip install pigpio
  3. start Button-LED monitor with the environment variable GPIOZERO_PIN_FACTORY set to pigpio:

    GPIOZERO_PIN_FACTORY=pigpio thermod-monitor-buttonled

    or, if you are using systemd, you can add to thermod-monitor-buttonled.service

    Environment=GPIOZERO_PIN_FACTORY=pigpio
    

For more information on pigpio daemon and backend driver see its web page and gpiozero documentation.