Skip to content

Commit

Permalink
Merge pull request #35 from theyosh/feature/power_dimmer
Browse files Browse the repository at this point in the history
Feature/power dimmer
  • Loading branch information
theyosh authored Oct 29, 2017
2 parents c4ed2d9 + ed1817e commit bbbb614
Show file tree
Hide file tree
Showing 24 changed files with 1,187 additions and 732 deletions.
60 changes: 59 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,64 @@ Changelog
=========


2.8.2 (2017-10-21)
(unreleased)
------------

**New**
- Add sqlite3 dependency for manual database manupilation. [TheYOSH]
- Added webcam update timeout. Webcams are now only updated once a
minute. Should reduce the load and makes the enginge a bit faster.
[TheYOSH]
- Add extra dimming timing for small changes. [TheYOSH]
- Add PI power user to total power usage. [TheYOSH]
- Added missing translation fields. [TheYOSH]
- Add dimmer settings processing and saving to config file. [TheYOSH]
- Add dimmer support part 1. [TheYOSH]

**Fixes**
- Fix empty graphs. [TheYOSH]
- Fixed missing translation in home dashboard. [#33](https://github.com/theyosh/TerrariumPI/issues/33). [TheYOSH]
- Fix timer issues [#34](https://github.com/theyosh/TerrariumPI/issues/34). [TheYOSH]
- Fix graphing empty graphs and smaller dimmer knob. [TheYOSH]
- Fixed total duration calculation in total power usage. [TheYOSH]
- Fix switch loading without dimmer settings. [TheYOSH]
- Fix switch toggle to support dimmers. [TheYOSH]
- Fix switch toggle to support dimmers. [TheYOSH]
- Fix devision by zero. [TheYOSH]
- Fix SQL duplicate key error. [TheYOSH]

**Updates**
- Update version number. [TheYOSH]
- Update engine loop to make sure at least one run per minute is
possible. Should prevent spicky graphs. [TheYOSH]
- Update environment dashboard modus names [#34](https://github.com/theyosh/TerrariumPI/issues/34). [TheYOSH]
- Update translations. [TheYOSH]
- Update readme. [TheYOSH]
- Update readme. [TheYOSH]
- Update power duration calculation. [TheYOSH]
- Updated installation so it works faster and handles upgrades better.
[TheYOSH]
- Updated data logging and graphing. Reduced load on the client side.
[TheYOSH]
- Update gentelella. [TheYOSH]
- Updated dimmer settings in switch settings page. [TheYOSH]
- Updated supported hardware page. [TheYOSH]

**Other**
- Collector code clean up and better data storage and retrieval.
[TheYOSH]
- Merge branch 'master' into feature/power_dimmer. [TheYOSH]
- Trying to add more stability for dimming hardware. [TheYOSH]
- Remove unused settings for non dimmer switches. [TheYOSH]
- Make PI user restart PiGPIOd process. [TheYOSH]
- Enable pigpiod service at reboot. [TheYOSH]
- Better on and off detection for dimmers. [TheYOSH]
- Merge branch 'master' into feature/power_dimmer. [TheYOSH]


2.8.2 (2017-10-21)
------------------

**New**
- Add sync command. [TheYOSH]

Expand All @@ -15,6 +70,7 @@ Changelog
- Fix HTML code in Dutch translation. Was broke in usage page. [TheYOSH]

**Updates**
- Update changelog. [TheYOSH]
- Update version number. [TheYOSH]
- Update README.md. [TheYOSH]
- Update README.md. [TheYOSH]
Expand Down Expand Up @@ -453,3 +509,5 @@ Changelog
- Typo. [TheYOSH]
- Moved door status to own page. [TheYOSH]
- Use system default pip. [TheYOSH]


28 changes: 19 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,26 +1,33 @@
# TerrariumPI 2.8.2
Software for cheap home automation of your reptile terrarium or any other enclosed environment. With this software you are able to control an enclosed environment so that the temperature and humidity is of a constant value. This is done by using temperature and humidity sensors and realy switches to activate external devices.
# TerrariumPI 3.0.0
Software for cheap home automation of your reptile terrarium or any other enclosed environment. With this software you are able to control for example a terrarium so that the temperature and humidity is of a constant value. Controlling the temperature can be done with heat lights, external heating or cooling system. As long as there is one temperature sensor available the software is able to keep a constant temperature.

It has support for lights, sprayer, heater and cooler equipment. The amount of devices that can be controlled depends on the used relay boards.
For humidity control there is support for a spraying system. The sprayer can be configured to spray for an X amount of seconds and there is a minumal period between two spray actions. Use at least one humitidy sensors to get a constant humidity value.

The software is that flexible that there is no limit in amount of sensors, relay boards or door sensors. The usage can be endless.

Think off:
- Terrarium
- Terrarium (wet of dry)
- Aquarium
- Tanks with animals or plants
- Growhouse

And all this is controlled with a nice webinterface based on [Gentelella a Bootstrap 3 template](https://github.com/puikinsh/gentelella/).
## Features
- Controlling electronic devices like lights, sprayers, heating and cooling equipment
- Reading out temperature and humidity sensors
- Open door detection (sprayer will not spray when a door is open)
- Support for dimming electronic devices
- Manual dimming through web interface
- Predefined on and off durations
- Predefined on and off dimming percentages
- Reading out multiple temperature and humidity sensors
- Support for native Raspberry Pi cam out of the box
- Support for USB and remote webcams
- Open door detection (sprayer will not spray when a door is open)
- Total power and water usage for costs calculation
- Lights control based on sun rise and sun set or timers
- Rain control based on measured humidity
- Rain control based on humidity sensors and timers
- Heater control based on temperature sensors or timers
- Cooling control based on temperature sensors or timers
- Weather forecast from external source
- Weather forecast from external source for lighting schema
- Temperatures in Celsius or Fahrenheit
- Alarm detections

Expand Down Expand Up @@ -61,18 +68,21 @@ This updating is based on that the software is installed with the steps in the I
`cd TerrariumPI`
3. Update the new code with git
`git pull`
4. Re-run the installation script in order to update software dependencies
`sudo ./install.sh`
4. Restart TerrariumPI according to: https://github.com/theyosh/TerrariumPI/wiki/FAQ#how-to-restart-terrariumpi

Now clear your browser cache and reload the webinterface. A brand new version should be running.

## Hardware
This software requires a Raspberry Pi and some extra hardware in order to run and work. The bare minimun is
This software requires a Raspberry Pi and some extra hardware in order to run and work. The bare minimun and tested hardware is
- Raspberry PI
- Pi 2
- Pi 3
- Power relay board
- USB versions (Serial and Bitbang)
- GPIO versions
- PWM Dimmer versions
- Temperature/humdity sensors DHT11, DHT22, AM2303, DS1820, HIH4000, etc through
- OWFS
- GPIO
Expand Down
2 changes: 1 addition & 1 deletion defaults.cfg
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[terrariumpi]
host = ::
port = 8090
version = 2.8.2
version = 3.0.0
title = TerrariumPI %(version)s
power_usage = 5
owfs_port = 4304
Expand Down
38 changes: 24 additions & 14 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,38 +15,44 @@ apt-get -y autoremove
# Install required packages to get the terrarium software running
aptitude -y update
aptitude -y safe-upgrade
aptitude -y install libftdi1 screen python-imaging python-dateutil python-ow python-rpi.gpio python-psutil git subversion watchdog build-essential python-dev python-picamera python-opencv python-pip

if [ `ls -l gentelella | grep -v ^t | wc -l` -eq 0 ]; then
# Manual get Gentelella bootstrap 3 template
git clone https://github.com/puikinsh/gentelella.git gentelella
fi

cd ..
aptitude -y install libftdi1 screen python-imaging python-dateutil python-ow python-rpi.gpio python-psutil git subversion watchdog build-essential python-dev python-picamera python-opencv python-pip python-pigpio i2c-tools owfs ow-shell sqlite3

# Basic config:
raspi-config

# Set the timezone
dpkg-reconfigure tzdata

if [ `ls -l gentelella | grep -v ^t | wc -l` -eq 0 ]; then
# Manual get Gentelella bootstrap 3 template
git clone https://github.com/puikinsh/gentelella.git gentelella
fi

cd gentelella
git pull
cd "${BASEDIR}/.."

# Install multiple python modules
pip install --upgrade gevent untangle uptime bottle bottle_websocket
pip install --upgrade gevent untangle uptime bottle bottle_websocket pylibftdi

# Install https://pypi.python.org/pypi/pylibftdi
# Docu https://pylibftdi.readthedocs.io/
pip install --upgrade pylibftdi
# Make sure that the normal Pi user can read and write to the usb driver
echo 'SUBSYSTEMS=="usb", ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6001", GROUP="dialout", MODE="0660"' > /etc/udev/rules.d/99-libftdi.rules
echo 'SUBSYSTEMS=="usb", ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6014", GROUP="dialout", MODE="0660"' >> /etc/udev/rules.d/99-libftdi.rules

# Install 1 Wire stuff
aptitude -y install i2c-tools owfs ow-shell
sed -i.bak 's/^server: FAKE = DS18S20,DS2405/#server: FAKE = DS18S20,DS2405/' /etc/owfs.conf
echo "server: device=/dev/i2c-1" >> /etc/owfs.conf

if [ `grep -ic "server: device=/dev/i2c-1" /etc/owfs.conf` -eq 0 ]; then
echo "server: device=/dev/i2c-1" >> /etc/owfs.conf
fi

sed -i.bak 's/^blacklist i2c-bcm2708/#blacklist i2c-bcm2708/' /etc/modprobe.d/raspi-blacklist.conf
echo "i2c-dev" >> /etc/modules
if [ `grep -ic "i2c-dev" /etc/modules` -eq 0 ]; then
echo "i2c-dev" >> /etc/modules
fi

modprobe i2c-bcm2708
modprobe i2c-dev

Expand All @@ -58,6 +64,7 @@ fi
cd Adafruit_Python_DHT
git pull
sudo python setup.py install
cd "${BASEDIR}/.."

# Remove unneeded OWS services
update-rc.d -f owftpd remove
Expand All @@ -71,7 +78,10 @@ fi
groupadd gpio 2> /dev/null
usermod -a -G gpio pi 2> /dev/null

sync
# Make sure pigpiod is started at boot, and that user PI can restart it with sudo command
echo "pi ALL=(ALL) NOPASSWD: /usr/sbin/service pigpiod restart" > /etc/sudoers.d/terrariumpi
systemctl enable pigpiod

# We are done!
sync
echo "Instaltion is done. Please reboot once to get the I2C and Adafruit DHT libary working correctly"
Binary file modified locales/en_US/LC_MESSAGES/terrariumpi.mo
Binary file not shown.
Loading

0 comments on commit bbbb614

Please sign in to comment.