Git Product home page Git Product logo

heizung's Introduction

heizung

heizung is a utility written in python/flask to control some relays connected to an Raspberry Pi dependent on current temperatures of one or multiple sensors.

The rules (when a specific relay will be switched on) can base on multiple conditions linked with logical and or logical or. The conditions can be:

  • compare the temperatures of two sensors
  • compare the difference of the temperatures of two sensors with a specific value
  • compare the temperature of a sensor with a specific value

Installation

Installing heizung on your Raspi is quite easy. Just follow these simple steps:

  1. Setup your hardware (more below)
  2. Clone the repo in /opt [1] on your raspi, cd into this directory
  3. Edit config.py to your needs (info below)
  4. export PYTHONPATH=./
  5. ./setup.sh
  6. Copy the systemd-files from ./systemd to /etc/systemd/system; you can delete the systemd directory now.
  7. start and enable systemd:
    1. systemctl start heizungWebstart.service
    2. systemctl enable heizungWebstart.service
    3. systemctl start heizungSetupRelays.service
    4. systemctl enable heizungSetupRelays.service
    5. systemctl start heizungGetSensorValues.timer
    6. systemctl enable heizungGetSensorValues.timer
    7. systemctl start heizungSetRelays.timer
    8. systemctl enable heizungSetRelays.timer
[1]You can also choose another directory, but you have to edit the systemd-services if you do so.

Config

You can (and should) configure heizung using the config.py file.

First of all make shure to set Config.secret_key to an random (and secret) value.

Choose a location for the database and write it to Config.database_url.

You should not change the Hardware class if you use the hardware setup as described below.

Set System.dir_1w to the directory where your system puts the 1-wire devices. On Raspbian this should be /sys/bus/w1/devices.

Hardware setup

You'll need:

  • Raspberry Pi
  • Relay card
  • DS18B20 temperature sensors
  • female-female jumper wires
  • some resistors and cable

The wiring is quite easy:

https://raw.githubusercontent.com/marcelb98/heizung/master/doc/heizung.png

To use more than one temperature sensor, just connect multiple of them in parallel.

The flags marked with "R1", "R2", ..., "R8" have to be connected with the relay card. Maybe the relay card also needs GND and 5V. The resistors between RPi and the relay card are 1k.

heizung's People

Contributors

marcelb98 avatar

Watchers

 avatar

heizung's Issues

shorter default intervals for diagrams

The default interval for which temperature values of sensors are shown in the diagrams should be shortened to 12h to achieve faster loading and a better overview over the values.

Adding buttons to select an interval for the last 12h, 24h or 3d would also be useful.

translations

Translations (firstly to German) would be nice

deleting rule crashes everything

When deleting a rule, all relayrules containing this rule have to be deleted too.
If this isn't done, the following will crash:

  • relay page
  • dashbaord
  • setRelays

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.