From 8e4ae299e73a55245699b5de83f302aee9c2828e Mon Sep 17 00:00:00 2001 From: Ulf Bengtner Date: Tue, 12 Apr 2016 22:33:19 +0200 Subject: [PATCH 01/11] Removed bbb directory level --- bbb/LICENSE.txt => LICENSE.txt | 0 bbb/README.md | 104 ------------------ {bbb/html => html}/.htaccess | 0 {bbb/html => html}/application/config.php | 0 .../application/data/.ht.sqlite3 | Bin .../application/textfile/currentPrices.txt | 0 .../application/textfile/newPrices.txt | 0 .../application/textfile/room0.txt | 0 .../application/textfile/room1.txt | 0 .../application/textfile/room2.txt | 0 .../application/textfile/room3.txt | 0 .../application/textfile/room4.txt | 0 .../application/textfile/room5.txt | 0 .../application/textfile/room6.txt | 0 .../application/textfile/room7.txt | 0 .../application/textfile/spotprice.txt | 0 .../application/textfile/spotprice2.txt | 0 .../application/textfile/temperature.txt | 0 {bbb/html => html}/index.php | 0 {bbb/html => html}/js/_1.11.4_jquery-ui.js | 0 {bbb/html => html}/js/canvasjs.min.js | 0 {bbb/html => html}/js/jquery-1.10.2.js | 0 {bbb/html => html}/js/jquery-1.7.1.min.js | 0 .../js/jquery-ui-1.8.17.custom.min.js | 0 {bbb/html => html}/js/jquery.min.js | 0 {bbb/html => html}/js/less.js | 0 .../js/modernizr/2.6.1_smallest.js | 0 {bbb/html => html}/js/script.js | 0 {bbb/html => html}/phpinfo.php | 0 .../src/CBehovsboboxen/403.tpl.php | 0 .../src/CBehovsboboxen/404.tpl.php | 0 .../src/CBehovsboboxen/CBehovsboboxen.php | 0 .../CCAdminControlPanel.php | 0 .../src/CCAdminControlPanel/index.tpl.php | 0 .../CCAdminControlPanel/temperatures.tpl.php | 0 {bbb/html => html}/src/CCIndex/CCIndex.php | 0 .../src/CCPresentation/CCPresentation.php | 0 .../src/CCPresentation/index.tpl.php | 0 .../src/CCSpotprices/CCSpotprices.php | 0 .../src/CCSpotprices/index.tpl.php | 0 {bbb/html => html}/src/CCUser/403.tpl.php | 0 {bbb/html => html}/src/CCUser/CCUser.php | 0 {bbb/html => html}/src/CCUser/login.tpl.php | 0 .../html => html}/src/CDatabase/CDatabase.php | 0 {bbb/html => html}/src/CForm/CForm.php | 0 {bbb/html => html}/src/CForm/README.md | 0 .../html => html}/src/CFormUser/CFormUser.php | 0 .../CInterceptionFilter.php | 0 {bbb/html => html}/src/CLog/CLog.php | 0 .../src/CMTemperatures/CMTemperatures.php | 0 .../src/CMTextfiles/CMTextfiles.php | 0 .../src/CMTranslate/CMTranslate.php | 0 {bbb/html => html}/src/CMUser/CMUser.php | 0 {bbb/html => html}/src/CObject/CObject.php | 0 .../src/CPageLoader/CPageLoader.php | 0 {bbb/html => html}/src/CRequest/CRequest.php | 0 {bbb/html => html}/src/CSession/CSession.php | 0 .../src/CViewContainer/404.tpl.php | 0 .../src/CViewContainer/CViewContainer.php | 0 .../src/IController/IController.php | 0 {bbb/html => html}/src/IHasSQL/IHasSQL.php | 0 {bbb/html => html}/src/IModule/IModule.php | 0 .../src/ISingleton/ISingleton.php | 0 {bbb/html => html}/src/bootstrap.php | 0 {bbb/html => html}/themes/bb/box.jpg | Bin {bbb/html => html}/themes/bb/default.tpl.php | 0 {bbb/html => html}/themes/bb/index.tpl.php | 0 {bbb/html => html}/themes/bb/jquery_ui.css | 0 {bbb/html => html}/themes/bb/smallbox.jpg | Bin {bbb/html => html}/themes/bb/style.css | 0 {bbb/html => html}/themes/functions.php | 0 .../themes/images/aqua_dayDown.gif | Bin .../themes/images/aqua_dayNormal.gif | Bin .../themes/images/aqua_dayOver.gif | Bin .../themes/images/armygreen_dayDown.gif | Bin .../themes/images/armygreen_dayNormal.gif | Bin .../themes/images/armygreen_dayOver.gif | Bin .../themes/images/background-grad.png | Bin .../themes/images/bananasplit_dayDown.gif | Bin .../themes/images/bananasplit_dayNormal.gif | Bin .../themes/images/bananasplit_dayOver.gif | Bin .../themes/images/beige_dayDown.gif | Bin .../themes/images/beige_dayNormal.gif | Bin .../themes/images/beige_dayOver.gif | Bin .../html => html}/themes/images/bg_header.jpg | Bin .../themes/images/boxBottomLeftCorner.png | Bin .../themes/images/boxBottomRightCorner.png | Bin .../themes/images/boxSideWallPx.gif | Bin .../themes/images/boxSideWallPx.png | Bin .../themes/images/boxTopLeftCorner.png | Bin {bbb/html => html}/themes/images/boxTopPx.gif | Bin {bbb/html => html}/themes/images/boxTopPx.png | Bin .../themes/images/boxTopRightCorner.png | Bin {bbb/html => html}/themes/images/bullet1.gif | Bin {bbb/html => html}/themes/images/calendar.png | Bin .../themes/images/closeButton_down.gif | Bin .../themes/images/closeButton_normal.gif | Bin .../themes/images/closeButton_over.gif | Bin .../themes/images/deepblue_dayDown.gif | Bin .../themes/images/deepblue_dayNormal.gif | Bin .../themes/images/deepblue_dayOver.gif | Bin .../themes/images/greenish_dayDown.gif | Bin .../themes/images/greenish_dayOver.gif | Bin {bbb/html => html}/themes/images/handle.png | Bin .../themes/images/header-corners.png | Bin {bbb/html => html}/themes/images/homeIcon.png | Bin .../themes/images/lightgreen_dayDown.gif | Bin .../themes/images/lightgreen_dayNormal.gif | Bin .../themes/images/lightgreen_dayOver.gif | Bin {bbb/html => html}/themes/images/loader.gif | Bin .../themes/images/monthBackward_down.gif | Bin .../themes/images/monthBackward_normal.gif | Bin .../themes/images/monthBackward_over.gif | Bin .../themes/images/monthForward_down.gif | Bin .../themes/images/monthForward_normal.gif | Bin .../themes/images/monthForward_over.gif | Bin .../themes/images/ocean_blue_dayDown.gif | Bin .../themes/images/ocean_blue_dayNormal.gif | Bin .../themes/images/ocean_blue_dayOver.gif | Bin .../themes/images/orange_dayDown.gif | Bin .../themes/images/orange_dayNormal.gif | Bin .../themes/images/orange_dayOver.gif | Bin .../themes/images/peppermint_dayDown.gif | Bin .../themes/images/peppermint_dayNormal.gif | Bin .../themes/images/peppermint_dayOver.gif | Bin .../themes/images/pink_dayDown.gif | Bin .../themes/images/pink_dayNormal.gif | Bin .../themes/images/pink_dayOver.gif | Bin .../themes/images/purple_dayDown.gif | Bin .../themes/images/purple_dayNormal.gif | Bin .../themes/images/purple_dayOver.gif | Bin .../themes/images/torqoise_dayDown.gif | Bin .../themes/images/torqoise_dayNormal.gif | Bin .../themes/images/torqoise_dayOver.gif | Bin .../ui-bg_diagonals-thick_18_b81900_40x40.png | Bin .../ui-bg_diagonals-thick_20_666666_40x40.png | Bin .../images/ui-bg_flat_10_000000_40x100.png | Bin .../images/ui-bg_glass_100_f6f6f6_1x400.png | Bin .../images/ui-bg_glass_100_fdf5ce_1x400.png | Bin .../images/ui-bg_glass_65_ffffff_1x400.png | Bin .../ui-bg_gloss-wave_35_f6a828_500x100.png | Bin .../ui-bg_highlight-soft_100_eeeeee_1x100.png | Bin .../ui-bg_highlight-soft_75_ffe45c_1x100.png | Bin .../themes/images/ui-icons_222222_256x240.png | Bin .../themes/images/ui-icons_228ef1_256x240.png | Bin .../themes/images/ui-icons_ef8c08_256x240.png | Bin .../themes/images/ui-icons_ffd27a_256x240.png | Bin .../themes/images/ui-icons_ffffff_256x240.png | Bin .../themes/images/yearBackward_down.gif | Bin .../themes/images/yearBackward_normal.gif | Bin .../themes/images/yearBackward_over.gif | Bin .../themes/images/yearForward_down.gif | Bin .../themes/images/yearForward_normal.gif | Bin .../themes/images/yearForward_over.gif | Bin {bbb/scripts => scripts}/000-default-ssl | 0 {bbb/scripts => scripts}/apache2.conf | 0 {bbb/scripts => scripts}/cron.txt | 0 {bbb/scripts => scripts}/dallas.py | 0 {bbb/scripts => scripts}/default-ssl | 0 {bbb/scripts => scripts}/default-ssl.conf | 0 {bbb/scripts => scripts}/getspotprice.py | 0 {bbb/scripts => scripts}/rc.local | 0 {bbb/scripts => scripts}/script.sh | 0 {bbb/scripts => scripts}/script2.sh | 0 {bbb/ssl => ssl}/text | 0 165 files changed, 104 deletions(-) rename bbb/LICENSE.txt => LICENSE.txt (100%) delete mode 100644 bbb/README.md rename {bbb/html => html}/.htaccess (100%) rename {bbb/html => html}/application/config.php (100%) rename {bbb/html => html}/application/data/.ht.sqlite3 (100%) rename {bbb/html => html}/application/textfile/currentPrices.txt (100%) rename {bbb/html => html}/application/textfile/newPrices.txt (100%) rename {bbb/html => html}/application/textfile/room0.txt (100%) rename {bbb/html => html}/application/textfile/room1.txt (100%) rename {bbb/html => html}/application/textfile/room2.txt (100%) rename {bbb/html => html}/application/textfile/room3.txt (100%) rename {bbb/html => html}/application/textfile/room4.txt (100%) rename {bbb/html => html}/application/textfile/room5.txt (100%) rename {bbb/html => html}/application/textfile/room6.txt (100%) rename {bbb/html => html}/application/textfile/room7.txt (100%) rename {bbb/html => html}/application/textfile/spotprice.txt (100%) rename {bbb/html => html}/application/textfile/spotprice2.txt (100%) rename {bbb/html => html}/application/textfile/temperature.txt (100%) rename {bbb/html => html}/index.php (100%) rename {bbb/html => html}/js/_1.11.4_jquery-ui.js (100%) rename {bbb/html => html}/js/canvasjs.min.js (100%) rename {bbb/html => html}/js/jquery-1.10.2.js (100%) rename {bbb/html => html}/js/jquery-1.7.1.min.js (100%) rename {bbb/html => html}/js/jquery-ui-1.8.17.custom.min.js (100%) rename {bbb/html => html}/js/jquery.min.js (100%) rename {bbb/html => html}/js/less.js (100%) rename {bbb/html => html}/js/modernizr/2.6.1_smallest.js (100%) rename {bbb/html => html}/js/script.js (100%) rename {bbb/html => html}/phpinfo.php (100%) rename {bbb/html => html}/src/CBehovsboboxen/403.tpl.php (100%) rename {bbb/html => html}/src/CBehovsboboxen/404.tpl.php (100%) rename {bbb/html => html}/src/CBehovsboboxen/CBehovsboboxen.php (100%) rename {bbb/html => html}/src/CCAdminControlPanel/CCAdminControlPanel.php (100%) rename {bbb/html => html}/src/CCAdminControlPanel/index.tpl.php (100%) rename {bbb/html => html}/src/CCAdminControlPanel/temperatures.tpl.php (100%) rename {bbb/html => html}/src/CCIndex/CCIndex.php (100%) rename {bbb/html => html}/src/CCPresentation/CCPresentation.php (100%) rename {bbb/html => html}/src/CCPresentation/index.tpl.php (100%) rename {bbb/html => html}/src/CCSpotprices/CCSpotprices.php (100%) rename {bbb/html => html}/src/CCSpotprices/index.tpl.php (100%) rename {bbb/html => html}/src/CCUser/403.tpl.php (100%) rename {bbb/html => html}/src/CCUser/CCUser.php (100%) rename {bbb/html => html}/src/CCUser/login.tpl.php (100%) rename {bbb/html => html}/src/CDatabase/CDatabase.php (100%) rename {bbb/html => html}/src/CForm/CForm.php (100%) rename {bbb/html => html}/src/CForm/README.md (100%) rename {bbb/html => html}/src/CFormUser/CFormUser.php (100%) rename {bbb/html => html}/src/CInterceptionFilter/CInterceptionFilter.php (100%) rename {bbb/html => html}/src/CLog/CLog.php (100%) rename {bbb/html => html}/src/CMTemperatures/CMTemperatures.php (100%) rename {bbb/html => html}/src/CMTextfiles/CMTextfiles.php (100%) rename {bbb/html => html}/src/CMTranslate/CMTranslate.php (100%) rename {bbb/html => html}/src/CMUser/CMUser.php (100%) rename {bbb/html => html}/src/CObject/CObject.php (100%) rename {bbb/html => html}/src/CPageLoader/CPageLoader.php (100%) rename {bbb/html => html}/src/CRequest/CRequest.php (100%) rename {bbb/html => html}/src/CSession/CSession.php (100%) rename {bbb/html => html}/src/CViewContainer/404.tpl.php (100%) rename {bbb/html => html}/src/CViewContainer/CViewContainer.php (100%) rename {bbb/html => html}/src/IController/IController.php (100%) rename {bbb/html => html}/src/IHasSQL/IHasSQL.php (100%) rename {bbb/html => html}/src/IModule/IModule.php (100%) rename {bbb/html => html}/src/ISingleton/ISingleton.php (100%) rename {bbb/html => html}/src/bootstrap.php (100%) rename {bbb/html => html}/themes/bb/box.jpg (100%) rename {bbb/html => html}/themes/bb/default.tpl.php (100%) rename {bbb/html => html}/themes/bb/index.tpl.php (100%) rename {bbb/html => html}/themes/bb/jquery_ui.css (100%) rename {bbb/html => html}/themes/bb/smallbox.jpg (100%) rename {bbb/html => html}/themes/bb/style.css (100%) rename {bbb/html => html}/themes/functions.php (100%) rename {bbb/html => html}/themes/images/aqua_dayDown.gif (100%) rename {bbb/html => html}/themes/images/aqua_dayNormal.gif (100%) rename {bbb/html => html}/themes/images/aqua_dayOver.gif (100%) rename {bbb/html => html}/themes/images/armygreen_dayDown.gif (100%) rename {bbb/html => html}/themes/images/armygreen_dayNormal.gif (100%) rename {bbb/html => html}/themes/images/armygreen_dayOver.gif (100%) rename {bbb/html => html}/themes/images/background-grad.png (100%) rename {bbb/html => html}/themes/images/bananasplit_dayDown.gif (100%) rename {bbb/html => html}/themes/images/bananasplit_dayNormal.gif (100%) rename {bbb/html => html}/themes/images/bananasplit_dayOver.gif (100%) rename {bbb/html => html}/themes/images/beige_dayDown.gif (100%) rename {bbb/html => html}/themes/images/beige_dayNormal.gif (100%) rename {bbb/html => html}/themes/images/beige_dayOver.gif (100%) rename {bbb/html => html}/themes/images/bg_header.jpg (100%) rename {bbb/html => html}/themes/images/boxBottomLeftCorner.png (100%) rename {bbb/html => html}/themes/images/boxBottomRightCorner.png (100%) rename {bbb/html => html}/themes/images/boxSideWallPx.gif (100%) rename {bbb/html => html}/themes/images/boxSideWallPx.png (100%) rename {bbb/html => html}/themes/images/boxTopLeftCorner.png (100%) rename {bbb/html => html}/themes/images/boxTopPx.gif (100%) rename {bbb/html => html}/themes/images/boxTopPx.png (100%) rename {bbb/html => html}/themes/images/boxTopRightCorner.png (100%) rename {bbb/html => html}/themes/images/bullet1.gif (100%) rename {bbb/html => html}/themes/images/calendar.png (100%) rename {bbb/html => html}/themes/images/closeButton_down.gif (100%) rename {bbb/html => html}/themes/images/closeButton_normal.gif (100%) rename {bbb/html => html}/themes/images/closeButton_over.gif (100%) rename {bbb/html => html}/themes/images/deepblue_dayDown.gif (100%) rename {bbb/html => html}/themes/images/deepblue_dayNormal.gif (100%) rename {bbb/html => html}/themes/images/deepblue_dayOver.gif (100%) rename {bbb/html => html}/themes/images/greenish_dayDown.gif (100%) rename {bbb/html => html}/themes/images/greenish_dayOver.gif (100%) rename {bbb/html => html}/themes/images/handle.png (100%) rename {bbb/html => html}/themes/images/header-corners.png (100%) rename {bbb/html => html}/themes/images/homeIcon.png (100%) rename {bbb/html => html}/themes/images/lightgreen_dayDown.gif (100%) rename {bbb/html => html}/themes/images/lightgreen_dayNormal.gif (100%) rename {bbb/html => html}/themes/images/lightgreen_dayOver.gif (100%) rename {bbb/html => html}/themes/images/loader.gif (100%) rename {bbb/html => html}/themes/images/monthBackward_down.gif (100%) rename {bbb/html => html}/themes/images/monthBackward_normal.gif (100%) rename {bbb/html => html}/themes/images/monthBackward_over.gif (100%) rename {bbb/html => html}/themes/images/monthForward_down.gif (100%) rename {bbb/html => html}/themes/images/monthForward_normal.gif (100%) rename {bbb/html => html}/themes/images/monthForward_over.gif (100%) rename {bbb/html => html}/themes/images/ocean_blue_dayDown.gif (100%) rename {bbb/html => html}/themes/images/ocean_blue_dayNormal.gif (100%) rename {bbb/html => html}/themes/images/ocean_blue_dayOver.gif (100%) rename {bbb/html => html}/themes/images/orange_dayDown.gif (100%) rename {bbb/html => html}/themes/images/orange_dayNormal.gif (100%) rename {bbb/html => html}/themes/images/orange_dayOver.gif (100%) rename {bbb/html => html}/themes/images/peppermint_dayDown.gif (100%) rename {bbb/html => html}/themes/images/peppermint_dayNormal.gif (100%) rename {bbb/html => html}/themes/images/peppermint_dayOver.gif (100%) rename {bbb/html => html}/themes/images/pink_dayDown.gif (100%) rename {bbb/html => html}/themes/images/pink_dayNormal.gif (100%) rename {bbb/html => html}/themes/images/pink_dayOver.gif (100%) rename {bbb/html => html}/themes/images/purple_dayDown.gif (100%) rename {bbb/html => html}/themes/images/purple_dayNormal.gif (100%) rename {bbb/html => html}/themes/images/purple_dayOver.gif (100%) rename {bbb/html => html}/themes/images/torqoise_dayDown.gif (100%) rename {bbb/html => html}/themes/images/torqoise_dayNormal.gif (100%) rename {bbb/html => html}/themes/images/torqoise_dayOver.gif (100%) rename {bbb/html => html}/themes/images/ui-bg_diagonals-thick_18_b81900_40x40.png (100%) rename {bbb/html => html}/themes/images/ui-bg_diagonals-thick_20_666666_40x40.png (100%) rename {bbb/html => html}/themes/images/ui-bg_flat_10_000000_40x100.png (100%) rename {bbb/html => html}/themes/images/ui-bg_glass_100_f6f6f6_1x400.png (100%) rename {bbb/html => html}/themes/images/ui-bg_glass_100_fdf5ce_1x400.png (100%) rename {bbb/html => html}/themes/images/ui-bg_glass_65_ffffff_1x400.png (100%) rename {bbb/html => html}/themes/images/ui-bg_gloss-wave_35_f6a828_500x100.png (100%) rename {bbb/html => html}/themes/images/ui-bg_highlight-soft_100_eeeeee_1x100.png (100%) rename {bbb/html => html}/themes/images/ui-bg_highlight-soft_75_ffe45c_1x100.png (100%) rename {bbb/html => html}/themes/images/ui-icons_222222_256x240.png (100%) rename {bbb/html => html}/themes/images/ui-icons_228ef1_256x240.png (100%) rename {bbb/html => html}/themes/images/ui-icons_ef8c08_256x240.png (100%) rename {bbb/html => html}/themes/images/ui-icons_ffd27a_256x240.png (100%) rename {bbb/html => html}/themes/images/ui-icons_ffffff_256x240.png (100%) rename {bbb/html => html}/themes/images/yearBackward_down.gif (100%) rename {bbb/html => html}/themes/images/yearBackward_normal.gif (100%) rename {bbb/html => html}/themes/images/yearBackward_over.gif (100%) rename {bbb/html => html}/themes/images/yearForward_down.gif (100%) rename {bbb/html => html}/themes/images/yearForward_normal.gif (100%) rename {bbb/html => html}/themes/images/yearForward_over.gif (100%) rename {bbb/scripts => scripts}/000-default-ssl (100%) rename {bbb/scripts => scripts}/apache2.conf (100%) rename {bbb/scripts => scripts}/cron.txt (100%) rename {bbb/scripts => scripts}/dallas.py (100%) rename {bbb/scripts => scripts}/default-ssl (100%) rename {bbb/scripts => scripts}/default-ssl.conf (100%) rename {bbb/scripts => scripts}/getspotprice.py (100%) rename {bbb/scripts => scripts}/rc.local (100%) rename {bbb/scripts => scripts}/script.sh (100%) rename {bbb/scripts => scripts}/script2.sh (100%) rename {bbb/ssl => ssl}/text (100%) diff --git a/bbb/LICENSE.txt b/LICENSE.txt similarity index 100% rename from bbb/LICENSE.txt rename to LICENSE.txt diff --git a/bbb/README.md b/bbb/README.md deleted file mode 100644 index 2f47b2e..0000000 --- a/bbb/README.md +++ /dev/null @@ -1,104 +0,0 @@ -# Behovsboboxen - a controlsystem for smart homes based on Raspberry Pi. -BehovsBoBoxen är ett styrsystem för smarta hem baserad på Raspberry Pi. (Svensk text längre ner.) -![What you need](http://www.behovsbo.se/bilderipso/bbbmaterial.jpg) - -Bom: | Get this ----- | -------- -1 | 1 Raspberry pi 2 modell B -2 | 7 ds18b20 with pins -3 | 1 ds18b20 waterproof -4 | 1 micro SD card 8GB -5 | 1 relaycard with 8 relays -6 | 1 5V 2,1A USB charger -7 | 1 breadboard -8 | 1 bunch connection-wires male-male -9 | 1 bunch connection-wires female-female -10 | 1 Ethernetwire - - -1. Connect the temperature sensors (ds18b20) with plus, minus and signal on GPIO4. If you want to have fewer than 8, -you need to change in the two while-loops in `/home/pi/dallas.py`. You can also add more, up to 16. - -2. Connect the relay card with it's 8 relays from the GPIO pins in the same order as described in the beginning of the file `/home/pi/dallas.py` - -3. Normal mood for an ip-address is DHCP. If you wish a static ip-address, change in the file `/etc/network/interfaces` - -4. In order to reach BehovsBoBoxen from internet you need to do a portforwarding in your router. Se your manual how it's done. - -5. You have already downloaded and installed Raspian from `https://www.raspberrypi.org/downloads/noobs/` and made local configurations - -6. Now, download the latest version from our repository using git client `git clone https://github.com/Electrotest/BehovsBoBoxen` - -7. Run the installation script and follow the given instructions `sudo sh /home/pi/BehovsBoBoxen/install.sh` - -8. Now you can enter your webpage with `https://your.ip.n.r` and log in with root:root. The first time you might get a warning and need to accept that you trust the certificate as it is signed by you and not a professional Certificate Authority, CA. - -9. You change username and password at the administrationpage. If you forget these you can install BehovsBoBoxen again. Not to much harm done for you. - -10. If 1-wire sensors are plugged in according to the manual, you will find folders under `/sys/bus/w1/devices` where each sensor presents it's temperature. - -11. The relays should be connected with dupont cabels according to the pin-configurations in `/home/pi/dallas.py` - -12. Rundstyrning (Demand side management) can be used if you make an agreement with your utility company in order to control loads and prohibite disturbance on the local network. - -13. You can change language to english if you open `/var/www/html/application/config.php` On line 100 you find `$bbb->config['language'] = 'sv_SE';` Change `'sv_SE` to `'en_GB'` - - -# BehovsBoBoxen är ett styrsystem för smarta hem baserad på Raspberry Pi. - -Bom | Materiallista ---- | ------------- -1 | 1 Raspberry pi 2 modell B -2 | 7 ds18b20 med pinnar -3 | 1 ds18b20 vattensäker -4 | 1 micro SD kort 8GB -5 | 1 reläkort med 8 relän -6 | 1 5V 2,1A USB laddare -7 | 1 kopplingsdeck -8 | 1 knippe kopplingssladdar hane-hane -9 | 1 knippe kopplingssladdar hona-hona -10 | 1 Ethernetsladd - - -1. Koppla in temperaturgivarna (ds18b20) med plus, minus och signal på GPIO4. Om du vill ha färre än 8 givare behöver du ändra i de två while-looparna i `/home/pi/dallas.py`. Du kan likaså lägga till fler, upp till 16 stycken. - -2. Reläkortet kopplas med sina 8 relän från GPIO pinnarna som är angivet i samma ordning som anges i början av filen `/home/pi/dallas.py` - -3. Normal läge för IP adress är DHCP, om fast ip adress önskas ändrar man i filen `/etc/network/interfaces` - -4. Om du vill kunna nå BehovsBoBoxen från Internet måste du göra en portvidarebefodran i er router, se manualen hur det görs. - -5. Du har laddat ner och installerat Raspian från `https://www.raspberrypi.org/downloads/noobs/` och konfigurerat till svenska förhållanden - -6. Ladda nu ner den senaste versionen från vår katalog (repository) med git klienten `git clone https://github.com/Electrotest/BehovsBoBoxen` - -7. Kör installationsskriptet och följ de givna instruktionerna `sudo sh /home/pi/BehovsBoBoxen/install.sh` - -8. Nu kan du gå in på `https://your.ip.n.r` Logga in med root:root. Första gången kan du få en varning och få klicka för att du litar på certifikatet. Det är ju bara signerat av dig och inte någon professionell Certificate Authority, CA. - -9. Du byter namn och lösenord på administrationssidan. Om du glömmer inloggningsuppgifterna kan du installera om Boxen – ingen större skada skedd. - -10. Om 1-wire sensorer är inkopplade enligt anvisningen, skall det med sökvägen `/sys/bus/w1/devices` finnas mappar där varje sensor anger sin temperatur. - -11. Reläna skall kopplas med dupontsladdar enligt pin-konfigurationen i `/home/pi/dallas.py` - -12. Rundstyrning kan användas om man gör ett avtal med sitt elnätsbolag om att styra laster för att förhindra störningar på det lokala elnätet. - -13. Du kan byta språk till engelska om du går till `/var/www/html/application/config.php` På rad 105 hittar du `$bbb->config['language'] = 'sv_SE';` Ändra `'sv_SE` till `'en_GB'` - - - -#### The interface of Behovsboboxen is based on Lydia, which is a PHP-based, MVC-inspired CMF - -You find Lydia here: [Lydia](https://github.com/mosbth/lydia) - -The modified and accustomed version is made by Gunvor Nilsson. - - -#### License - -Behovsboboxen (and Lydia) is licensed according to MIT-license. - - -[License/ Pricing:](http://canvasjs.com/download-html5-charting-graphing-library/) -> CanvasJS is free for non-commercial and paid for commercial use. \ No newline at end of file diff --git a/bbb/html/.htaccess b/html/.htaccess similarity index 100% rename from bbb/html/.htaccess rename to html/.htaccess diff --git a/bbb/html/application/config.php b/html/application/config.php similarity index 100% rename from bbb/html/application/config.php rename to html/application/config.php diff --git a/bbb/html/application/data/.ht.sqlite3 b/html/application/data/.ht.sqlite3 similarity index 100% rename from bbb/html/application/data/.ht.sqlite3 rename to html/application/data/.ht.sqlite3 diff --git a/bbb/html/application/textfile/currentPrices.txt b/html/application/textfile/currentPrices.txt similarity index 100% rename from bbb/html/application/textfile/currentPrices.txt rename to html/application/textfile/currentPrices.txt diff --git a/bbb/html/application/textfile/newPrices.txt b/html/application/textfile/newPrices.txt similarity index 100% rename from bbb/html/application/textfile/newPrices.txt rename to html/application/textfile/newPrices.txt diff --git a/bbb/html/application/textfile/room0.txt b/html/application/textfile/room0.txt similarity index 100% rename from bbb/html/application/textfile/room0.txt rename to html/application/textfile/room0.txt diff --git a/bbb/html/application/textfile/room1.txt b/html/application/textfile/room1.txt similarity index 100% rename from bbb/html/application/textfile/room1.txt rename to html/application/textfile/room1.txt diff --git a/bbb/html/application/textfile/room2.txt b/html/application/textfile/room2.txt similarity index 100% rename from bbb/html/application/textfile/room2.txt rename to html/application/textfile/room2.txt diff --git a/bbb/html/application/textfile/room3.txt b/html/application/textfile/room3.txt similarity index 100% rename from bbb/html/application/textfile/room3.txt rename to html/application/textfile/room3.txt diff --git a/bbb/html/application/textfile/room4.txt b/html/application/textfile/room4.txt similarity index 100% rename from bbb/html/application/textfile/room4.txt rename to html/application/textfile/room4.txt diff --git a/bbb/html/application/textfile/room5.txt b/html/application/textfile/room5.txt similarity index 100% rename from bbb/html/application/textfile/room5.txt rename to html/application/textfile/room5.txt diff --git a/bbb/html/application/textfile/room6.txt b/html/application/textfile/room6.txt similarity index 100% rename from bbb/html/application/textfile/room6.txt rename to html/application/textfile/room6.txt diff --git a/bbb/html/application/textfile/room7.txt b/html/application/textfile/room7.txt similarity index 100% rename from bbb/html/application/textfile/room7.txt rename to html/application/textfile/room7.txt diff --git a/bbb/html/application/textfile/spotprice.txt b/html/application/textfile/spotprice.txt similarity index 100% rename from bbb/html/application/textfile/spotprice.txt rename to html/application/textfile/spotprice.txt diff --git a/bbb/html/application/textfile/spotprice2.txt b/html/application/textfile/spotprice2.txt similarity index 100% rename from bbb/html/application/textfile/spotprice2.txt rename to html/application/textfile/spotprice2.txt diff --git a/bbb/html/application/textfile/temperature.txt b/html/application/textfile/temperature.txt similarity index 100% rename from bbb/html/application/textfile/temperature.txt rename to html/application/textfile/temperature.txt diff --git a/bbb/html/index.php b/html/index.php similarity index 100% rename from bbb/html/index.php rename to html/index.php diff --git a/bbb/html/js/_1.11.4_jquery-ui.js b/html/js/_1.11.4_jquery-ui.js similarity index 100% rename from bbb/html/js/_1.11.4_jquery-ui.js rename to html/js/_1.11.4_jquery-ui.js diff --git a/bbb/html/js/canvasjs.min.js b/html/js/canvasjs.min.js similarity index 100% rename from bbb/html/js/canvasjs.min.js rename to html/js/canvasjs.min.js diff --git a/bbb/html/js/jquery-1.10.2.js b/html/js/jquery-1.10.2.js similarity index 100% rename from bbb/html/js/jquery-1.10.2.js rename to html/js/jquery-1.10.2.js diff --git a/bbb/html/js/jquery-1.7.1.min.js b/html/js/jquery-1.7.1.min.js similarity index 100% rename from bbb/html/js/jquery-1.7.1.min.js rename to html/js/jquery-1.7.1.min.js diff --git a/bbb/html/js/jquery-ui-1.8.17.custom.min.js b/html/js/jquery-ui-1.8.17.custom.min.js similarity index 100% rename from bbb/html/js/jquery-ui-1.8.17.custom.min.js rename to html/js/jquery-ui-1.8.17.custom.min.js diff --git a/bbb/html/js/jquery.min.js b/html/js/jquery.min.js similarity index 100% rename from bbb/html/js/jquery.min.js rename to html/js/jquery.min.js diff --git a/bbb/html/js/less.js b/html/js/less.js similarity index 100% rename from bbb/html/js/less.js rename to html/js/less.js diff --git a/bbb/html/js/modernizr/2.6.1_smallest.js b/html/js/modernizr/2.6.1_smallest.js similarity index 100% rename from bbb/html/js/modernizr/2.6.1_smallest.js rename to html/js/modernizr/2.6.1_smallest.js diff --git a/bbb/html/js/script.js b/html/js/script.js similarity index 100% rename from bbb/html/js/script.js rename to html/js/script.js diff --git a/bbb/html/phpinfo.php b/html/phpinfo.php similarity index 100% rename from bbb/html/phpinfo.php rename to html/phpinfo.php diff --git a/bbb/html/src/CBehovsboboxen/403.tpl.php b/html/src/CBehovsboboxen/403.tpl.php similarity index 100% rename from bbb/html/src/CBehovsboboxen/403.tpl.php rename to html/src/CBehovsboboxen/403.tpl.php diff --git a/bbb/html/src/CBehovsboboxen/404.tpl.php b/html/src/CBehovsboboxen/404.tpl.php similarity index 100% rename from bbb/html/src/CBehovsboboxen/404.tpl.php rename to html/src/CBehovsboboxen/404.tpl.php diff --git a/bbb/html/src/CBehovsboboxen/CBehovsboboxen.php b/html/src/CBehovsboboxen/CBehovsboboxen.php similarity index 100% rename from bbb/html/src/CBehovsboboxen/CBehovsboboxen.php rename to html/src/CBehovsboboxen/CBehovsboboxen.php diff --git a/bbb/html/src/CCAdminControlPanel/CCAdminControlPanel.php b/html/src/CCAdminControlPanel/CCAdminControlPanel.php similarity index 100% rename from bbb/html/src/CCAdminControlPanel/CCAdminControlPanel.php rename to html/src/CCAdminControlPanel/CCAdminControlPanel.php diff --git a/bbb/html/src/CCAdminControlPanel/index.tpl.php b/html/src/CCAdminControlPanel/index.tpl.php similarity index 100% rename from bbb/html/src/CCAdminControlPanel/index.tpl.php rename to html/src/CCAdminControlPanel/index.tpl.php diff --git a/bbb/html/src/CCAdminControlPanel/temperatures.tpl.php b/html/src/CCAdminControlPanel/temperatures.tpl.php similarity index 100% rename from bbb/html/src/CCAdminControlPanel/temperatures.tpl.php rename to html/src/CCAdminControlPanel/temperatures.tpl.php diff --git a/bbb/html/src/CCIndex/CCIndex.php b/html/src/CCIndex/CCIndex.php similarity index 100% rename from bbb/html/src/CCIndex/CCIndex.php rename to html/src/CCIndex/CCIndex.php diff --git a/bbb/html/src/CCPresentation/CCPresentation.php b/html/src/CCPresentation/CCPresentation.php similarity index 100% rename from bbb/html/src/CCPresentation/CCPresentation.php rename to html/src/CCPresentation/CCPresentation.php diff --git a/bbb/html/src/CCPresentation/index.tpl.php b/html/src/CCPresentation/index.tpl.php similarity index 100% rename from bbb/html/src/CCPresentation/index.tpl.php rename to html/src/CCPresentation/index.tpl.php diff --git a/bbb/html/src/CCSpotprices/CCSpotprices.php b/html/src/CCSpotprices/CCSpotprices.php similarity index 100% rename from bbb/html/src/CCSpotprices/CCSpotprices.php rename to html/src/CCSpotprices/CCSpotprices.php diff --git a/bbb/html/src/CCSpotprices/index.tpl.php b/html/src/CCSpotprices/index.tpl.php similarity index 100% rename from bbb/html/src/CCSpotprices/index.tpl.php rename to html/src/CCSpotprices/index.tpl.php diff --git a/bbb/html/src/CCUser/403.tpl.php b/html/src/CCUser/403.tpl.php similarity index 100% rename from bbb/html/src/CCUser/403.tpl.php rename to html/src/CCUser/403.tpl.php diff --git a/bbb/html/src/CCUser/CCUser.php b/html/src/CCUser/CCUser.php similarity index 100% rename from bbb/html/src/CCUser/CCUser.php rename to html/src/CCUser/CCUser.php diff --git a/bbb/html/src/CCUser/login.tpl.php b/html/src/CCUser/login.tpl.php similarity index 100% rename from bbb/html/src/CCUser/login.tpl.php rename to html/src/CCUser/login.tpl.php diff --git a/bbb/html/src/CDatabase/CDatabase.php b/html/src/CDatabase/CDatabase.php similarity index 100% rename from bbb/html/src/CDatabase/CDatabase.php rename to html/src/CDatabase/CDatabase.php diff --git a/bbb/html/src/CForm/CForm.php b/html/src/CForm/CForm.php similarity index 100% rename from bbb/html/src/CForm/CForm.php rename to html/src/CForm/CForm.php diff --git a/bbb/html/src/CForm/README.md b/html/src/CForm/README.md similarity index 100% rename from bbb/html/src/CForm/README.md rename to html/src/CForm/README.md diff --git a/bbb/html/src/CFormUser/CFormUser.php b/html/src/CFormUser/CFormUser.php similarity index 100% rename from bbb/html/src/CFormUser/CFormUser.php rename to html/src/CFormUser/CFormUser.php diff --git a/bbb/html/src/CInterceptionFilter/CInterceptionFilter.php b/html/src/CInterceptionFilter/CInterceptionFilter.php similarity index 100% rename from bbb/html/src/CInterceptionFilter/CInterceptionFilter.php rename to html/src/CInterceptionFilter/CInterceptionFilter.php diff --git a/bbb/html/src/CLog/CLog.php b/html/src/CLog/CLog.php similarity index 100% rename from bbb/html/src/CLog/CLog.php rename to html/src/CLog/CLog.php diff --git a/bbb/html/src/CMTemperatures/CMTemperatures.php b/html/src/CMTemperatures/CMTemperatures.php similarity index 100% rename from bbb/html/src/CMTemperatures/CMTemperatures.php rename to html/src/CMTemperatures/CMTemperatures.php diff --git a/bbb/html/src/CMTextfiles/CMTextfiles.php b/html/src/CMTextfiles/CMTextfiles.php similarity index 100% rename from bbb/html/src/CMTextfiles/CMTextfiles.php rename to html/src/CMTextfiles/CMTextfiles.php diff --git a/bbb/html/src/CMTranslate/CMTranslate.php b/html/src/CMTranslate/CMTranslate.php similarity index 100% rename from bbb/html/src/CMTranslate/CMTranslate.php rename to html/src/CMTranslate/CMTranslate.php diff --git a/bbb/html/src/CMUser/CMUser.php b/html/src/CMUser/CMUser.php similarity index 100% rename from bbb/html/src/CMUser/CMUser.php rename to html/src/CMUser/CMUser.php diff --git a/bbb/html/src/CObject/CObject.php b/html/src/CObject/CObject.php similarity index 100% rename from bbb/html/src/CObject/CObject.php rename to html/src/CObject/CObject.php diff --git a/bbb/html/src/CPageLoader/CPageLoader.php b/html/src/CPageLoader/CPageLoader.php similarity index 100% rename from bbb/html/src/CPageLoader/CPageLoader.php rename to html/src/CPageLoader/CPageLoader.php diff --git a/bbb/html/src/CRequest/CRequest.php b/html/src/CRequest/CRequest.php similarity index 100% rename from bbb/html/src/CRequest/CRequest.php rename to html/src/CRequest/CRequest.php diff --git a/bbb/html/src/CSession/CSession.php b/html/src/CSession/CSession.php similarity index 100% rename from bbb/html/src/CSession/CSession.php rename to html/src/CSession/CSession.php diff --git a/bbb/html/src/CViewContainer/404.tpl.php b/html/src/CViewContainer/404.tpl.php similarity index 100% rename from bbb/html/src/CViewContainer/404.tpl.php rename to html/src/CViewContainer/404.tpl.php diff --git a/bbb/html/src/CViewContainer/CViewContainer.php b/html/src/CViewContainer/CViewContainer.php similarity index 100% rename from bbb/html/src/CViewContainer/CViewContainer.php rename to html/src/CViewContainer/CViewContainer.php diff --git a/bbb/html/src/IController/IController.php b/html/src/IController/IController.php similarity index 100% rename from bbb/html/src/IController/IController.php rename to html/src/IController/IController.php diff --git a/bbb/html/src/IHasSQL/IHasSQL.php b/html/src/IHasSQL/IHasSQL.php similarity index 100% rename from bbb/html/src/IHasSQL/IHasSQL.php rename to html/src/IHasSQL/IHasSQL.php diff --git a/bbb/html/src/IModule/IModule.php b/html/src/IModule/IModule.php similarity index 100% rename from bbb/html/src/IModule/IModule.php rename to html/src/IModule/IModule.php diff --git a/bbb/html/src/ISingleton/ISingleton.php b/html/src/ISingleton/ISingleton.php similarity index 100% rename from bbb/html/src/ISingleton/ISingleton.php rename to html/src/ISingleton/ISingleton.php diff --git a/bbb/html/src/bootstrap.php b/html/src/bootstrap.php similarity index 100% rename from bbb/html/src/bootstrap.php rename to html/src/bootstrap.php diff --git a/bbb/html/themes/bb/box.jpg b/html/themes/bb/box.jpg similarity index 100% rename from bbb/html/themes/bb/box.jpg rename to html/themes/bb/box.jpg diff --git a/bbb/html/themes/bb/default.tpl.php b/html/themes/bb/default.tpl.php similarity index 100% rename from bbb/html/themes/bb/default.tpl.php rename to html/themes/bb/default.tpl.php diff --git a/bbb/html/themes/bb/index.tpl.php b/html/themes/bb/index.tpl.php similarity index 100% rename from bbb/html/themes/bb/index.tpl.php rename to html/themes/bb/index.tpl.php diff --git a/bbb/html/themes/bb/jquery_ui.css b/html/themes/bb/jquery_ui.css similarity index 100% rename from bbb/html/themes/bb/jquery_ui.css rename to html/themes/bb/jquery_ui.css diff --git a/bbb/html/themes/bb/smallbox.jpg b/html/themes/bb/smallbox.jpg similarity index 100% rename from bbb/html/themes/bb/smallbox.jpg rename to html/themes/bb/smallbox.jpg diff --git a/bbb/html/themes/bb/style.css b/html/themes/bb/style.css similarity index 100% rename from bbb/html/themes/bb/style.css rename to html/themes/bb/style.css diff --git a/bbb/html/themes/functions.php b/html/themes/functions.php similarity index 100% rename from bbb/html/themes/functions.php rename to html/themes/functions.php diff --git a/bbb/html/themes/images/aqua_dayDown.gif b/html/themes/images/aqua_dayDown.gif similarity index 100% rename from bbb/html/themes/images/aqua_dayDown.gif rename to html/themes/images/aqua_dayDown.gif diff --git a/bbb/html/themes/images/aqua_dayNormal.gif b/html/themes/images/aqua_dayNormal.gif similarity index 100% rename from bbb/html/themes/images/aqua_dayNormal.gif rename to html/themes/images/aqua_dayNormal.gif diff --git a/bbb/html/themes/images/aqua_dayOver.gif b/html/themes/images/aqua_dayOver.gif similarity index 100% rename from bbb/html/themes/images/aqua_dayOver.gif rename to html/themes/images/aqua_dayOver.gif diff --git a/bbb/html/themes/images/armygreen_dayDown.gif b/html/themes/images/armygreen_dayDown.gif similarity index 100% rename from bbb/html/themes/images/armygreen_dayDown.gif rename to html/themes/images/armygreen_dayDown.gif diff --git a/bbb/html/themes/images/armygreen_dayNormal.gif b/html/themes/images/armygreen_dayNormal.gif similarity index 100% rename from bbb/html/themes/images/armygreen_dayNormal.gif rename to html/themes/images/armygreen_dayNormal.gif diff --git a/bbb/html/themes/images/armygreen_dayOver.gif b/html/themes/images/armygreen_dayOver.gif similarity index 100% rename from bbb/html/themes/images/armygreen_dayOver.gif rename to html/themes/images/armygreen_dayOver.gif diff --git a/bbb/html/themes/images/background-grad.png b/html/themes/images/background-grad.png similarity index 100% rename from bbb/html/themes/images/background-grad.png rename to html/themes/images/background-grad.png diff --git a/bbb/html/themes/images/bananasplit_dayDown.gif b/html/themes/images/bananasplit_dayDown.gif similarity index 100% rename from bbb/html/themes/images/bananasplit_dayDown.gif rename to html/themes/images/bananasplit_dayDown.gif diff --git a/bbb/html/themes/images/bananasplit_dayNormal.gif b/html/themes/images/bananasplit_dayNormal.gif similarity index 100% rename from bbb/html/themes/images/bananasplit_dayNormal.gif rename to html/themes/images/bananasplit_dayNormal.gif diff --git a/bbb/html/themes/images/bananasplit_dayOver.gif b/html/themes/images/bananasplit_dayOver.gif similarity index 100% rename from bbb/html/themes/images/bananasplit_dayOver.gif rename to html/themes/images/bananasplit_dayOver.gif diff --git a/bbb/html/themes/images/beige_dayDown.gif b/html/themes/images/beige_dayDown.gif similarity index 100% rename from bbb/html/themes/images/beige_dayDown.gif rename to html/themes/images/beige_dayDown.gif diff --git a/bbb/html/themes/images/beige_dayNormal.gif b/html/themes/images/beige_dayNormal.gif similarity index 100% rename from bbb/html/themes/images/beige_dayNormal.gif rename to html/themes/images/beige_dayNormal.gif diff --git a/bbb/html/themes/images/beige_dayOver.gif b/html/themes/images/beige_dayOver.gif similarity index 100% rename from bbb/html/themes/images/beige_dayOver.gif rename to html/themes/images/beige_dayOver.gif diff --git a/bbb/html/themes/images/bg_header.jpg b/html/themes/images/bg_header.jpg similarity index 100% rename from bbb/html/themes/images/bg_header.jpg rename to html/themes/images/bg_header.jpg diff --git a/bbb/html/themes/images/boxBottomLeftCorner.png b/html/themes/images/boxBottomLeftCorner.png similarity index 100% rename from bbb/html/themes/images/boxBottomLeftCorner.png rename to html/themes/images/boxBottomLeftCorner.png diff --git a/bbb/html/themes/images/boxBottomRightCorner.png b/html/themes/images/boxBottomRightCorner.png similarity index 100% rename from bbb/html/themes/images/boxBottomRightCorner.png rename to html/themes/images/boxBottomRightCorner.png diff --git a/bbb/html/themes/images/boxSideWallPx.gif b/html/themes/images/boxSideWallPx.gif similarity index 100% rename from bbb/html/themes/images/boxSideWallPx.gif rename to html/themes/images/boxSideWallPx.gif diff --git a/bbb/html/themes/images/boxSideWallPx.png b/html/themes/images/boxSideWallPx.png similarity index 100% rename from bbb/html/themes/images/boxSideWallPx.png rename to html/themes/images/boxSideWallPx.png diff --git a/bbb/html/themes/images/boxTopLeftCorner.png b/html/themes/images/boxTopLeftCorner.png similarity index 100% rename from bbb/html/themes/images/boxTopLeftCorner.png rename to html/themes/images/boxTopLeftCorner.png diff --git a/bbb/html/themes/images/boxTopPx.gif b/html/themes/images/boxTopPx.gif similarity index 100% rename from bbb/html/themes/images/boxTopPx.gif rename to html/themes/images/boxTopPx.gif diff --git a/bbb/html/themes/images/boxTopPx.png b/html/themes/images/boxTopPx.png similarity index 100% rename from bbb/html/themes/images/boxTopPx.png rename to html/themes/images/boxTopPx.png diff --git a/bbb/html/themes/images/boxTopRightCorner.png b/html/themes/images/boxTopRightCorner.png similarity index 100% rename from bbb/html/themes/images/boxTopRightCorner.png rename to html/themes/images/boxTopRightCorner.png diff --git a/bbb/html/themes/images/bullet1.gif b/html/themes/images/bullet1.gif similarity index 100% rename from bbb/html/themes/images/bullet1.gif rename to html/themes/images/bullet1.gif diff --git a/bbb/html/themes/images/calendar.png b/html/themes/images/calendar.png similarity index 100% rename from bbb/html/themes/images/calendar.png rename to html/themes/images/calendar.png diff --git a/bbb/html/themes/images/closeButton_down.gif b/html/themes/images/closeButton_down.gif similarity index 100% rename from bbb/html/themes/images/closeButton_down.gif rename to html/themes/images/closeButton_down.gif diff --git a/bbb/html/themes/images/closeButton_normal.gif b/html/themes/images/closeButton_normal.gif similarity index 100% rename from bbb/html/themes/images/closeButton_normal.gif rename to html/themes/images/closeButton_normal.gif diff --git a/bbb/html/themes/images/closeButton_over.gif b/html/themes/images/closeButton_over.gif similarity index 100% rename from bbb/html/themes/images/closeButton_over.gif rename to html/themes/images/closeButton_over.gif diff --git a/bbb/html/themes/images/deepblue_dayDown.gif b/html/themes/images/deepblue_dayDown.gif similarity index 100% rename from bbb/html/themes/images/deepblue_dayDown.gif rename to html/themes/images/deepblue_dayDown.gif diff --git a/bbb/html/themes/images/deepblue_dayNormal.gif b/html/themes/images/deepblue_dayNormal.gif similarity index 100% rename from bbb/html/themes/images/deepblue_dayNormal.gif rename to html/themes/images/deepblue_dayNormal.gif diff --git a/bbb/html/themes/images/deepblue_dayOver.gif b/html/themes/images/deepblue_dayOver.gif similarity index 100% rename from bbb/html/themes/images/deepblue_dayOver.gif rename to html/themes/images/deepblue_dayOver.gif diff --git a/bbb/html/themes/images/greenish_dayDown.gif b/html/themes/images/greenish_dayDown.gif similarity index 100% rename from bbb/html/themes/images/greenish_dayDown.gif rename to html/themes/images/greenish_dayDown.gif diff --git a/bbb/html/themes/images/greenish_dayOver.gif b/html/themes/images/greenish_dayOver.gif similarity index 100% rename from bbb/html/themes/images/greenish_dayOver.gif rename to html/themes/images/greenish_dayOver.gif diff --git a/bbb/html/themes/images/handle.png b/html/themes/images/handle.png similarity index 100% rename from bbb/html/themes/images/handle.png rename to html/themes/images/handle.png diff --git a/bbb/html/themes/images/header-corners.png b/html/themes/images/header-corners.png similarity index 100% rename from bbb/html/themes/images/header-corners.png rename to html/themes/images/header-corners.png diff --git a/bbb/html/themes/images/homeIcon.png b/html/themes/images/homeIcon.png similarity index 100% rename from bbb/html/themes/images/homeIcon.png rename to html/themes/images/homeIcon.png diff --git a/bbb/html/themes/images/lightgreen_dayDown.gif b/html/themes/images/lightgreen_dayDown.gif similarity index 100% rename from bbb/html/themes/images/lightgreen_dayDown.gif rename to html/themes/images/lightgreen_dayDown.gif diff --git a/bbb/html/themes/images/lightgreen_dayNormal.gif b/html/themes/images/lightgreen_dayNormal.gif similarity index 100% rename from bbb/html/themes/images/lightgreen_dayNormal.gif rename to html/themes/images/lightgreen_dayNormal.gif diff --git a/bbb/html/themes/images/lightgreen_dayOver.gif b/html/themes/images/lightgreen_dayOver.gif similarity index 100% rename from bbb/html/themes/images/lightgreen_dayOver.gif rename to html/themes/images/lightgreen_dayOver.gif diff --git a/bbb/html/themes/images/loader.gif b/html/themes/images/loader.gif similarity index 100% rename from bbb/html/themes/images/loader.gif rename to html/themes/images/loader.gif diff --git a/bbb/html/themes/images/monthBackward_down.gif b/html/themes/images/monthBackward_down.gif similarity index 100% rename from bbb/html/themes/images/monthBackward_down.gif rename to html/themes/images/monthBackward_down.gif diff --git a/bbb/html/themes/images/monthBackward_normal.gif b/html/themes/images/monthBackward_normal.gif similarity index 100% rename from bbb/html/themes/images/monthBackward_normal.gif rename to html/themes/images/monthBackward_normal.gif diff --git a/bbb/html/themes/images/monthBackward_over.gif b/html/themes/images/monthBackward_over.gif similarity index 100% rename from bbb/html/themes/images/monthBackward_over.gif rename to html/themes/images/monthBackward_over.gif diff --git a/bbb/html/themes/images/monthForward_down.gif b/html/themes/images/monthForward_down.gif similarity index 100% rename from bbb/html/themes/images/monthForward_down.gif rename to html/themes/images/monthForward_down.gif diff --git a/bbb/html/themes/images/monthForward_normal.gif b/html/themes/images/monthForward_normal.gif similarity index 100% rename from bbb/html/themes/images/monthForward_normal.gif rename to html/themes/images/monthForward_normal.gif diff --git a/bbb/html/themes/images/monthForward_over.gif b/html/themes/images/monthForward_over.gif similarity index 100% rename from bbb/html/themes/images/monthForward_over.gif rename to html/themes/images/monthForward_over.gif diff --git a/bbb/html/themes/images/ocean_blue_dayDown.gif b/html/themes/images/ocean_blue_dayDown.gif similarity index 100% rename from bbb/html/themes/images/ocean_blue_dayDown.gif rename to html/themes/images/ocean_blue_dayDown.gif diff --git a/bbb/html/themes/images/ocean_blue_dayNormal.gif b/html/themes/images/ocean_blue_dayNormal.gif similarity index 100% rename from bbb/html/themes/images/ocean_blue_dayNormal.gif rename to html/themes/images/ocean_blue_dayNormal.gif diff --git a/bbb/html/themes/images/ocean_blue_dayOver.gif b/html/themes/images/ocean_blue_dayOver.gif similarity index 100% rename from bbb/html/themes/images/ocean_blue_dayOver.gif rename to html/themes/images/ocean_blue_dayOver.gif diff --git a/bbb/html/themes/images/orange_dayDown.gif b/html/themes/images/orange_dayDown.gif similarity index 100% rename from bbb/html/themes/images/orange_dayDown.gif rename to html/themes/images/orange_dayDown.gif diff --git a/bbb/html/themes/images/orange_dayNormal.gif b/html/themes/images/orange_dayNormal.gif similarity index 100% rename from bbb/html/themes/images/orange_dayNormal.gif rename to html/themes/images/orange_dayNormal.gif diff --git a/bbb/html/themes/images/orange_dayOver.gif b/html/themes/images/orange_dayOver.gif similarity index 100% rename from bbb/html/themes/images/orange_dayOver.gif rename to html/themes/images/orange_dayOver.gif diff --git a/bbb/html/themes/images/peppermint_dayDown.gif b/html/themes/images/peppermint_dayDown.gif similarity index 100% rename from bbb/html/themes/images/peppermint_dayDown.gif rename to html/themes/images/peppermint_dayDown.gif diff --git a/bbb/html/themes/images/peppermint_dayNormal.gif b/html/themes/images/peppermint_dayNormal.gif similarity index 100% rename from bbb/html/themes/images/peppermint_dayNormal.gif rename to html/themes/images/peppermint_dayNormal.gif diff --git a/bbb/html/themes/images/peppermint_dayOver.gif b/html/themes/images/peppermint_dayOver.gif similarity index 100% rename from bbb/html/themes/images/peppermint_dayOver.gif rename to html/themes/images/peppermint_dayOver.gif diff --git a/bbb/html/themes/images/pink_dayDown.gif b/html/themes/images/pink_dayDown.gif similarity index 100% rename from bbb/html/themes/images/pink_dayDown.gif rename to html/themes/images/pink_dayDown.gif diff --git a/bbb/html/themes/images/pink_dayNormal.gif b/html/themes/images/pink_dayNormal.gif similarity index 100% rename from bbb/html/themes/images/pink_dayNormal.gif rename to html/themes/images/pink_dayNormal.gif diff --git a/bbb/html/themes/images/pink_dayOver.gif b/html/themes/images/pink_dayOver.gif similarity index 100% rename from bbb/html/themes/images/pink_dayOver.gif rename to html/themes/images/pink_dayOver.gif diff --git a/bbb/html/themes/images/purple_dayDown.gif b/html/themes/images/purple_dayDown.gif similarity index 100% rename from bbb/html/themes/images/purple_dayDown.gif rename to html/themes/images/purple_dayDown.gif diff --git a/bbb/html/themes/images/purple_dayNormal.gif b/html/themes/images/purple_dayNormal.gif similarity index 100% rename from bbb/html/themes/images/purple_dayNormal.gif rename to html/themes/images/purple_dayNormal.gif diff --git a/bbb/html/themes/images/purple_dayOver.gif b/html/themes/images/purple_dayOver.gif similarity index 100% rename from bbb/html/themes/images/purple_dayOver.gif rename to html/themes/images/purple_dayOver.gif diff --git a/bbb/html/themes/images/torqoise_dayDown.gif b/html/themes/images/torqoise_dayDown.gif similarity index 100% rename from bbb/html/themes/images/torqoise_dayDown.gif rename to html/themes/images/torqoise_dayDown.gif diff --git a/bbb/html/themes/images/torqoise_dayNormal.gif b/html/themes/images/torqoise_dayNormal.gif similarity index 100% rename from bbb/html/themes/images/torqoise_dayNormal.gif rename to html/themes/images/torqoise_dayNormal.gif diff --git a/bbb/html/themes/images/torqoise_dayOver.gif b/html/themes/images/torqoise_dayOver.gif similarity index 100% rename from bbb/html/themes/images/torqoise_dayOver.gif rename to html/themes/images/torqoise_dayOver.gif diff --git a/bbb/html/themes/images/ui-bg_diagonals-thick_18_b81900_40x40.png b/html/themes/images/ui-bg_diagonals-thick_18_b81900_40x40.png similarity index 100% rename from bbb/html/themes/images/ui-bg_diagonals-thick_18_b81900_40x40.png rename to html/themes/images/ui-bg_diagonals-thick_18_b81900_40x40.png diff --git a/bbb/html/themes/images/ui-bg_diagonals-thick_20_666666_40x40.png b/html/themes/images/ui-bg_diagonals-thick_20_666666_40x40.png similarity index 100% rename from bbb/html/themes/images/ui-bg_diagonals-thick_20_666666_40x40.png rename to html/themes/images/ui-bg_diagonals-thick_20_666666_40x40.png diff --git a/bbb/html/themes/images/ui-bg_flat_10_000000_40x100.png b/html/themes/images/ui-bg_flat_10_000000_40x100.png similarity index 100% rename from bbb/html/themes/images/ui-bg_flat_10_000000_40x100.png rename to html/themes/images/ui-bg_flat_10_000000_40x100.png diff --git a/bbb/html/themes/images/ui-bg_glass_100_f6f6f6_1x400.png b/html/themes/images/ui-bg_glass_100_f6f6f6_1x400.png similarity index 100% rename from bbb/html/themes/images/ui-bg_glass_100_f6f6f6_1x400.png rename to html/themes/images/ui-bg_glass_100_f6f6f6_1x400.png diff --git a/bbb/html/themes/images/ui-bg_glass_100_fdf5ce_1x400.png b/html/themes/images/ui-bg_glass_100_fdf5ce_1x400.png similarity index 100% rename from bbb/html/themes/images/ui-bg_glass_100_fdf5ce_1x400.png rename to html/themes/images/ui-bg_glass_100_fdf5ce_1x400.png diff --git a/bbb/html/themes/images/ui-bg_glass_65_ffffff_1x400.png b/html/themes/images/ui-bg_glass_65_ffffff_1x400.png similarity index 100% rename from bbb/html/themes/images/ui-bg_glass_65_ffffff_1x400.png rename to html/themes/images/ui-bg_glass_65_ffffff_1x400.png diff --git a/bbb/html/themes/images/ui-bg_gloss-wave_35_f6a828_500x100.png b/html/themes/images/ui-bg_gloss-wave_35_f6a828_500x100.png similarity index 100% rename from bbb/html/themes/images/ui-bg_gloss-wave_35_f6a828_500x100.png rename to html/themes/images/ui-bg_gloss-wave_35_f6a828_500x100.png diff --git a/bbb/html/themes/images/ui-bg_highlight-soft_100_eeeeee_1x100.png b/html/themes/images/ui-bg_highlight-soft_100_eeeeee_1x100.png similarity index 100% rename from bbb/html/themes/images/ui-bg_highlight-soft_100_eeeeee_1x100.png rename to html/themes/images/ui-bg_highlight-soft_100_eeeeee_1x100.png diff --git a/bbb/html/themes/images/ui-bg_highlight-soft_75_ffe45c_1x100.png b/html/themes/images/ui-bg_highlight-soft_75_ffe45c_1x100.png similarity index 100% rename from bbb/html/themes/images/ui-bg_highlight-soft_75_ffe45c_1x100.png rename to html/themes/images/ui-bg_highlight-soft_75_ffe45c_1x100.png diff --git a/bbb/html/themes/images/ui-icons_222222_256x240.png b/html/themes/images/ui-icons_222222_256x240.png similarity index 100% rename from bbb/html/themes/images/ui-icons_222222_256x240.png rename to html/themes/images/ui-icons_222222_256x240.png diff --git a/bbb/html/themes/images/ui-icons_228ef1_256x240.png b/html/themes/images/ui-icons_228ef1_256x240.png similarity index 100% rename from bbb/html/themes/images/ui-icons_228ef1_256x240.png rename to html/themes/images/ui-icons_228ef1_256x240.png diff --git a/bbb/html/themes/images/ui-icons_ef8c08_256x240.png b/html/themes/images/ui-icons_ef8c08_256x240.png similarity index 100% rename from bbb/html/themes/images/ui-icons_ef8c08_256x240.png rename to html/themes/images/ui-icons_ef8c08_256x240.png diff --git a/bbb/html/themes/images/ui-icons_ffd27a_256x240.png b/html/themes/images/ui-icons_ffd27a_256x240.png similarity index 100% rename from bbb/html/themes/images/ui-icons_ffd27a_256x240.png rename to html/themes/images/ui-icons_ffd27a_256x240.png diff --git a/bbb/html/themes/images/ui-icons_ffffff_256x240.png b/html/themes/images/ui-icons_ffffff_256x240.png similarity index 100% rename from bbb/html/themes/images/ui-icons_ffffff_256x240.png rename to html/themes/images/ui-icons_ffffff_256x240.png diff --git a/bbb/html/themes/images/yearBackward_down.gif b/html/themes/images/yearBackward_down.gif similarity index 100% rename from bbb/html/themes/images/yearBackward_down.gif rename to html/themes/images/yearBackward_down.gif diff --git a/bbb/html/themes/images/yearBackward_normal.gif b/html/themes/images/yearBackward_normal.gif similarity index 100% rename from bbb/html/themes/images/yearBackward_normal.gif rename to html/themes/images/yearBackward_normal.gif diff --git a/bbb/html/themes/images/yearBackward_over.gif b/html/themes/images/yearBackward_over.gif similarity index 100% rename from bbb/html/themes/images/yearBackward_over.gif rename to html/themes/images/yearBackward_over.gif diff --git a/bbb/html/themes/images/yearForward_down.gif b/html/themes/images/yearForward_down.gif similarity index 100% rename from bbb/html/themes/images/yearForward_down.gif rename to html/themes/images/yearForward_down.gif diff --git a/bbb/html/themes/images/yearForward_normal.gif b/html/themes/images/yearForward_normal.gif similarity index 100% rename from bbb/html/themes/images/yearForward_normal.gif rename to html/themes/images/yearForward_normal.gif diff --git a/bbb/html/themes/images/yearForward_over.gif b/html/themes/images/yearForward_over.gif similarity index 100% rename from bbb/html/themes/images/yearForward_over.gif rename to html/themes/images/yearForward_over.gif diff --git a/bbb/scripts/000-default-ssl b/scripts/000-default-ssl similarity index 100% rename from bbb/scripts/000-default-ssl rename to scripts/000-default-ssl diff --git a/bbb/scripts/apache2.conf b/scripts/apache2.conf similarity index 100% rename from bbb/scripts/apache2.conf rename to scripts/apache2.conf diff --git a/bbb/scripts/cron.txt b/scripts/cron.txt similarity index 100% rename from bbb/scripts/cron.txt rename to scripts/cron.txt diff --git a/bbb/scripts/dallas.py b/scripts/dallas.py similarity index 100% rename from bbb/scripts/dallas.py rename to scripts/dallas.py diff --git a/bbb/scripts/default-ssl b/scripts/default-ssl similarity index 100% rename from bbb/scripts/default-ssl rename to scripts/default-ssl diff --git a/bbb/scripts/default-ssl.conf b/scripts/default-ssl.conf similarity index 100% rename from bbb/scripts/default-ssl.conf rename to scripts/default-ssl.conf diff --git a/bbb/scripts/getspotprice.py b/scripts/getspotprice.py similarity index 100% rename from bbb/scripts/getspotprice.py rename to scripts/getspotprice.py diff --git a/bbb/scripts/rc.local b/scripts/rc.local similarity index 100% rename from bbb/scripts/rc.local rename to scripts/rc.local diff --git a/bbb/scripts/script.sh b/scripts/script.sh similarity index 100% rename from bbb/scripts/script.sh rename to scripts/script.sh diff --git a/bbb/scripts/script2.sh b/scripts/script2.sh similarity index 100% rename from bbb/scripts/script2.sh rename to scripts/script2.sh diff --git a/bbb/ssl/text b/ssl/text similarity index 100% rename from bbb/ssl/text rename to ssl/text From e9d2e5c29ed0057cebc6e817ec30fcbfd8ff8742 Mon Sep 17 00:00:00 2001 From: Ulf Bengtner Date: Tue, 12 Apr 2016 22:43:37 +0200 Subject: [PATCH 02/11] moved hidden file from bbb --- bbb/.htaccess => .htaccess | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename bbb/.htaccess => .htaccess (100%) diff --git a/bbb/.htaccess b/.htaccess similarity index 100% rename from bbb/.htaccess rename to .htaccess From 3829d07edf1f02f1b735e9e1c3be38090685c7e5 Mon Sep 17 00:00:00 2001 From: Ulf Bengtner Date: Tue, 12 Apr 2016 22:56:50 +0200 Subject: [PATCH 03/11] moved bbb_addon into BehovsBoBoxen --- bbb_addon | 1 + 1 file changed, 1 insertion(+) create mode 160000 bbb_addon diff --git a/bbb_addon b/bbb_addon new file mode 160000 index 0000000..a8b7843 --- /dev/null +++ b/bbb_addon @@ -0,0 +1 @@ +Subproject commit a8b7843f58686df059d1469523593db0badf9fb6 From 2e3c2d24113939168c033ec0ddadc1a17c17b0fc Mon Sep 17 00:00:00 2001 From: Ulf Bengtner Date: Sun, 17 Apr 2016 21:40:29 +0200 Subject: [PATCH 04/11] install.sh modified for new directory structure, rebase with upstream master --- .htaccess | 0 LICENSE.txt | 0 README.md | 0 html/.htaccess | 0 html/application/config.php | 0 html/application/data/.ht.sqlite3 | Bin html/application/textfile/currentPrices.txt | 0 html/application/textfile/newPrices.txt | 0 html/application/textfile/room0.txt | 0 html/application/textfile/room1.txt | 0 html/application/textfile/room2.txt | 0 html/application/textfile/room3.txt | 0 html/application/textfile/room4.txt | 0 html/application/textfile/room5.txt | 0 html/application/textfile/room6.txt | 0 html/application/textfile/room7.txt | 0 html/application/textfile/spotprice.txt | 0 html/application/textfile/spotprice2.txt | 0 html/application/textfile/temperature.txt | 0 html/index.php | 0 html/js/_1.11.4_jquery-ui.js | 0 html/js/canvasjs.min.js | 0 html/js/jquery-1.10.2.js | 0 html/js/jquery-1.7.1.min.js | 0 html/js/jquery-ui-1.8.17.custom.min.js | 0 html/js/jquery.min.js | 0 html/js/less.js | 0 html/js/modernizr/2.6.1_smallest.js | 0 html/js/script.js | 0 html/phpinfo.php | 0 html/src/CBehovsboboxen/403.tpl.php | 0 html/src/CBehovsboboxen/404.tpl.php | 0 html/src/CBehovsboboxen/CBehovsboboxen.php | 0 .../CCAdminControlPanel.php | 0 html/src/CCAdminControlPanel/index.tpl.php | 0 .../CCAdminControlPanel/temperatures.tpl.php | 0 html/src/CCIndex/CCIndex.php | 0 html/src/CCPresentation/CCPresentation.php | 0 html/src/CCPresentation/index.tpl.php | 0 html/src/CCSpotprices/CCSpotprices.php | 0 html/src/CCSpotprices/index.tpl.php | 0 html/src/CCUser/403.tpl.php | 0 html/src/CCUser/CCUser.php | 0 html/src/CCUser/login.tpl.php | 0 html/src/CDatabase/CDatabase.php | 0 html/src/CForm/CForm.php | 0 html/src/CForm/README.md | 0 html/src/CFormUser/CFormUser.php | 0 .../CInterceptionFilter.php | 0 html/src/CLog/CLog.php | 0 html/src/CMTemperatures/CMTemperatures.php | 0 html/src/CMTextfiles/CMTextfiles.php | 0 html/src/CMTranslate/CMTranslate.php | 0 html/src/CMUser/CMUser.php | 0 html/src/CObject/CObject.php | 0 html/src/CPageLoader/CPageLoader.php | 0 html/src/CRequest/CRequest.php | 0 html/src/CSession/CSession.php | 0 html/src/CViewContainer/404.tpl.php | 0 html/src/CViewContainer/CViewContainer.php | 0 html/src/IController/IController.php | 0 html/src/IHasSQL/IHasSQL.php | 0 html/src/IModule/IModule.php | 0 html/src/ISingleton/ISingleton.php | 0 html/src/bootstrap.php | 0 html/themes/bb/box.jpg | Bin html/themes/bb/default.tpl.php | 0 html/themes/bb/index.tpl.php | 0 html/themes/bb/jquery_ui.css | 0 html/themes/bb/smallbox.jpg | Bin html/themes/bb/style.css | 0 html/themes/functions.php | 0 html/themes/images/aqua_dayDown.gif | Bin html/themes/images/aqua_dayNormal.gif | Bin html/themes/images/aqua_dayOver.gif | Bin html/themes/images/armygreen_dayDown.gif | Bin html/themes/images/armygreen_dayNormal.gif | Bin html/themes/images/armygreen_dayOver.gif | Bin html/themes/images/background-grad.png | Bin html/themes/images/bananasplit_dayDown.gif | Bin html/themes/images/bananasplit_dayNormal.gif | Bin html/themes/images/bananasplit_dayOver.gif | Bin html/themes/images/beige_dayDown.gif | Bin html/themes/images/beige_dayNormal.gif | Bin html/themes/images/beige_dayOver.gif | Bin html/themes/images/bg_header.jpg | Bin html/themes/images/boxBottomLeftCorner.png | Bin html/themes/images/boxBottomRightCorner.png | Bin html/themes/images/boxSideWallPx.gif | Bin html/themes/images/boxSideWallPx.png | Bin html/themes/images/boxTopLeftCorner.png | Bin html/themes/images/boxTopPx.gif | Bin html/themes/images/boxTopPx.png | Bin html/themes/images/boxTopRightCorner.png | Bin html/themes/images/bullet1.gif | Bin html/themes/images/calendar.png | Bin html/themes/images/closeButton_down.gif | Bin html/themes/images/closeButton_normal.gif | Bin html/themes/images/closeButton_over.gif | Bin html/themes/images/deepblue_dayDown.gif | Bin html/themes/images/deepblue_dayNormal.gif | Bin html/themes/images/deepblue_dayOver.gif | Bin html/themes/images/greenish_dayDown.gif | Bin html/themes/images/greenish_dayOver.gif | Bin html/themes/images/handle.png | Bin html/themes/images/header-corners.png | Bin html/themes/images/homeIcon.png | Bin html/themes/images/lightgreen_dayDown.gif | Bin html/themes/images/lightgreen_dayNormal.gif | Bin html/themes/images/lightgreen_dayOver.gif | Bin html/themes/images/loader.gif | Bin html/themes/images/monthBackward_down.gif | Bin html/themes/images/monthBackward_normal.gif | Bin html/themes/images/monthBackward_over.gif | Bin html/themes/images/monthForward_down.gif | Bin html/themes/images/monthForward_normal.gif | Bin html/themes/images/monthForward_over.gif | Bin html/themes/images/ocean_blue_dayDown.gif | Bin html/themes/images/ocean_blue_dayNormal.gif | Bin html/themes/images/ocean_blue_dayOver.gif | Bin html/themes/images/orange_dayDown.gif | Bin html/themes/images/orange_dayNormal.gif | Bin html/themes/images/orange_dayOver.gif | Bin html/themes/images/peppermint_dayDown.gif | Bin html/themes/images/peppermint_dayNormal.gif | Bin html/themes/images/peppermint_dayOver.gif | Bin html/themes/images/pink_dayDown.gif | Bin html/themes/images/pink_dayNormal.gif | Bin html/themes/images/pink_dayOver.gif | Bin html/themes/images/purple_dayDown.gif | Bin html/themes/images/purple_dayNormal.gif | Bin html/themes/images/purple_dayOver.gif | Bin html/themes/images/torqoise_dayDown.gif | Bin html/themes/images/torqoise_dayNormal.gif | Bin html/themes/images/torqoise_dayOver.gif | Bin .../ui-bg_diagonals-thick_18_b81900_40x40.png | Bin .../ui-bg_diagonals-thick_20_666666_40x40.png | Bin .../images/ui-bg_flat_10_000000_40x100.png | Bin .../images/ui-bg_glass_100_f6f6f6_1x400.png | Bin .../images/ui-bg_glass_100_fdf5ce_1x400.png | Bin .../images/ui-bg_glass_65_ffffff_1x400.png | Bin .../ui-bg_gloss-wave_35_f6a828_500x100.png | Bin .../ui-bg_highlight-soft_100_eeeeee_1x100.png | Bin .../ui-bg_highlight-soft_75_ffe45c_1x100.png | Bin .../themes/images/ui-icons_222222_256x240.png | Bin .../themes/images/ui-icons_228ef1_256x240.png | Bin .../themes/images/ui-icons_ef8c08_256x240.png | Bin .../themes/images/ui-icons_ffd27a_256x240.png | Bin .../themes/images/ui-icons_ffffff_256x240.png | Bin html/themes/images/yearBackward_down.gif | Bin html/themes/images/yearBackward_normal.gif | Bin html/themes/images/yearBackward_over.gif | Bin html/themes/images/yearForward_down.gif | Bin html/themes/images/yearForward_normal.gif | Bin html/themes/images/yearForward_over.gif | Bin install.sh | 274 +++++++++++------- scripts/000-default-ssl | 0 scripts/apache2.conf | 0 scripts/cron.txt | 0 scripts/dallas.py | 0 scripts/default-ssl | 0 scripts/default-ssl.conf | 0 scripts/getspotprice.py | 0 scripts/rc.local | 0 scripts/script.sh | 0 scripts/script2.sh | 0 ssl/text | 0 167 files changed, 170 insertions(+), 104 deletions(-) mode change 100644 => 100755 .htaccess mode change 100644 => 100755 LICENSE.txt mode change 100644 => 100755 README.md mode change 100644 => 100755 html/.htaccess mode change 100644 => 100755 html/application/config.php mode change 100644 => 100755 html/application/data/.ht.sqlite3 mode change 100644 => 100755 html/application/textfile/currentPrices.txt mode change 100644 => 100755 html/application/textfile/newPrices.txt mode change 100644 => 100755 html/application/textfile/room0.txt mode change 100644 => 100755 html/application/textfile/room1.txt mode change 100644 => 100755 html/application/textfile/room2.txt mode change 100644 => 100755 html/application/textfile/room3.txt mode change 100644 => 100755 html/application/textfile/room4.txt mode change 100644 => 100755 html/application/textfile/room5.txt mode change 100644 => 100755 html/application/textfile/room6.txt mode change 100644 => 100755 html/application/textfile/room7.txt mode change 100644 => 100755 html/application/textfile/spotprice.txt mode change 100644 => 100755 html/application/textfile/spotprice2.txt mode change 100644 => 100755 html/application/textfile/temperature.txt mode change 100644 => 100755 html/index.php mode change 100644 => 100755 html/js/_1.11.4_jquery-ui.js mode change 100644 => 100755 html/js/canvasjs.min.js mode change 100644 => 100755 html/js/jquery-1.10.2.js mode change 100644 => 100755 html/js/jquery-1.7.1.min.js mode change 100644 => 100755 html/js/jquery-ui-1.8.17.custom.min.js mode change 100644 => 100755 html/js/jquery.min.js mode change 100644 => 100755 html/js/less.js mode change 100644 => 100755 html/js/modernizr/2.6.1_smallest.js mode change 100644 => 100755 html/js/script.js mode change 100644 => 100755 html/phpinfo.php mode change 100644 => 100755 html/src/CBehovsboboxen/403.tpl.php mode change 100644 => 100755 html/src/CBehovsboboxen/404.tpl.php mode change 100644 => 100755 html/src/CBehovsboboxen/CBehovsboboxen.php mode change 100644 => 100755 html/src/CCAdminControlPanel/CCAdminControlPanel.php mode change 100644 => 100755 html/src/CCAdminControlPanel/index.tpl.php mode change 100644 => 100755 html/src/CCAdminControlPanel/temperatures.tpl.php mode change 100644 => 100755 html/src/CCIndex/CCIndex.php mode change 100644 => 100755 html/src/CCPresentation/CCPresentation.php mode change 100644 => 100755 html/src/CCPresentation/index.tpl.php mode change 100644 => 100755 html/src/CCSpotprices/CCSpotprices.php mode change 100644 => 100755 html/src/CCSpotprices/index.tpl.php mode change 100644 => 100755 html/src/CCUser/403.tpl.php mode change 100644 => 100755 html/src/CCUser/CCUser.php mode change 100644 => 100755 html/src/CCUser/login.tpl.php mode change 100644 => 100755 html/src/CDatabase/CDatabase.php mode change 100644 => 100755 html/src/CForm/CForm.php mode change 100644 => 100755 html/src/CForm/README.md mode change 100644 => 100755 html/src/CFormUser/CFormUser.php mode change 100644 => 100755 html/src/CInterceptionFilter/CInterceptionFilter.php mode change 100644 => 100755 html/src/CLog/CLog.php mode change 100644 => 100755 html/src/CMTemperatures/CMTemperatures.php mode change 100644 => 100755 html/src/CMTextfiles/CMTextfiles.php mode change 100644 => 100755 html/src/CMTranslate/CMTranslate.php mode change 100644 => 100755 html/src/CMUser/CMUser.php mode change 100644 => 100755 html/src/CObject/CObject.php mode change 100644 => 100755 html/src/CPageLoader/CPageLoader.php mode change 100644 => 100755 html/src/CRequest/CRequest.php mode change 100644 => 100755 html/src/CSession/CSession.php mode change 100644 => 100755 html/src/CViewContainer/404.tpl.php mode change 100644 => 100755 html/src/CViewContainer/CViewContainer.php mode change 100644 => 100755 html/src/IController/IController.php mode change 100644 => 100755 html/src/IHasSQL/IHasSQL.php mode change 100644 => 100755 html/src/IModule/IModule.php mode change 100644 => 100755 html/src/ISingleton/ISingleton.php mode change 100644 => 100755 html/src/bootstrap.php mode change 100644 => 100755 html/themes/bb/box.jpg mode change 100644 => 100755 html/themes/bb/default.tpl.php mode change 100644 => 100755 html/themes/bb/index.tpl.php mode change 100644 => 100755 html/themes/bb/jquery_ui.css mode change 100644 => 100755 html/themes/bb/smallbox.jpg mode change 100644 => 100755 html/themes/bb/style.css mode change 100644 => 100755 html/themes/functions.php mode change 100644 => 100755 html/themes/images/aqua_dayDown.gif mode change 100644 => 100755 html/themes/images/aqua_dayNormal.gif mode change 100644 => 100755 html/themes/images/aqua_dayOver.gif mode change 100644 => 100755 html/themes/images/armygreen_dayDown.gif mode change 100644 => 100755 html/themes/images/armygreen_dayNormal.gif mode change 100644 => 100755 html/themes/images/armygreen_dayOver.gif mode change 100644 => 100755 html/themes/images/background-grad.png mode change 100644 => 100755 html/themes/images/bananasplit_dayDown.gif mode change 100644 => 100755 html/themes/images/bananasplit_dayNormal.gif mode change 100644 => 100755 html/themes/images/bananasplit_dayOver.gif mode change 100644 => 100755 html/themes/images/beige_dayDown.gif mode change 100644 => 100755 html/themes/images/beige_dayNormal.gif mode change 100644 => 100755 html/themes/images/beige_dayOver.gif mode change 100644 => 100755 html/themes/images/bg_header.jpg mode change 100644 => 100755 html/themes/images/boxBottomLeftCorner.png mode change 100644 => 100755 html/themes/images/boxBottomRightCorner.png mode change 100644 => 100755 html/themes/images/boxSideWallPx.gif mode change 100644 => 100755 html/themes/images/boxSideWallPx.png mode change 100644 => 100755 html/themes/images/boxTopLeftCorner.png mode change 100644 => 100755 html/themes/images/boxTopPx.gif mode change 100644 => 100755 html/themes/images/boxTopPx.png mode change 100644 => 100755 html/themes/images/boxTopRightCorner.png mode change 100644 => 100755 html/themes/images/bullet1.gif mode change 100644 => 100755 html/themes/images/calendar.png mode change 100644 => 100755 html/themes/images/closeButton_down.gif mode change 100644 => 100755 html/themes/images/closeButton_normal.gif mode change 100644 => 100755 html/themes/images/closeButton_over.gif mode change 100644 => 100755 html/themes/images/deepblue_dayDown.gif mode change 100644 => 100755 html/themes/images/deepblue_dayNormal.gif mode change 100644 => 100755 html/themes/images/deepblue_dayOver.gif mode change 100644 => 100755 html/themes/images/greenish_dayDown.gif mode change 100644 => 100755 html/themes/images/greenish_dayOver.gif mode change 100644 => 100755 html/themes/images/handle.png mode change 100644 => 100755 html/themes/images/header-corners.png mode change 100644 => 100755 html/themes/images/homeIcon.png mode change 100644 => 100755 html/themes/images/lightgreen_dayDown.gif mode change 100644 => 100755 html/themes/images/lightgreen_dayNormal.gif mode change 100644 => 100755 html/themes/images/lightgreen_dayOver.gif mode change 100644 => 100755 html/themes/images/loader.gif mode change 100644 => 100755 html/themes/images/monthBackward_down.gif mode change 100644 => 100755 html/themes/images/monthBackward_normal.gif mode change 100644 => 100755 html/themes/images/monthBackward_over.gif mode change 100644 => 100755 html/themes/images/monthForward_down.gif mode change 100644 => 100755 html/themes/images/monthForward_normal.gif mode change 100644 => 100755 html/themes/images/monthForward_over.gif mode change 100644 => 100755 html/themes/images/ocean_blue_dayDown.gif mode change 100644 => 100755 html/themes/images/ocean_blue_dayNormal.gif mode change 100644 => 100755 html/themes/images/ocean_blue_dayOver.gif mode change 100644 => 100755 html/themes/images/orange_dayDown.gif mode change 100644 => 100755 html/themes/images/orange_dayNormal.gif mode change 100644 => 100755 html/themes/images/orange_dayOver.gif mode change 100644 => 100755 html/themes/images/peppermint_dayDown.gif mode change 100644 => 100755 html/themes/images/peppermint_dayNormal.gif mode change 100644 => 100755 html/themes/images/peppermint_dayOver.gif mode change 100644 => 100755 html/themes/images/pink_dayDown.gif mode change 100644 => 100755 html/themes/images/pink_dayNormal.gif mode change 100644 => 100755 html/themes/images/pink_dayOver.gif mode change 100644 => 100755 html/themes/images/purple_dayDown.gif mode change 100644 => 100755 html/themes/images/purple_dayNormal.gif mode change 100644 => 100755 html/themes/images/purple_dayOver.gif mode change 100644 => 100755 html/themes/images/torqoise_dayDown.gif mode change 100644 => 100755 html/themes/images/torqoise_dayNormal.gif mode change 100644 => 100755 html/themes/images/torqoise_dayOver.gif mode change 100644 => 100755 html/themes/images/ui-bg_diagonals-thick_18_b81900_40x40.png mode change 100644 => 100755 html/themes/images/ui-bg_diagonals-thick_20_666666_40x40.png mode change 100644 => 100755 html/themes/images/ui-bg_flat_10_000000_40x100.png mode change 100644 => 100755 html/themes/images/ui-bg_glass_100_f6f6f6_1x400.png mode change 100644 => 100755 html/themes/images/ui-bg_glass_100_fdf5ce_1x400.png mode change 100644 => 100755 html/themes/images/ui-bg_glass_65_ffffff_1x400.png mode change 100644 => 100755 html/themes/images/ui-bg_gloss-wave_35_f6a828_500x100.png mode change 100644 => 100755 html/themes/images/ui-bg_highlight-soft_100_eeeeee_1x100.png mode change 100644 => 100755 html/themes/images/ui-bg_highlight-soft_75_ffe45c_1x100.png mode change 100644 => 100755 html/themes/images/ui-icons_222222_256x240.png mode change 100644 => 100755 html/themes/images/ui-icons_228ef1_256x240.png mode change 100644 => 100755 html/themes/images/ui-icons_ef8c08_256x240.png mode change 100644 => 100755 html/themes/images/ui-icons_ffd27a_256x240.png mode change 100644 => 100755 html/themes/images/ui-icons_ffffff_256x240.png mode change 100644 => 100755 html/themes/images/yearBackward_down.gif mode change 100644 => 100755 html/themes/images/yearBackward_normal.gif mode change 100644 => 100755 html/themes/images/yearBackward_over.gif mode change 100644 => 100755 html/themes/images/yearForward_down.gif mode change 100644 => 100755 html/themes/images/yearForward_normal.gif mode change 100644 => 100755 html/themes/images/yearForward_over.gif mode change 100644 => 100755 install.sh mode change 100644 => 100755 scripts/000-default-ssl mode change 100644 => 100755 scripts/apache2.conf mode change 100644 => 100755 scripts/cron.txt mode change 100644 => 100755 scripts/dallas.py mode change 100644 => 100755 scripts/default-ssl mode change 100644 => 100755 scripts/default-ssl.conf mode change 100644 => 100755 scripts/getspotprice.py mode change 100644 => 100755 scripts/rc.local mode change 100644 => 100755 scripts/script.sh mode change 100644 => 100755 scripts/script2.sh mode change 100644 => 100755 ssl/text diff --git a/.htaccess b/.htaccess old mode 100644 new mode 100755 diff --git a/LICENSE.txt b/LICENSE.txt old mode 100644 new mode 100755 diff --git a/README.md b/README.md old mode 100644 new mode 100755 diff --git a/html/.htaccess b/html/.htaccess old mode 100644 new mode 100755 diff --git a/html/application/config.php b/html/application/config.php old mode 100644 new mode 100755 diff --git a/html/application/data/.ht.sqlite3 b/html/application/data/.ht.sqlite3 old mode 100644 new mode 100755 diff --git a/html/application/textfile/currentPrices.txt b/html/application/textfile/currentPrices.txt old mode 100644 new mode 100755 diff --git a/html/application/textfile/newPrices.txt b/html/application/textfile/newPrices.txt old mode 100644 new mode 100755 diff --git a/html/application/textfile/room0.txt b/html/application/textfile/room0.txt old mode 100644 new mode 100755 diff --git a/html/application/textfile/room1.txt b/html/application/textfile/room1.txt old mode 100644 new mode 100755 diff --git a/html/application/textfile/room2.txt b/html/application/textfile/room2.txt old mode 100644 new mode 100755 diff --git a/html/application/textfile/room3.txt b/html/application/textfile/room3.txt old mode 100644 new mode 100755 diff --git a/html/application/textfile/room4.txt b/html/application/textfile/room4.txt old mode 100644 new mode 100755 diff --git a/html/application/textfile/room5.txt b/html/application/textfile/room5.txt old mode 100644 new mode 100755 diff --git a/html/application/textfile/room6.txt b/html/application/textfile/room6.txt old mode 100644 new mode 100755 diff --git a/html/application/textfile/room7.txt b/html/application/textfile/room7.txt old mode 100644 new mode 100755 diff --git a/html/application/textfile/spotprice.txt b/html/application/textfile/spotprice.txt old mode 100644 new mode 100755 diff --git a/html/application/textfile/spotprice2.txt b/html/application/textfile/spotprice2.txt old mode 100644 new mode 100755 diff --git a/html/application/textfile/temperature.txt b/html/application/textfile/temperature.txt old mode 100644 new mode 100755 diff --git a/html/index.php b/html/index.php old mode 100644 new mode 100755 diff --git a/html/js/_1.11.4_jquery-ui.js b/html/js/_1.11.4_jquery-ui.js old mode 100644 new mode 100755 diff --git a/html/js/canvasjs.min.js b/html/js/canvasjs.min.js old mode 100644 new mode 100755 diff --git a/html/js/jquery-1.10.2.js b/html/js/jquery-1.10.2.js old mode 100644 new mode 100755 diff --git a/html/js/jquery-1.7.1.min.js b/html/js/jquery-1.7.1.min.js old mode 100644 new mode 100755 diff --git a/html/js/jquery-ui-1.8.17.custom.min.js b/html/js/jquery-ui-1.8.17.custom.min.js old mode 100644 new mode 100755 diff --git a/html/js/jquery.min.js b/html/js/jquery.min.js old mode 100644 new mode 100755 diff --git a/html/js/less.js b/html/js/less.js old mode 100644 new mode 100755 diff --git a/html/js/modernizr/2.6.1_smallest.js b/html/js/modernizr/2.6.1_smallest.js old mode 100644 new mode 100755 diff --git a/html/js/script.js b/html/js/script.js old mode 100644 new mode 100755 diff --git a/html/phpinfo.php b/html/phpinfo.php old mode 100644 new mode 100755 diff --git a/html/src/CBehovsboboxen/403.tpl.php b/html/src/CBehovsboboxen/403.tpl.php old mode 100644 new mode 100755 diff --git a/html/src/CBehovsboboxen/404.tpl.php b/html/src/CBehovsboboxen/404.tpl.php old mode 100644 new mode 100755 diff --git a/html/src/CBehovsboboxen/CBehovsboboxen.php b/html/src/CBehovsboboxen/CBehovsboboxen.php old mode 100644 new mode 100755 diff --git a/html/src/CCAdminControlPanel/CCAdminControlPanel.php b/html/src/CCAdminControlPanel/CCAdminControlPanel.php old mode 100644 new mode 100755 diff --git a/html/src/CCAdminControlPanel/index.tpl.php b/html/src/CCAdminControlPanel/index.tpl.php old mode 100644 new mode 100755 diff --git a/html/src/CCAdminControlPanel/temperatures.tpl.php b/html/src/CCAdminControlPanel/temperatures.tpl.php old mode 100644 new mode 100755 diff --git a/html/src/CCIndex/CCIndex.php b/html/src/CCIndex/CCIndex.php old mode 100644 new mode 100755 diff --git a/html/src/CCPresentation/CCPresentation.php b/html/src/CCPresentation/CCPresentation.php old mode 100644 new mode 100755 diff --git a/html/src/CCPresentation/index.tpl.php b/html/src/CCPresentation/index.tpl.php old mode 100644 new mode 100755 diff --git a/html/src/CCSpotprices/CCSpotprices.php b/html/src/CCSpotprices/CCSpotprices.php old mode 100644 new mode 100755 diff --git a/html/src/CCSpotprices/index.tpl.php b/html/src/CCSpotprices/index.tpl.php old mode 100644 new mode 100755 diff --git a/html/src/CCUser/403.tpl.php b/html/src/CCUser/403.tpl.php old mode 100644 new mode 100755 diff --git a/html/src/CCUser/CCUser.php b/html/src/CCUser/CCUser.php old mode 100644 new mode 100755 diff --git a/html/src/CCUser/login.tpl.php b/html/src/CCUser/login.tpl.php old mode 100644 new mode 100755 diff --git a/html/src/CDatabase/CDatabase.php b/html/src/CDatabase/CDatabase.php old mode 100644 new mode 100755 diff --git a/html/src/CForm/CForm.php b/html/src/CForm/CForm.php old mode 100644 new mode 100755 diff --git a/html/src/CForm/README.md b/html/src/CForm/README.md old mode 100644 new mode 100755 diff --git a/html/src/CFormUser/CFormUser.php b/html/src/CFormUser/CFormUser.php old mode 100644 new mode 100755 diff --git a/html/src/CInterceptionFilter/CInterceptionFilter.php b/html/src/CInterceptionFilter/CInterceptionFilter.php old mode 100644 new mode 100755 diff --git a/html/src/CLog/CLog.php b/html/src/CLog/CLog.php old mode 100644 new mode 100755 diff --git a/html/src/CMTemperatures/CMTemperatures.php b/html/src/CMTemperatures/CMTemperatures.php old mode 100644 new mode 100755 diff --git a/html/src/CMTextfiles/CMTextfiles.php b/html/src/CMTextfiles/CMTextfiles.php old mode 100644 new mode 100755 diff --git a/html/src/CMTranslate/CMTranslate.php b/html/src/CMTranslate/CMTranslate.php old mode 100644 new mode 100755 diff --git a/html/src/CMUser/CMUser.php b/html/src/CMUser/CMUser.php old mode 100644 new mode 100755 diff --git a/html/src/CObject/CObject.php b/html/src/CObject/CObject.php old mode 100644 new mode 100755 diff --git a/html/src/CPageLoader/CPageLoader.php b/html/src/CPageLoader/CPageLoader.php old mode 100644 new mode 100755 diff --git a/html/src/CRequest/CRequest.php b/html/src/CRequest/CRequest.php old mode 100644 new mode 100755 diff --git a/html/src/CSession/CSession.php b/html/src/CSession/CSession.php old mode 100644 new mode 100755 diff --git a/html/src/CViewContainer/404.tpl.php b/html/src/CViewContainer/404.tpl.php old mode 100644 new mode 100755 diff --git a/html/src/CViewContainer/CViewContainer.php b/html/src/CViewContainer/CViewContainer.php old mode 100644 new mode 100755 diff --git a/html/src/IController/IController.php b/html/src/IController/IController.php old mode 100644 new mode 100755 diff --git a/html/src/IHasSQL/IHasSQL.php b/html/src/IHasSQL/IHasSQL.php old mode 100644 new mode 100755 diff --git a/html/src/IModule/IModule.php b/html/src/IModule/IModule.php old mode 100644 new mode 100755 diff --git a/html/src/ISingleton/ISingleton.php b/html/src/ISingleton/ISingleton.php old mode 100644 new mode 100755 diff --git a/html/src/bootstrap.php b/html/src/bootstrap.php old mode 100644 new mode 100755 diff --git a/html/themes/bb/box.jpg b/html/themes/bb/box.jpg old mode 100644 new mode 100755 diff --git a/html/themes/bb/default.tpl.php b/html/themes/bb/default.tpl.php old mode 100644 new mode 100755 diff --git a/html/themes/bb/index.tpl.php b/html/themes/bb/index.tpl.php old mode 100644 new mode 100755 diff --git a/html/themes/bb/jquery_ui.css b/html/themes/bb/jquery_ui.css old mode 100644 new mode 100755 diff --git a/html/themes/bb/smallbox.jpg b/html/themes/bb/smallbox.jpg old mode 100644 new mode 100755 diff --git a/html/themes/bb/style.css b/html/themes/bb/style.css old mode 100644 new mode 100755 diff --git a/html/themes/functions.php b/html/themes/functions.php old mode 100644 new mode 100755 diff --git a/html/themes/images/aqua_dayDown.gif b/html/themes/images/aqua_dayDown.gif old mode 100644 new mode 100755 diff --git a/html/themes/images/aqua_dayNormal.gif b/html/themes/images/aqua_dayNormal.gif old mode 100644 new mode 100755 diff --git a/html/themes/images/aqua_dayOver.gif b/html/themes/images/aqua_dayOver.gif old mode 100644 new mode 100755 diff --git a/html/themes/images/armygreen_dayDown.gif b/html/themes/images/armygreen_dayDown.gif old mode 100644 new mode 100755 diff --git a/html/themes/images/armygreen_dayNormal.gif b/html/themes/images/armygreen_dayNormal.gif old mode 100644 new mode 100755 diff --git a/html/themes/images/armygreen_dayOver.gif b/html/themes/images/armygreen_dayOver.gif old mode 100644 new mode 100755 diff --git a/html/themes/images/background-grad.png b/html/themes/images/background-grad.png old mode 100644 new mode 100755 diff --git a/html/themes/images/bananasplit_dayDown.gif b/html/themes/images/bananasplit_dayDown.gif old mode 100644 new mode 100755 diff --git a/html/themes/images/bananasplit_dayNormal.gif b/html/themes/images/bananasplit_dayNormal.gif old mode 100644 new mode 100755 diff --git a/html/themes/images/bananasplit_dayOver.gif b/html/themes/images/bananasplit_dayOver.gif old mode 100644 new mode 100755 diff --git a/html/themes/images/beige_dayDown.gif b/html/themes/images/beige_dayDown.gif old mode 100644 new mode 100755 diff --git a/html/themes/images/beige_dayNormal.gif b/html/themes/images/beige_dayNormal.gif old mode 100644 new mode 100755 diff --git a/html/themes/images/beige_dayOver.gif b/html/themes/images/beige_dayOver.gif old mode 100644 new mode 100755 diff --git a/html/themes/images/bg_header.jpg b/html/themes/images/bg_header.jpg old mode 100644 new mode 100755 diff --git a/html/themes/images/boxBottomLeftCorner.png b/html/themes/images/boxBottomLeftCorner.png old mode 100644 new mode 100755 diff --git a/html/themes/images/boxBottomRightCorner.png b/html/themes/images/boxBottomRightCorner.png old mode 100644 new mode 100755 diff --git a/html/themes/images/boxSideWallPx.gif b/html/themes/images/boxSideWallPx.gif old mode 100644 new mode 100755 diff --git a/html/themes/images/boxSideWallPx.png b/html/themes/images/boxSideWallPx.png old mode 100644 new mode 100755 diff --git a/html/themes/images/boxTopLeftCorner.png b/html/themes/images/boxTopLeftCorner.png old mode 100644 new mode 100755 diff --git a/html/themes/images/boxTopPx.gif b/html/themes/images/boxTopPx.gif old mode 100644 new mode 100755 diff --git a/html/themes/images/boxTopPx.png b/html/themes/images/boxTopPx.png old mode 100644 new mode 100755 diff --git a/html/themes/images/boxTopRightCorner.png b/html/themes/images/boxTopRightCorner.png old mode 100644 new mode 100755 diff --git a/html/themes/images/bullet1.gif b/html/themes/images/bullet1.gif old mode 100644 new mode 100755 diff --git a/html/themes/images/calendar.png b/html/themes/images/calendar.png old mode 100644 new mode 100755 diff --git a/html/themes/images/closeButton_down.gif b/html/themes/images/closeButton_down.gif old mode 100644 new mode 100755 diff --git a/html/themes/images/closeButton_normal.gif b/html/themes/images/closeButton_normal.gif old mode 100644 new mode 100755 diff --git a/html/themes/images/closeButton_over.gif b/html/themes/images/closeButton_over.gif old mode 100644 new mode 100755 diff --git a/html/themes/images/deepblue_dayDown.gif b/html/themes/images/deepblue_dayDown.gif old mode 100644 new mode 100755 diff --git a/html/themes/images/deepblue_dayNormal.gif b/html/themes/images/deepblue_dayNormal.gif old mode 100644 new mode 100755 diff --git a/html/themes/images/deepblue_dayOver.gif b/html/themes/images/deepblue_dayOver.gif old mode 100644 new mode 100755 diff --git a/html/themes/images/greenish_dayDown.gif b/html/themes/images/greenish_dayDown.gif old mode 100644 new mode 100755 diff --git a/html/themes/images/greenish_dayOver.gif b/html/themes/images/greenish_dayOver.gif old mode 100644 new mode 100755 diff --git a/html/themes/images/handle.png b/html/themes/images/handle.png old mode 100644 new mode 100755 diff --git a/html/themes/images/header-corners.png b/html/themes/images/header-corners.png old mode 100644 new mode 100755 diff --git a/html/themes/images/homeIcon.png b/html/themes/images/homeIcon.png old mode 100644 new mode 100755 diff --git a/html/themes/images/lightgreen_dayDown.gif b/html/themes/images/lightgreen_dayDown.gif old mode 100644 new mode 100755 diff --git a/html/themes/images/lightgreen_dayNormal.gif b/html/themes/images/lightgreen_dayNormal.gif old mode 100644 new mode 100755 diff --git a/html/themes/images/lightgreen_dayOver.gif b/html/themes/images/lightgreen_dayOver.gif old mode 100644 new mode 100755 diff --git a/html/themes/images/loader.gif b/html/themes/images/loader.gif old mode 100644 new mode 100755 diff --git a/html/themes/images/monthBackward_down.gif b/html/themes/images/monthBackward_down.gif old mode 100644 new mode 100755 diff --git a/html/themes/images/monthBackward_normal.gif b/html/themes/images/monthBackward_normal.gif old mode 100644 new mode 100755 diff --git a/html/themes/images/monthBackward_over.gif b/html/themes/images/monthBackward_over.gif old mode 100644 new mode 100755 diff --git a/html/themes/images/monthForward_down.gif b/html/themes/images/monthForward_down.gif old mode 100644 new mode 100755 diff --git a/html/themes/images/monthForward_normal.gif b/html/themes/images/monthForward_normal.gif old mode 100644 new mode 100755 diff --git a/html/themes/images/monthForward_over.gif b/html/themes/images/monthForward_over.gif old mode 100644 new mode 100755 diff --git a/html/themes/images/ocean_blue_dayDown.gif b/html/themes/images/ocean_blue_dayDown.gif old mode 100644 new mode 100755 diff --git a/html/themes/images/ocean_blue_dayNormal.gif b/html/themes/images/ocean_blue_dayNormal.gif old mode 100644 new mode 100755 diff --git a/html/themes/images/ocean_blue_dayOver.gif b/html/themes/images/ocean_blue_dayOver.gif old mode 100644 new mode 100755 diff --git a/html/themes/images/orange_dayDown.gif b/html/themes/images/orange_dayDown.gif old mode 100644 new mode 100755 diff --git a/html/themes/images/orange_dayNormal.gif b/html/themes/images/orange_dayNormal.gif old mode 100644 new mode 100755 diff --git a/html/themes/images/orange_dayOver.gif b/html/themes/images/orange_dayOver.gif old mode 100644 new mode 100755 diff --git a/html/themes/images/peppermint_dayDown.gif b/html/themes/images/peppermint_dayDown.gif old mode 100644 new mode 100755 diff --git a/html/themes/images/peppermint_dayNormal.gif b/html/themes/images/peppermint_dayNormal.gif old mode 100644 new mode 100755 diff --git a/html/themes/images/peppermint_dayOver.gif b/html/themes/images/peppermint_dayOver.gif old mode 100644 new mode 100755 diff --git a/html/themes/images/pink_dayDown.gif b/html/themes/images/pink_dayDown.gif old mode 100644 new mode 100755 diff --git a/html/themes/images/pink_dayNormal.gif b/html/themes/images/pink_dayNormal.gif old mode 100644 new mode 100755 diff --git a/html/themes/images/pink_dayOver.gif b/html/themes/images/pink_dayOver.gif old mode 100644 new mode 100755 diff --git a/html/themes/images/purple_dayDown.gif b/html/themes/images/purple_dayDown.gif old mode 100644 new mode 100755 diff --git a/html/themes/images/purple_dayNormal.gif b/html/themes/images/purple_dayNormal.gif old mode 100644 new mode 100755 diff --git a/html/themes/images/purple_dayOver.gif b/html/themes/images/purple_dayOver.gif old mode 100644 new mode 100755 diff --git a/html/themes/images/torqoise_dayDown.gif b/html/themes/images/torqoise_dayDown.gif old mode 100644 new mode 100755 diff --git a/html/themes/images/torqoise_dayNormal.gif b/html/themes/images/torqoise_dayNormal.gif old mode 100644 new mode 100755 diff --git a/html/themes/images/torqoise_dayOver.gif b/html/themes/images/torqoise_dayOver.gif old mode 100644 new mode 100755 diff --git a/html/themes/images/ui-bg_diagonals-thick_18_b81900_40x40.png b/html/themes/images/ui-bg_diagonals-thick_18_b81900_40x40.png old mode 100644 new mode 100755 diff --git a/html/themes/images/ui-bg_diagonals-thick_20_666666_40x40.png b/html/themes/images/ui-bg_diagonals-thick_20_666666_40x40.png old mode 100644 new mode 100755 diff --git a/html/themes/images/ui-bg_flat_10_000000_40x100.png b/html/themes/images/ui-bg_flat_10_000000_40x100.png old mode 100644 new mode 100755 diff --git a/html/themes/images/ui-bg_glass_100_f6f6f6_1x400.png b/html/themes/images/ui-bg_glass_100_f6f6f6_1x400.png old mode 100644 new mode 100755 diff --git a/html/themes/images/ui-bg_glass_100_fdf5ce_1x400.png b/html/themes/images/ui-bg_glass_100_fdf5ce_1x400.png old mode 100644 new mode 100755 diff --git a/html/themes/images/ui-bg_glass_65_ffffff_1x400.png b/html/themes/images/ui-bg_glass_65_ffffff_1x400.png old mode 100644 new mode 100755 diff --git a/html/themes/images/ui-bg_gloss-wave_35_f6a828_500x100.png b/html/themes/images/ui-bg_gloss-wave_35_f6a828_500x100.png old mode 100644 new mode 100755 diff --git a/html/themes/images/ui-bg_highlight-soft_100_eeeeee_1x100.png b/html/themes/images/ui-bg_highlight-soft_100_eeeeee_1x100.png old mode 100644 new mode 100755 diff --git a/html/themes/images/ui-bg_highlight-soft_75_ffe45c_1x100.png b/html/themes/images/ui-bg_highlight-soft_75_ffe45c_1x100.png old mode 100644 new mode 100755 diff --git a/html/themes/images/ui-icons_222222_256x240.png b/html/themes/images/ui-icons_222222_256x240.png old mode 100644 new mode 100755 diff --git a/html/themes/images/ui-icons_228ef1_256x240.png b/html/themes/images/ui-icons_228ef1_256x240.png old mode 100644 new mode 100755 diff --git a/html/themes/images/ui-icons_ef8c08_256x240.png b/html/themes/images/ui-icons_ef8c08_256x240.png old mode 100644 new mode 100755 diff --git a/html/themes/images/ui-icons_ffd27a_256x240.png b/html/themes/images/ui-icons_ffd27a_256x240.png old mode 100644 new mode 100755 diff --git a/html/themes/images/ui-icons_ffffff_256x240.png b/html/themes/images/ui-icons_ffffff_256x240.png old mode 100644 new mode 100755 diff --git a/html/themes/images/yearBackward_down.gif b/html/themes/images/yearBackward_down.gif old mode 100644 new mode 100755 diff --git a/html/themes/images/yearBackward_normal.gif b/html/themes/images/yearBackward_normal.gif old mode 100644 new mode 100755 diff --git a/html/themes/images/yearBackward_over.gif b/html/themes/images/yearBackward_over.gif old mode 100644 new mode 100755 diff --git a/html/themes/images/yearForward_down.gif b/html/themes/images/yearForward_down.gif old mode 100644 new mode 100755 diff --git a/html/themes/images/yearForward_normal.gif b/html/themes/images/yearForward_normal.gif old mode 100644 new mode 100755 diff --git a/html/themes/images/yearForward_over.gif b/html/themes/images/yearForward_over.gif old mode 100644 new mode 100755 diff --git a/install.sh b/install.sh old mode 100644 new mode 100755 index 6b039aa..de3d0e2 --- a/install.sh +++ b/install.sh @@ -1,128 +1,194 @@ -#!/bin/sh -#2016-01-28 18.00 +#! /bin/sh +# +# +# +# install.sh +# +# Description: Installs BehovsBoBoxen +# +# Usage: install.sh {web|all} {x} +# +# web - update the web server part +# all - installs the complete system including update/upgrade of system, install of additional packages etc. +# x - If a second argument is specified, Domoticz support is installed, i.e. bbb_domoticz.py will be the +# control process. +# + +if [ -z "$2" ] +then + + DOMOTICZ=1 + echo "No Domoticz support" +else + DOMITICZ=0 + echo "Domoticz support" +fi + + +# Set true (0) if support for Domoticz control is desired +# Will use bbb_add/bbb_domoticz.py as control system and install startup script +# rc.local will not modified +# +# + + + +# +# Function updates the webb application +# +do_web() +{ + echo "Update BehovsBoBoxen webb application" + sudo chmod 755 /var/www -R +# full file permissions + + sudo cp -R /home/pi/BehovsBoBoxen/html /var/www +# copies the files for the web-interface + sudo chmod 755 /var/www/html -R +# restore file permissions + + sudo chmod 777 /var/www/html/application/textfile -R + sudo chmod 777 /var/www/html/application/data -R + sudo chmod 777 /var/www/html/application/data/.ht.sqlite3 + sudo chmod 777 /var/www/html/src/CCSpotprices/CCSpotprices.php +# full file permissions + + sudo rm -f /var/www/html/index.html +# remove above file + + RETVAL="$?" + return "$RETVAL" +} + +# +# Function that installs the whole BehovsBoBoxen +# +do_all() +{ + echo "Install BehovsBoBoxen" + sudo apt-get update -y +# gets Raspian updates + + sudo apt-get upgrade -y +# installs Raspian updates + + sudo apt-get install vsftpd -y +# installs ftp programme + + sudo apt-get install apache2 php5 libapache2-mod-php5 -y +# installs webserver and php library + + sudo apt-get install sqlite3 +# installs sqlite3 + + sudo apt-get install php5-sqlite +# installs php-sqlite + + sudo a2enmod rewrite +# activates mod_rewrite + + sudo service apache2 restart +# restarts apache2 + + sudo rm -f /var/www/html -R + + sudo chmod 777 /home/pi/BehovsBoBoxen -R +# full file permissions for the the BehovsBoBoxen-repository from github + + if [$DOMOTICZ] + then + echo "Install Domoticz support" + sudo cp /home/pi/BehovsBoBoxen/bbb_addon/bbb_domoticz.sh /etc/init.d + sudo chmod 755 /etc/init.d/bbb_domoticz.sh + sudo update-rc.d bbb_domoticz.sh defaults + + else + sudo cp /home/pi/BehovsBoBoxen/scripts/rc.local /etc/rc.local + sudo chmod 755 /etc/rc.local +# copies and change path for the file that starts the box at reboot + fi + + do_web() -sudo apt-get update -y -#gets Raspian updates + sudo crontab -l -u root | cat /home/pi/BehovsBoBoxen/scripts/cron.txt | sudo c +# we get the new spotpricefile after 16:00 and recalculate the temperatures afte -sudo apt-get upgrade -y -#installs Raspian updates -sudo apt-get install vsftpd -y -#installs ftp programme + cat /boot/config.txt |grep "dtoverlay=w1-gpio,gpiopin=4" || sudo tee -a /boot/ +# append "dtoverlay=..." to /boot/config.txt unless it's already there +# -sudo apt-get install apache2 php5 libapache2-mod-php5 -y -#installs webserver and php library + sudo a2enmod ssl + sudo service apache2 restart +# enable mod_ssl -sudo apt-get install sqlite3 -#installs sqlite3 + sudo chmod 777 /etc/apache2 -R -sudo apt-get install php5-sqlite -#installs php-sqlite + sudo rm -f /etc/apache2/apache2.conf + sudo cp /home/pi/BehovsBoBoxen/scripts/apache2.conf /etc/apache2/apache2.conf +# AllowOverride All -sudo a2enmod rewrite -#activates mod_rewrite +# sudo mkdir /etc/apache2/ssl + sudo cp -rp /home/pi/BehovsBoBoxen/ssl /etc/apache2 + sudo chmod 777 /etc/apache2/ssl -R +# adds ssl repository, to hold key and cerificate -sudo service apache2 restart -#restarts apache2 + sudo openssl req -x509 -nodes -days 1095 -newkey rsa:2048 -out /etc/apache2/ssl -sudo chmod 777 /home/pi/BehovsBoBoxen/bbb -R - -mkdir /home/pi/bbb -sudo chmod 777 /home/pi/bbb -R -sudo cp /home/pi/BehovsBoBoxen/bbb -R /home/pi -sudo rm -f /home/pi/BehovsBoBoxen/html -R -sudo rm -f /home/pi/BehovsBoBoxen/ssl -R -sudo rm -f /home/pi/BehovsBoBoxen/scripts -R -sudo rm -f /home/pi/BehovsBoBoxen/LICENSE.txt -sudo rm -f /home/pi/BehovsBoBoxen/README.md -sudo rm -f /home/pi/BehovsBoBoxen/.htaccess -sudo cp /home/pi/bbb/html -R /home/pi/BehovsBoBoxen -sudo cp /home/pi/bbb/ssl -R /home/pi/BehovsBoBoxen -sudo cp /home/pi/bbb/scripts -R /home/pi/BehovsBoBoxen -sudo cp /home/pi/bbb/LICENSE.txt /home/pi/BehovsBoBoxen -sudo cp /home/pi/bbb/README.md /home/pi/BehovsBoBoxen -sudo cp /home/pi/bbb/.htaccess /home/pi/BehovsBoBoxen -sudo rm -f /home/pi/bbb/ -R -sudo rm -f /var/www/html -R -sudo rm /home/pi/BehovsBoBoxen/bbb -R -sudo chmod 777 /etc/rc.local -sudo rm -f /etc/rc.local - -sudo chmod 777 /home/pi/BehovsBoBoxen -R -#full file permissions for the the BehovsBoBoxen-repository from github - -sudo cp /home/pi/BehovsBoBoxen/scripts/rc.local /etc/rc.local -#copies and change path for the file that starts the box at reboot -sudo chmod 755 /etc/rc.local - -sudo chmod 777 /var/www -R -#full file permissions - -sudo cp -R /home/pi/BehovsBoBoxen/html /var/www -#copies the files for the web-interface -sudo chmod 755 /var/www/html -R -#restore file permissions - -sudo chmod 777 /var/www/html/application/textfile -R -sudo chmod 777 /var/www/html/application/data -R -sudo chmod 777 /var/www/html/application/data/.ht.sqlite3 -sudo chmod 777 /var/www/html/src/CCSpotprices/CCSpotprices.php -#full file permissions - -sudo crontab -l -u root | cat /home/pi/BehovsBoBoxen/scripts/cron.txt | sudo crontab -u root - -#we get the new spotpricefile after 16:00 and recalculate the temperatures after 00:00 - -echo "dtoverlay=w1-gpio,gpiopin=4" | sudo tee -a /boot/config.txt +# req request +#-nodes if a private key is created it will not be encrypted +#-newkey creates a new certificate request and a new private key +#rsa:2048 generates an RSA key 2048 bits in size +#-keyout the filename to write the newly created private key to +#-out specifies the output filename +#-subj sets certificate subject +#x509 certificate display and signing utility +#-subj arg Replaces subject field of input request with specified data and -sudo rm -f /var/www/html/index.html -#remove above file + sudo rm -f /etc/apache2/sites-available/default-ssl.conf -sudo a2enmod ssl -sudo service apache2 restart -#enable mod_ssl + sudo cp -rp /home/pi/BehovsBoBoxen/scripts/default-ssl /etc/apache2/sites-avail + sudo cp -rp /home/pi/BehovsBoBoxen/scripts/000-default-ssl /etc/apache2/sites-e +# symlink text, -p keeps file permissions from host to receiver -sudo chmod 777 /etc/apache2 -R + sudo cp -rp /home/pi/BehovsBoBoxen/scripts/default-ssl.conf /etc/apache2/sites- + sudo cp -rp /home/pi/BehovsBoBoxen/scripts/default-ssl.conf /etc/apache2/sites- +# 443 -sudo rm -f /etc/apache2/apache2.conf -sudo cp /home/pi/BehovsBoBoxen/scripts/apache2.conf /etc/apache2/apache2.conf -#AllowOverride All + sudo chmod 755 /etc/apache2 + sudo chmod 755 /etc/apache2/ssl + sudo chmod 755 /home/pi/BehovsBoBoxen +# restores file permissions -#sudo mkdir /etc/apache2/ssl -sudo cp -rp /home/pi/BehovsBoBoxen/ssl /etc/apache2 -sudo chmod 777 /etc/apache2/ssl -R -#adds ssl repository, to hold key and cerificate -sudo openssl req -x509 -nodes -days 1095 -newkey rsa:2048 -out /etc/apache2/ssl/behovsboboxen.crt -keyout /etc/apache2/ssl/behovsboboxen.key -subj "/C=SE/ST=Sverige/L=Molndal/O=/OU=/CN=behovsboboxen" + sudo /etc/init.d/apache2 restart +# restarts apache2 -# req request -#-nodes if a private key is created it will not be encrypted -#-newkey creates a new certificate request and a new private key -#rsa:2048 generates an RSA key 2048 bits in size -#-keyout the filename to write the newly created private key to -#-out specifies the output filename -#-subj sets certificate subject -#x509 certificate display and signing utility -#-subj arg Replaces subject field of input request with specified data and outputs modified request. The arg must be formatted as /type0=value0/type1=value1/type2=..., characters may be escaped by \ (backslash), no spaces are skipped. -sudo rm -f /etc/apache2/sites-available/default-ssl.conf + echo "installation ok, the system will restart" + sudo reboot -sudo cp -rp /home/pi/BehovsBoBoxen/scripts/default-ssl /etc/apache2/sites-available/default-ssl -sudo cp -rp /home/pi/BehovsBoBoxen/scripts/000-default-ssl /etc/apache2/sites-enabled/000-default-ssl -#symlink text, -p keeps file permissions from host to receiver -sudo cp -rp /home/pi/BehovsBoBoxen/scripts/default-ssl.conf /etc/apache2/sites-available/default-ssl.conf -sudo cp -rp /home/pi/BehovsBoBoxen/scripts/default-ssl.conf /etc/apache2/sites-enabled/default-ssl.conf -#443 + -sudo chmod 755 /etc/apache2 -sudo chmod 755 /etc/apache2/ssl -sudo chmod 755 /home/pi/BehovsBoBoxen -#restores file permissions + RETVAL="$?" + return "$RETVAL" +} -sudo /etc/init.d/apache2 restart -#restarts apache2 +case "$1" in + web) + do_web + ;; + all) + do_all + ;; + -echo "installation ok, the system will restart" | sudo tee -a /boot/config.txt + *) + echo "Usage: $SCRIPTNAME {web|all}" + exit 3 + ;; +esac -sudo reboot \ No newline at end of file +: diff --git a/scripts/000-default-ssl b/scripts/000-default-ssl old mode 100644 new mode 100755 diff --git a/scripts/apache2.conf b/scripts/apache2.conf old mode 100644 new mode 100755 diff --git a/scripts/cron.txt b/scripts/cron.txt old mode 100644 new mode 100755 diff --git a/scripts/dallas.py b/scripts/dallas.py old mode 100644 new mode 100755 diff --git a/scripts/default-ssl b/scripts/default-ssl old mode 100644 new mode 100755 diff --git a/scripts/default-ssl.conf b/scripts/default-ssl.conf old mode 100644 new mode 100755 diff --git a/scripts/getspotprice.py b/scripts/getspotprice.py old mode 100644 new mode 100755 diff --git a/scripts/rc.local b/scripts/rc.local old mode 100644 new mode 100755 diff --git a/scripts/script.sh b/scripts/script.sh old mode 100644 new mode 100755 diff --git a/scripts/script2.sh b/scripts/script2.sh old mode 100644 new mode 100755 diff --git a/ssl/text b/ssl/text old mode 100644 new mode 100755 From 5068ab96aa8c23f590668aea03560c8d614aec15 Mon Sep 17 00:00:00 2001 From: Ulf Bengtner Date: Sat, 23 Apr 2016 14:56:41 +0200 Subject: [PATCH 05/11] .htaccess updated with redirect to https --- bbb_addon | 2 +- html/.htaccess | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/bbb_addon b/bbb_addon index a8b7843..3f3254c 160000 --- a/bbb_addon +++ b/bbb_addon @@ -1 +1 @@ -Subproject commit a8b7843f58686df059d1469523593db0badf9fb6 +Subproject commit 3f3254c51ce747d33c1c5b02b0222e8674f3aaf4 diff --git a/html/.htaccess b/html/.htaccess index bae9364..10a054b 100755 --- a/html/.htaccess +++ b/html/.htaccess @@ -1,5 +1,20 @@ RewriteEngine on + +# This will enable the Rewrite capabilities + + RewriteCond %{HTTPS} !=on +# This checks to make sure the connection is not already HTTPS + + RewriteRule ^/?(.*) https://%{SERVER_NAME}/$1 [R,L] +# This rule will redirect users from their original location, to the same location but using HTTPS. +# i.e. http://www.example.com/foo/ to https://www.example.com/foo/ +# The leading slash is made optional so that this will work either in httpd.conf +# or .htaccess context + + + + # if the request is not a file/directory, redirect to index.php RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d From 81cfbbc4c7bbb76ae0fe8869ce719617638822e9 Mon Sep 17 00:00:00 2001 From: Ulf Bengtner Date: Mon, 25 Apr 2016 22:09:08 +0200 Subject: [PATCH 06/11] Moved files to BehovsBoBoxen/scripts and bbb_addon removed --- scripts/bbb_domoticz.py | 396 ++++++++++++++++++++++++++++++++++ scripts/bbb_domoticz.sh | 156 ++++++++++++++ scripts/bbb_domoticz_local.sh | 136 ++++++++++++ scripts/check_processes.sh | 48 +++++ scripts/checkp | 1 + scripts/reboot | 1 + 6 files changed, 738 insertions(+) create mode 100755 scripts/bbb_domoticz.py create mode 100755 scripts/bbb_domoticz.sh create mode 100755 scripts/bbb_domoticz_local.sh create mode 100644 scripts/check_processes.sh create mode 100644 scripts/checkp create mode 100644 scripts/reboot diff --git a/scripts/bbb_domoticz.py b/scripts/bbb_domoticz.py new file mode 100755 index 0000000..3713c61 --- /dev/null +++ b/scripts/bbb_domoticz.py @@ -0,0 +1,396 @@ +#!/usr/bin/python +#-*- coding: utf-8 -*- +#2016-03-14:21:51 +# +# Modified by Ulf Bengtner, 2015-06-14, to read all sensors from Domoticz. +# +# All sensors are mapped by Domoticz sensor id, IDX. The actual sensors used +# are read from a configuration file /home/pi/domoticz_sensors. They should be +# listed in the same order as the room names are specified in Behovsbobox +# +# +import urllib2,json,sys +#import urllib2,json + +import datetime; +import time; +import sqlite3 +import datetime +import logging, logging.handlers, argparse +import subprocess +import RPi.GPIO as GPIO + +#GPIO general purpose input output +GPIO.setmode(GPIO.BOARD) # Board numbering mode, i.e. number refers to pin +GPIO.setwarnings(False) +#GPIO.setup(11,GPIO.OUT) +#GPIO.setup(13,GPIO.OUT) +#GPIO.setup(15,GPIO.OUT) +#GPIO.setup(29,GPIO.OUT) +#GPIO.setup(31,GPIO.OUT) +#GPIO.setup(33,GPIO.OUT) +#GPIO.setup(35,GPIO.OUT) +#GPIO.setup(37,GPIO.OUT) +#GPIO.setup(12,GPIO.OUT) +#GPIO.setup(16,GPIO.OUT) +#GPIO.setup(18,GPIO.OUT) +#GPIO.setup(22,GPIO.OUT) +#GPIO.setup(32,GPIO.OUT) +#GPIO.setup(36,GPIO.OUT) +#GPIO.setup(38,GPIO.OUT) +#GPIO.setup(40,GPIO.OUT) +# +# original pin-out Öland +# +GPIO.setup(26,GPIO.OUT) +GPIO.setup(24,GPIO.OUT) +GPIO.setup(21,GPIO.OUT) +GPIO.setup(19,GPIO.OUT) +GPIO.setup(23,GPIO.OUT) +GPIO.setup(11,GPIO.OUT) +GPIO.setup(12,GPIO.OUT) +GPIO.setup(15,GPIO.OUT) + + +WAIT=300 # Delay (s) between each cycle in control loop + +DOMOTICZ_IN=1 # Set this variable to 1 to read temperatures from Domoticz, otherwise 0 +DOMOTICZ_OUT=0 # Set this variable to 1 to control valves from Domoticz, otherwise 0 + +DOMOTICZ_URL="bobox.dyndns.org:8085" # URL to Domoticz server - use 127.0.0.1 for local +USERNAME = 'ubee' # update username and password to what is defined in Domoticz +PASSWORD = 'xyz' + +LOGFILE = '/home/pi/bbb_addon/bbb_domoticz.log' + +def tracefunc(frame, event, arg, indent=[0]): + calltrace="" + if event == "call": + indent[0] += 2 + logger.debug("-" * indent[0] + "> call function +%s",frame.f_code.co_name) + elif event == "return": + logger.debug("-" * indent[0] + "exit function +%s",frame.f_code.co_name) + indent[0] -= 2 + return tracefunc + + + +# +# The control loop reads those sensors (slaves). The control loop stop +# when id is 0 +# +# If Domoticz is used for control, the Domoticz idx is read from Domoticz. Otherwise configure with 1w id:s +# +# +# sensors[0] - first room +# sensors[1] - second room +# ... +# +sensors = [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0] + +# +#sensors = ["28-00000662b340","28-000006636be0","28-00000663000e","28-00000558923e","28-000006636545","28-0000066355d5","28-00000663137f",0,0,0,0,0,0,0,0,0] +# +# +# array of rooms holding the setpoint values we want +# +setpoints = [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15] +# +# +# the temperature value we read in each room +# +actualTemp = [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15] +# +# +# The GPIO pin used to control the valve for each room +# With Domoticz control, the value is configured and read from Domoticz. The number corresponds to the IDX of the associated +# switch controlling a defined pin +# + +pins = [26,24,21,19,23,11,12,15,0,0,0,0,0,0,0,0] + +# +# define logging handler +# +parser = argparse.ArgumentParser( description='BehovsBoBoxen Control daemon' ) +parser.add_argument("-v", "--verbose", help="Logging verbose", action="store_true") + +args = parser.parse_args() +if args.verbose: + logging.basicConfig(level=logging.DEBUG) +else: + logging.basicConfig(level=logging.INFO) + + +logger = logging.getLogger(__name__) + +# create a file handler + +handler = logging.handlers.RotatingFileHandler(LOGFILE,maxBytes=200000,backupCount=10) +# +# set level +# +handler.setLevel(logging.DEBUG) # Do not change this! + +# create a logging format + +formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s') +handler.setFormatter(formatter) + +# add the handlers to the logger + +logger.addHandler(handler) + +logger.info("BehovsBoBoxen control system: bbb_domoticz.py starting up") + +# +# Uncomment this line for extensive tracing +# +# sys.settrace(tracefunc) + +if DOMOTICZ_IN or DOMOTICZ_OUT: +# +# build authenticate string to access Domoticz server +# + + p = urllib2.HTTPPasswordMgrWithDefaultRealm() + p.add_password(None, DOMOTICZ_URL, USERNAME, PASSWORD) + + handler = urllib2.HTTPBasicAuthHandler(p) + opener = urllib2.build_opener(handler) + urllib2.install_opener(opener) + + + + + if DOMOTICZ_IN: +# +# Find all temperature sensors in Domoticz and populate sensors array +# + url= "http://"+DOMOTICZ_URL+"/json.htm?type=devices&filter=temp&used=true&order=Name" + logger.debug('Reading from %s',url) + try: + response=urllib2.urlopen(url) + data=json.loads(response.read()) + logger.debug('Response is %s',json.dumps(data, indent=4, sort_keys=True)) + for i in range(len(data["result"])): + a=data["result"][i]["Description"] + ini=a.find('%room') + if ini != -1: + ini=ini+6 + rIndex=int(a[ini:]) + logger.info('Configure room id %s with Domoticz sensor idx: %s', rIndex, data["result"][i]["idx"]) + sensors[rIndex]=data["result"][i]["idx"] + except URLError: + logger.warning('Cannot connect to Domoticz server %s', url) + +# +# end if DOMOTICZ_IN +# + +if DOMOTICZ_OUT: +# +# Find all swítches that control valves in Domoticz and populate output array +# + + url= "http://"+DOMOTICZ_URL+"/json.htm?type=devices&filter=light&used=true&order=Name" + logger.debug('Reading from %s',url) + response=urllib2.urlopen(url) +# response=urllib.urlopen(url) + data=json.loads(response.read()) + logger.debug('Response is %s',json.dumps(data, indent=4, sort_keys=True)) + + for i in range(len(data["result"])): + a=data["result"][i]["Description"] + ini=a.find('%room') + if ini != -1: + ini=ini+6 + rIndex=int(a[ini:]) + logger.info('Configure room id %s with Domoticz switch IDX %s',str(rIndex), data["result"][i]["idx"]) + + pins[rIndex]=data["result"][i]["idx"] +# +# end if DOMOTICZ_OUT +# +logger.info('======================================================================') + + +################################################################################# +# +# actualTemps() +# +# reads the temperatures in each room and returns array +# +# depending on the variable domoticz the temperatures are read through Domoticz +# or directly from 1-wire sensors. +# +################################################################################## + +def actualTemps(currentTemp,sensors): + + basePath="/sys/bus/w1/devices/" + tailPath="/w1_slave" + newTemp=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15] + readOK=True + + i = 0 + while i < 16 and sensors[i] != 0: + + if DOMOTICZ_IN: +# +# Read devices in Domoticz +# + try: + url= "http://"+DOMOTICZ_URL+"/json.htm?type=devices&rid=" + str(sensors[i]) + logger.debug('Reading from %s',url) + response=urllib2.urlopen(url) + data=json.loads(response.read()) + logger.debug("Response is %s",json.dumps(data, indent=4, sort_keys=True)) + except: +# +# no access to Domoticz server +# return old reading +# + readOK=False + logger.warning("No access to Domoticz server") + newTemp[i]=currentTemp[i] + if readOK : + try: + temperature = data ["result"][0]["Temp"] + logger.debug('Room index %s, temperature is %s', i, temperature) + newTemp[i] = (round(temperature,1)) + except KeyError: + logger.warning("Domoticz sensor idx %s is not known!",sensors[i]) + else: +# +# Read 1 wire sensors the old way +# + searchPath = basePath + sensors[i] + tailPath + logger.debug("Reading 1-wire from %s",searchPath) + try: + tfile = open(searchPath) + text = tfile.read() + tfile.close() + secondline = text.split("\n")[1] + temperaturedata = secondline.split(" ")[9] + temperature = float(temperaturedata[2:]) + temperature = temperature / 1000 + newTemp[i] = (round(temperature,1)) + except IOError: + logger.warning("Domoticz 1-wire %s is not known!",sensors[i]) + newTemp[i]=currentTemp[i] + logger.debug('Room index %s, temperature is %s', i, newTemp[i]) + i = i + 1 + return newTemp + +###################################################################### +# +# getdate() +# +# read actual time and date, removes microseconds +# +###################################################################### + +def getdate(): + date = datetime.datetime.now() + return(unicode(date.replace(microsecond=0))) + +###################################################################### +# +# updateTempFile() +# +# Write actual temperatures in file +# +###################################################################### + +def updateTempFile(actualTemp): + file = open("/var/www/html/application/textfile/temperature.txt", "w") + file.write(getdate()) + file.write("; ") + file.write('; '.join(map(str, actualTemp))) + file.close + +###################################################################### +# +# set_output() +# +# controls the specified GPIO.pin either through Domoticz or directly +# +###################################################################### + +def set_output(id, pin, value): + + readOK=True + + logger.info('Room id %s, GPIO id %s, output %s',id, pin,value) + if DOMOTICZ_OUT: + try: + if value: + url="http://"+DOMOTICZ_URL+"/json.htm?type=command¶m=switchlight&idx="+str(pin)+"&switchcmd=Off" + else: + url="http://"+DOMOTICZ_URL+"/json.htm?type=command¶m=switchlight&idx="+str(pin)+"&switchcmd=On" + logger.debug('Reading from %s',url) + response=urllib2.urlopen(url) + except: + readOK =False + logger.warning("No access to Domoticz server") + if readOK: + data=json.loads(response.read()) + logger.debug('Response is %s',json.dumps(data, indent=4, sort_keys=True)) + if data ["status"] != "OK" : + logger.warning("Domoticz switch idx %s is not known!",pin) + else: + GPIO.output(pin,value) + + + + + + +########################################################################## +# +# the control loop +# +######################################################################### + +def main(): + + actualTemp = [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15] + while 1 > 0: +# +# read actual temperatures and store in temporay file to be displayed by web service +# + actualTemp = actualTemps(actualTemp,sensors) + updateTempFile(actualTemp) + + + actualtime=datetime.datetime.now() #get time + actualhour=actualtime.hour #get hour + + x = 0 + while x < 16 and sensors[x] != 0: +# +# Get setpoints for room x from file +# + room = "room" + str(x) + string = "/var/www/html/application/textfile/" + room + ".txt" + logger.debug('Reading setpoints from room %s from file %s', x, string) + room = open(string, "r") + setpoints[x]=float(room.read().split(',')[actualhour]) + room.close() + logger.info('Room id %s, Temperature: %s, Setpoint: %s ', x, actualTemp[x], setpoints[x]) + + if actualTemp[x] > setpoints[x]: set_output(x,pins[x],False) + if actualTemp[x] < setpoints[x]: set_output(x,pins[x],True) + logger.info('--------------------------------------------') + x = x + 1 + + time.sleep(WAIT) + + +try: + + main() + +except: + logger.exception("bbb_domoticz.py terminated"); \ No newline at end of file diff --git a/scripts/bbb_domoticz.sh b/scripts/bbb_domoticz.sh new file mode 100755 index 0000000..e98f246 --- /dev/null +++ b/scripts/bbb_domoticz.sh @@ -0,0 +1,156 @@ +#! /bin/bash +### BEGIN INIT INFO +# Provides: bbb_domoticz +# Required-Start: $network $remote_fs $syslog +# Required-Stop: $network $remote_fs $syslog +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: BehovsBoBox control script +# Description: This daemon will start the BehovsBoBox Control system +### END INIT INFO + +# Do NOT "set -e" + + +PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin +DESC="BehovsBoBox Control System" +NAME=bbb_domoticz.py +USERNAME=pi + +DAEMON=/home/pi/BehovsBoBoxen/scripts/$NAME +# DAEMON_OPTS=$2 +DAMEON_OPTS="-v" + +PIDFILE=/var/run/bbb_domoticz.pid +# +SCRIPTNAME=/etc/init.d/bbb_domoticz.sh + + + +# +# Modified to force deamon to execute in background +# + +# Exit if the package is not installed +# [ -x "$DAEMON" ] || exit 0 + +# Load the VERBOSE setting and other rcS variables +. /lib/init/vars.sh +VERBOSE="" + +# Define LSB log_* functions. +# Depend on lsb-base (>= 3.2-14) to ensure that this file is present +# and status_of_proc is working. +. /lib/lsb/init-functions + +# +# Function that starts the daemon/service +# +do_start() +{ + # Return + # 0 if daemon has been started + # 1 if daemon was already running + # 2 if daemon could not be started + if [ -e $PIDFILE ] + then + pid=$(<$PIDFILE) + ps p $pid > /dev/null || rm -f $PIDFILE + fi +# start-stop-daemon --chuid $USERNAME --start --pidfile $PIDFILE --exec $DAEMON --test > /dev/null \ +# || return 1 +# echo "OK to start" +# +# run script once from /home/pi/bbb_addon +# kill the daemon +# + /home/pi/bbb_addon/bbb_domoticz_local.sh start +# + echo "Extra start", $? + sleep 10 #wait +# pid =$(<$PIDFILE) +# echo "Will kill process", pid +# kill pid +# ps p $pid > /dev/null || rm -f $PIDFILE +# +# start again + + + + + start-stop-daemon --start --make-pidfile --pidfile $PIDFILE --background --startas $DAEMON -- $DAEMON_OPTS || return 2 +# python /home/pi/bbb_addon/bbb_domoticz.sh & +} + +# +# Function that stops the daemon/service +# +do_stop() +{ + # Return + # 0 if daemon has been stopped + # 1 if daemon was already stopped + # 2 if daemon could not be stopped + # other if a failure occurred + start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --pidfile $PIDFILE + RETVAL="$?" + [ "$RETVAL" = 2 ] && return 2 + # Wait for children to finish too if this is a daemon that forks + # and if the daemon is only ever run from this initscript. + # If the above conditions are not satisfied then add some other code + # that waits for the process to drop all resources that could be + # needed by services started subsequently. A last resort is to + # sleep for some time. + start-stop-daemon --stop --quiet --oknodo --retry=0/30/KILL/5 --exec $DAEMON + [ "$?" = 2 ] && return 2 + # Many daemons don't delete their pidfiles when they exit. + rm -f $PIDFILE + return "$RETVAL" +} + +case "$1" in + start) + [ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME" + do_start +# echo "status $?" + case "$?" in + 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; + 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; + esac + ;; + stop) + [ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME" + do_stop + case "$?" in + 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; + 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; + esac + ;; + status) + status_of_proc "$DAEMON" "$NAME" && exit 0 || exit $? + ;; + restart) + log_daemon_msg "Restarting $DESC" "$NAME" + do_stop + case "$?" in + 0|1) + do_start + case "$?" in + 0) log_end_msg 0 ;; + 1) log_end_msg 1 ;; # Old process is still running + *) log_end_msg 1 ;; # Failed to start + esac + ;; + *) + # Failed to stop + log_end_msg 1 + ;; + esac + ;; + *) + echo "Usage: $SCRIPTNAME {start|stop|status|restart}" >&2 + exit 3 + ;; +esac + +: diff --git a/scripts/bbb_domoticz_local.sh b/scripts/bbb_domoticz_local.sh new file mode 100755 index 0000000..7805a49 --- /dev/null +++ b/scripts/bbb_domoticz_local.sh @@ -0,0 +1,136 @@ +#! /bin/bash +### BEGIN INIT INFO +# Provides: bbb_domoticz +# Required-Start: $network $remote_fs $syslog +# Required-Stop: $network $remote_fs $syslog +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: BehovsBoBox control script +# Description: This daemon will start the BehovsBoBox Control system +### END INIT INFO + +# Do NOT "set -e" + +PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin +DESC="BehovsBoBox Control System" +NAME=bbb_domoticz.py +USERNAME=pi + +DAEMON=/home/pi/scripts/$NAME +DEAMON_OPTS=$2 + +PIDFILE=/var/run/bbb_domoticz.pid +# +SCRIPTNAME=/etc/init.d/bbb_domoticz.sh + + + +# +# Modified to force deamon to execute in background +# + +# Exit if the package is not installed +# [ -x "$DAEMON" ] || exit 0 + +# Load the VERBOSE setting and other rcS variables +. /lib/init/vars.sh +VERBOSE="yes" + +# Define LSB log_* functions. +# Depend on lsb-base (>= 3.2-14) to ensure that this file is present +# and status_of_proc is working. +. /lib/lsb/init-functions + +# +# Function that starts the daemon/service +# +do_start() +{ + # Return + # 0 if daemon has been started + # 1 if daemon was already running + # 2 if daemon could not be started + if [ -e $PIDFILE ] + then + pid=$(<$PIDFILE) + ps p $pid > /dev/null || rm -f $PIDFILE + fi +# start-stop-daemon --chuid $USERNAME --start --pidfile $PIDFILE --exec $DAEMON --test > /dev/null \ +# || return 1 +# echo "OK to start" + start-stop-daemon --start --make-pidfile --pidfile $PIDFILE --background --startas $DAEMON -- $DEAMON_OPTS || return 2 +# python /home/pi/bbb_addon/bbb_domoticz.sh & +} + +# +# Function that stops the daemon/service +# +do_stop() +{ + # Return + # 0 if daemon has been stopped + # 1 if daemon was already stopped + # 2 if daemon could not be stopped + # other if a failure occurred + start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --pidfile $PIDFILE + RETVAL="$?" + [ "$RETVAL" = 2 ] && return 2 + # Wait for children to finish too if this is a daemon that forks + # and if the daemon is only ever run from this initscript. + # If the above conditions are not satisfied then add some other code + # that waits for the process to drop all resources that could be + # needed by services started subsequently. A last resort is to + # sleep for some time. + start-stop-daemon --stop --quiet --oknodo --retry=0/30/KILL/5 --exec $DAEMON + [ "$?" = 2 ] && return 2 + # Many daemons don't delete their pidfiles when they exit. + rm -f $PIDFILE + return "$RETVAL" +} + +case "$1" in + start) + [ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME" + do_start +# echo "status $?" + case "$?" in + 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; + 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; + esac + ;; + stop) + [ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME" + do_stop + case "$?" in + 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; + 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; + esac + ;; + status) + status_of_proc "$DAEMON" "$NAME" && exit 0 || exit $? + ;; + restart) + log_daemon_msg "Restarting $DESC" "$NAME" + do_stop + case "$?" in + 0|1) + do_start + case "$?" in + 0) log_end_msg 0 ;; + 1) log_end_msg 1 ;; # Old process is still running + *) log_end_msg 1 ;; # Failed to start + esac + ;; + *) + # Failed to stop + log_end_msg 1 + ;; + esac + ;; + *) + echo "Usage: $SCRIPTNAME {start|stop|status|restart}" >&2 + exit 3 + ;; +esac + +: diff --git a/scripts/check_processes.sh b/scripts/check_processes.sh new file mode 100644 index 0000000..350e4fa --- /dev/null +++ b/scripts/check_processes.sh @@ -0,0 +1,48 @@ +#!/bin/bash + +# echo "Check processes and network connection" + +. /lib/init/vars.sh +VERBOSE="" + +. /lib/lsb/init-functions + + +DOMOTICZPID=$( /dev/null +if [ "$?" = "1" ] +then + echo $(date) "Domoticz is not running. Will be restarted" | tee -a /var/log/checkp.log > /dev/null + /etc/init.d/domoticz.sh start +fi + + +ps p $DALLASPID > /dev/null +if [ "$?" = "1" ] +then + echo $(date) "Dallas.py is not running. Will be restarted" | tee -a /var/log/checkp.log > /dev/null + /etc/init.d/bbb_domoitcz.sh start +fi + + +ping -c 1 192.168.1.1 > /tmp/ping.log +if [ "$?" != "0" ] +then +# date | tee -a /var/log/checkp.log > /dev/null +# cat /tmp/ping.log | tee -a /var/log/checkp.log + echo $(date) "No network connection. Will try to restart interface." | tee -a /var/log/checkp.log > /dev/null + /etc/init.d/networking stop + /etc/init.d/networking start +# ifdown wlan0&&ifup wlan0 + sleep 10s + ping -c 1 192.168.1.1 > /tmp/ping.log + if [ "$?" != 0 ] + then + echo $(date) "Network still down. Will reboot" | sudo tee -a /var/log/checkp.log > /dev/null + sudo reboot + fi + exit 0 +fi \ No newline at end of file diff --git a/scripts/checkp b/scripts/checkp new file mode 100644 index 0000000..9339244 --- /dev/null +++ b/scripts/checkp @@ -0,0 +1 @@ +*/10 * * * * root /home/pi/BehovsBoBoxen/scripts/check_processes.sh diff --git a/scripts/reboot b/scripts/reboot new file mode 100644 index 0000000..f356bfc --- /dev/null +++ b/scripts/reboot @@ -0,0 +1 @@ +15 1 * * * root /home/pi/BehovsBoBoxen/scripts/reboot.sh From 30a00d2a484aba207bb62c6b2c43f6cd4cf03d82 Mon Sep 17 00:00:00 2001 From: Ulf Bengtner Date: Mon, 25 Apr 2016 22:14:17 +0200 Subject: [PATCH 07/11] Remove submodule bbb_addon entry --- bbb_addon | 1 - 1 file changed, 1 deletion(-) delete mode 160000 bbb_addon diff --git a/bbb_addon b/bbb_addon deleted file mode 160000 index 3f3254c..0000000 --- a/bbb_addon +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 3f3254c51ce747d33c1c5b02b0222e8674f3aaf4 From b1a551e91db4d12e7cfd2788365083ab5dd46da9 Mon Sep 17 00:00:00 2001 From: bengtner Date: Sat, 30 Apr 2016 15:04:42 +0200 Subject: [PATCH 08/11] errors in install.sh fixed --- install.sh | 26 ++--- install.sh~ | 198 +++++++++++++++++++++++++++++++++++++ scripts/check_processes.sh | 0 scripts/checkp | 0 scripts/reboot | 0 5 files changed, 213 insertions(+), 11 deletions(-) create mode 100755 install.sh~ mode change 100644 => 100755 scripts/check_processes.sh mode change 100644 => 100755 scripts/checkp mode change 100644 => 100755 scripts/reboot diff --git a/install.sh b/install.sh index de3d0e2..fd7db8e 100755 --- a/install.sh +++ b/install.sh @@ -20,7 +20,7 @@ then DOMOTICZ=1 echo "No Domoticz support" else - DOMITICZ=0 + DOMOTICZ=0 echo "Domoticz support" fi @@ -56,6 +56,7 @@ do_web() sudo rm -f /var/www/html/index.html # remove above file + echo "Webb application updated" RETVAL="$?" return "$RETVAL" } @@ -95,10 +96,10 @@ do_all() sudo chmod 777 /home/pi/BehovsBoBoxen -R # full file permissions for the the BehovsBoBoxen-repository from github - if [$DOMOTICZ] + if [ $DOMOTICZ ] then echo "Install Domoticz support" - sudo cp /home/pi/BehovsBoBoxen/bbb_addon/bbb_domoticz.sh /etc/init.d + sudo cp /home/pi/BehovsBoBoxen/scripts/bbb_domoticz.sh /etc/init.d sudo chmod 755 /etc/init.d/bbb_domoticz.sh sudo update-rc.d bbb_domoticz.sh defaults @@ -108,16 +109,17 @@ do_all() # copies and change path for the file that starts the box at reboot fi - do_web() + do_web - sudo crontab -l -u root | cat /home/pi/BehovsBoBoxen/scripts/cron.txt | sudo c +# sudo crontab -l -u root | cat /home/pi/BehovsBoBoxen/scripts/cron.txt | sudo crontab -u root - # we get the new spotpricefile after 16:00 and recalculate the temperatures afte - cat /boot/config.txt |grep "dtoverlay=w1-gpio,gpiopin=4" || sudo tee -a /boot/ + cat /boot/config.txt |grep "dtoverlay=w1-gpio,gpiopin=4" || echo "dtoverlay=w1-gpio,gpiopin=4" | sudo tee -a /boot/config.txt # append "dtoverlay=..." to /boot/config.txt unless it's already there # + echo "Enable SSL mode" sudo a2enmod ssl sudo service apache2 restart # enable mod_ssl @@ -133,7 +135,8 @@ do_all() sudo chmod 777 /etc/apache2/ssl -R # adds ssl repository, to hold key and cerificate - sudo openssl req -x509 -nodes -days 1095 -newkey rsa:2048 -out /etc/apache2/ssl + echo "Generate selfsigned certificate" + sudo openssl req -x509 -nodes -days 1095 -newkey rsa:2048 -out /etc/apache2/ssl/behovsboboxen.crt -keyout /etc/apache2/ssl/behovsboboxen.key -subj "/C=SE/ST=Sverige/L=Molndal/O=/OU=/CN=behovsboboxen" # req request #-nodes if a private key is created it will not be encrypted @@ -145,14 +148,15 @@ do_all() #x509 certificate display and signing utility #-subj arg Replaces subject field of input request with specified data and + echo "Certificate done" sudo rm -f /etc/apache2/sites-available/default-ssl.conf - sudo cp -rp /home/pi/BehovsBoBoxen/scripts/default-ssl /etc/apache2/sites-avail - sudo cp -rp /home/pi/BehovsBoBoxen/scripts/000-default-ssl /etc/apache2/sites-e + sudo cp -rp /home/pi/BehovsBoBoxen/scripts/default-ssl /etc/apache2/sites-available/default-ssl + sudo cp -rp /home/pi/BehovsBoBoxen/scripts/000-default-ssl /etc/apache2/sites-enabled/000-default-ssl # symlink text, -p keeps file permissions from host to receiver - sudo cp -rp /home/pi/BehovsBoBoxen/scripts/default-ssl.conf /etc/apache2/sites- - sudo cp -rp /home/pi/BehovsBoBoxen/scripts/default-ssl.conf /etc/apache2/sites- + sudo cp -rp /home/pi/BehovsBoBoxen/scripts/default-ssl.conf /etc/apache2/sites-available/default-ssl.conf + sudo cp -rp /home/pi/BehovsBoBoxen/scripts/default-ssl.conf /etc/apache2/sites-enabled/default-ssl.conf # 443 sudo chmod 755 /etc/apache2 diff --git a/install.sh~ b/install.sh~ new file mode 100755 index 0000000..bf6bbec --- /dev/null +++ b/install.sh~ @@ -0,0 +1,198 @@ +#! /bin/sh +# +# +# +# install.sh +# +# Description: Installs BehovsBoBoxen +# +# Usage: install.sh {web|all} {x} +# +# web - update the web server part +# all - installs the complete system including update/upgrade of system, install of additional packages etc. +# x - If a second argument is specified, Domoticz support is installed, i.e. bbb_domoticz.py will be the +# control process. +# + +if [ -z "$2" ] +then + + DOMOTICZ=1 + echo "No Domoticz support" +else + DOMOTICZ=0 + echo "Domoticz support" +fi + + +# Set true (0) if support for Domoticz control is desired +# Will use bbb_add/bbb_domoticz.py as control system and install startup script +# rc.local will not modified +# +# + + + +# +# Function updates the webb application +# +do_web() +{ + echo "Update BehovsBoBoxen webb application" + sudo chmod 755 /var/www -R +# full file permissions + + sudo cp -R /home/pi/BehovsBoBoxen/html /var/www +# copies the files for the web-interface + sudo chmod 755 /var/www/html -R +# restore file permissions + + sudo chmod 777 /var/www/html/application/textfile -R + sudo chmod 777 /var/www/html/application/data -R + sudo chmod 777 /var/www/html/application/data/.ht.sqlite3 + sudo chmod 777 /var/www/html/src/CCSpotprices/CCSpotprices.php +# full file permissions + + sudo rm -f /var/www/html/index.html +# remove above file + + echo "Webb application updated" + RETVAL="$?" + return "$RETVAL" +} + +# +# Function that installs the whole BehovsBoBoxen +# +do_all() +{ + echo "Install BehovsBoBoxen" + sudo apt-get update -y +# gets Raspian updates + + sudo apt-get upgrade -y +# installs Raspian updates + + sudo apt-get install vsftpd -y +# installs ftp programme + + sudo apt-get install apache2 php5 libapache2-mod-php5 -y +# installs webserver and php library + + sudo apt-get install sqlite3 +# installs sqlite3 + + sudo apt-get install php5-sqlite +# installs php-sqlite + + sudo a2enmod rewrite +# activates mod_rewrite + + sudo service apache2 restart +# restarts apache2 + + sudo rm -f /var/www/html -R + + sudo chmod 777 /home/pi/BehovsBoBoxen -R +# full file permissions for the the BehovsBoBoxen-repository from github + + if [ $DOMOTICZ ] + then + echo "Install Domoticz support" + sudo cp /home/pi/BehovsBoBoxen/scripts/bbb_domoticz.sh /etc/init.d + sudo chmod 755 /etc/init.d/bbb_domoticz.sh + sudo update-rc.d bbb_domoticz.sh defaults + + else + sudo cp /home/pi/BehovsBoBoxen/scripts/rc.local /etc/rc.local + sudo chmod 755 /etc/rc.local +# copies and change path for the file that starts the box at reboot + fi + + do_web + +# sudo crontab -l -u root | cat /home/pi/BehovsBoBoxen/scripts/cron.txt | sudo crontab -u root - +# we get the new spotpricefile after 16:00 and recalculate the temperatures afte + + + cat /boot/config.txt |grep "dtoverlay=w1-gpio,gpiopin=4" || sudo tee -a /boot/config.txt +# append "dtoverlay=..." to /boot/config.txt unless it's already there +# + + echo "Enable SSL mode" + sudo a2enmod ssl + sudo service apache2 restart +# enable mod_ssl + + sudo chmod 777 /etc/apache2 -R + + sudo rm -f /etc/apache2/apache2.conf + sudo cp /home/pi/BehovsBoBoxen/scripts/apache2.conf /etc/apache2/apache2.conf +# AllowOverride All + +# sudo mkdir /etc/apache2/ssl + sudo cp -rp /home/pi/BehovsBoBoxen/ssl /etc/apache2 + sudo chmod 777 /etc/apache2/ssl -R +# adds ssl repository, to hold key and cerificate + + echo "Generate selfsigned certificate" + sudo openssl req -x509 -nodes -days 1095 -newkey rsa:2048 -out /etc/apache2/ssl/behovsboboxen.crt -keyout /etc/apache2/ssl/behovsboboxen.key -subj "/C=SE/ST=Sverige/L=Molndal/O=/OU=/CN=behovsboboxen" + +# req request +#-nodes if a private key is created it will not be encrypted +#-newkey creates a new certificate request and a new private key +#rsa:2048 generates an RSA key 2048 bits in size +#-keyout the filename to write the newly created private key to +#-out specifies the output filename +#-subj sets certificate subject +#x509 certificate display and signing utility +#-subj arg Replaces subject field of input request with specified data and + + echo "Certificate done" + sudo rm -f /etc/apache2/sites-available/default-ssl.conf + + sudo cp -rp /home/pi/BehovsBoBoxen/scripts/default-ssl /etc/apache2/sites-available/default-ssl + sudo cp -rp /home/pi/BehovsBoBoxen/scripts/000-default-ssl /etc/apache2/sites-enabled/000-default-ssl +# symlink text, -p keeps file permissions from host to receiver + + sudo cp -rp /home/pi/BehovsBoBoxen/scripts/default-ssl.conf /etc/apache2/sites-available/default-ssl.conf + sudo cp -rp /home/pi/BehovsBoBoxen/scripts/default-ssl.conf /etc/apache2/sites-enabled/default-ssl.conf +# 443 + + sudo chmod 755 /etc/apache2 + sudo chmod 755 /etc/apache2/ssl + sudo chmod 755 /home/pi/BehovsBoBoxen +# restores file permissions + + + sudo /etc/init.d/apache2 restart +# restarts apache2 + + + + echo "installation ok, the system will restart" + sudo reboot + + + + + RETVAL="$?" + return "$RETVAL" +} + +case "$1" in + web) + do_web + ;; + all) + do_all + ;; + + + *) + echo "Usage: $SCRIPTNAME {web|all}" + exit 3 + ;; +esac + +: diff --git a/scripts/check_processes.sh b/scripts/check_processes.sh old mode 100644 new mode 100755 diff --git a/scripts/checkp b/scripts/checkp old mode 100644 new mode 100755 diff --git a/scripts/reboot b/scripts/reboot old mode 100644 new mode 100755 From b53dfbc21b2e6fa0f49128d2afa181286b5be445 Mon Sep 17 00:00:00 2001 From: bengtner Date: Sat, 30 Apr 2016 22:49:30 +0200 Subject: [PATCH 09/11] fixed path error --- scripts/bbb_domoticz.sh | 2 +- scripts/bbb_domoticz.sh~ | 156 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 157 insertions(+), 1 deletion(-) create mode 100755 scripts/bbb_domoticz.sh~ diff --git a/scripts/bbb_domoticz.sh b/scripts/bbb_domoticz.sh index e98f246..37f9f0a 100755 --- a/scripts/bbb_domoticz.sh +++ b/scripts/bbb_domoticz.sh @@ -64,7 +64,7 @@ do_start() # run script once from /home/pi/bbb_addon # kill the daemon # - /home/pi/bbb_addon/bbb_domoticz_local.sh start + /home/pi/BehovsBoBoxen/scripts/bbb_domoticz_local.sh start # echo "Extra start", $? sleep 10 #wait diff --git a/scripts/bbb_domoticz.sh~ b/scripts/bbb_domoticz.sh~ new file mode 100755 index 0000000..e98f246 --- /dev/null +++ b/scripts/bbb_domoticz.sh~ @@ -0,0 +1,156 @@ +#! /bin/bash +### BEGIN INIT INFO +# Provides: bbb_domoticz +# Required-Start: $network $remote_fs $syslog +# Required-Stop: $network $remote_fs $syslog +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: BehovsBoBox control script +# Description: This daemon will start the BehovsBoBox Control system +### END INIT INFO + +# Do NOT "set -e" + + +PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin +DESC="BehovsBoBox Control System" +NAME=bbb_domoticz.py +USERNAME=pi + +DAEMON=/home/pi/BehovsBoBoxen/scripts/$NAME +# DAEMON_OPTS=$2 +DAMEON_OPTS="-v" + +PIDFILE=/var/run/bbb_domoticz.pid +# +SCRIPTNAME=/etc/init.d/bbb_domoticz.sh + + + +# +# Modified to force deamon to execute in background +# + +# Exit if the package is not installed +# [ -x "$DAEMON" ] || exit 0 + +# Load the VERBOSE setting and other rcS variables +. /lib/init/vars.sh +VERBOSE="" + +# Define LSB log_* functions. +# Depend on lsb-base (>= 3.2-14) to ensure that this file is present +# and status_of_proc is working. +. /lib/lsb/init-functions + +# +# Function that starts the daemon/service +# +do_start() +{ + # Return + # 0 if daemon has been started + # 1 if daemon was already running + # 2 if daemon could not be started + if [ -e $PIDFILE ] + then + pid=$(<$PIDFILE) + ps p $pid > /dev/null || rm -f $PIDFILE + fi +# start-stop-daemon --chuid $USERNAME --start --pidfile $PIDFILE --exec $DAEMON --test > /dev/null \ +# || return 1 +# echo "OK to start" +# +# run script once from /home/pi/bbb_addon +# kill the daemon +# + /home/pi/bbb_addon/bbb_domoticz_local.sh start +# + echo "Extra start", $? + sleep 10 #wait +# pid =$(<$PIDFILE) +# echo "Will kill process", pid +# kill pid +# ps p $pid > /dev/null || rm -f $PIDFILE +# +# start again + + + + + start-stop-daemon --start --make-pidfile --pidfile $PIDFILE --background --startas $DAEMON -- $DAEMON_OPTS || return 2 +# python /home/pi/bbb_addon/bbb_domoticz.sh & +} + +# +# Function that stops the daemon/service +# +do_stop() +{ + # Return + # 0 if daemon has been stopped + # 1 if daemon was already stopped + # 2 if daemon could not be stopped + # other if a failure occurred + start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --pidfile $PIDFILE + RETVAL="$?" + [ "$RETVAL" = 2 ] && return 2 + # Wait for children to finish too if this is a daemon that forks + # and if the daemon is only ever run from this initscript. + # If the above conditions are not satisfied then add some other code + # that waits for the process to drop all resources that could be + # needed by services started subsequently. A last resort is to + # sleep for some time. + start-stop-daemon --stop --quiet --oknodo --retry=0/30/KILL/5 --exec $DAEMON + [ "$?" = 2 ] && return 2 + # Many daemons don't delete their pidfiles when they exit. + rm -f $PIDFILE + return "$RETVAL" +} + +case "$1" in + start) + [ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME" + do_start +# echo "status $?" + case "$?" in + 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; + 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; + esac + ;; + stop) + [ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME" + do_stop + case "$?" in + 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; + 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; + esac + ;; + status) + status_of_proc "$DAEMON" "$NAME" && exit 0 || exit $? + ;; + restart) + log_daemon_msg "Restarting $DESC" "$NAME" + do_stop + case "$?" in + 0|1) + do_start + case "$?" in + 0) log_end_msg 0 ;; + 1) log_end_msg 1 ;; # Old process is still running + *) log_end_msg 1 ;; # Failed to start + esac + ;; + *) + # Failed to stop + log_end_msg 1 + ;; + esac + ;; + *) + echo "Usage: $SCRIPTNAME {start|stop|status|restart}" >&2 + exit 3 + ;; +esac + +: From 41eac6c04094196458d303962f54356782d217d2 Mon Sep 17 00:00:00 2001 From: bengtner Date: Sun, 1 May 2016 20:57:41 +0200 Subject: [PATCH 10/11] Fixed problem with directory for log files --- install.sh | 4 +- install.sh~ | 2 +- scripts/bbb_domoticz.py | 2 +- scripts/bbb_domoticz.py~ | 396 +++++++++++++++++++++++++++++++++++++++ 4 files changed, 401 insertions(+), 3 deletions(-) create mode 100755 scripts/bbb_domoticz.py~ diff --git a/install.sh b/install.sh index fd7db8e..61c833d 100755 --- a/install.sh +++ b/install.sh @@ -14,6 +14,8 @@ # control process. # +LOGFILE = "/var/log/bbb" + if [ -z "$2" ] then @@ -102,7 +104,7 @@ do_all() sudo cp /home/pi/BehovsBoBoxen/scripts/bbb_domoticz.sh /etc/init.d sudo chmod 755 /etc/init.d/bbb_domoticz.sh sudo update-rc.d bbb_domoticz.sh defaults - + [ -e $LOGFILE ] || mkdir $LOGFILE else sudo cp /home/pi/BehovsBoBoxen/scripts/rc.local /etc/rc.local sudo chmod 755 /etc/rc.local diff --git a/install.sh~ b/install.sh~ index bf6bbec..fd7db8e 100755 --- a/install.sh~ +++ b/install.sh~ @@ -115,7 +115,7 @@ do_all() # we get the new spotpricefile after 16:00 and recalculate the temperatures afte - cat /boot/config.txt |grep "dtoverlay=w1-gpio,gpiopin=4" || sudo tee -a /boot/config.txt + cat /boot/config.txt |grep "dtoverlay=w1-gpio,gpiopin=4" || echo "dtoverlay=w1-gpio,gpiopin=4" | sudo tee -a /boot/config.txt # append "dtoverlay=..." to /boot/config.txt unless it's already there # diff --git a/scripts/bbb_domoticz.py b/scripts/bbb_domoticz.py index 3713c61..db2831a 100755 --- a/scripts/bbb_domoticz.py +++ b/scripts/bbb_domoticz.py @@ -61,7 +61,7 @@ USERNAME = 'ubee' # update username and password to what is defined in Domoticz PASSWORD = 'xyz' -LOGFILE = '/home/pi/bbb_addon/bbb_domoticz.log' +LOGFILE = '/var/log/bbb/bbb_domoticz.log' def tracefunc(frame, event, arg, indent=[0]): calltrace="" diff --git a/scripts/bbb_domoticz.py~ b/scripts/bbb_domoticz.py~ new file mode 100755 index 0000000..3713c61 --- /dev/null +++ b/scripts/bbb_domoticz.py~ @@ -0,0 +1,396 @@ +#!/usr/bin/python +#-*- coding: utf-8 -*- +#2016-03-14:21:51 +# +# Modified by Ulf Bengtner, 2015-06-14, to read all sensors from Domoticz. +# +# All sensors are mapped by Domoticz sensor id, IDX. The actual sensors used +# are read from a configuration file /home/pi/domoticz_sensors. They should be +# listed in the same order as the room names are specified in Behovsbobox +# +# +import urllib2,json,sys +#import urllib2,json + +import datetime; +import time; +import sqlite3 +import datetime +import logging, logging.handlers, argparse +import subprocess +import RPi.GPIO as GPIO + +#GPIO general purpose input output +GPIO.setmode(GPIO.BOARD) # Board numbering mode, i.e. number refers to pin +GPIO.setwarnings(False) +#GPIO.setup(11,GPIO.OUT) +#GPIO.setup(13,GPIO.OUT) +#GPIO.setup(15,GPIO.OUT) +#GPIO.setup(29,GPIO.OUT) +#GPIO.setup(31,GPIO.OUT) +#GPIO.setup(33,GPIO.OUT) +#GPIO.setup(35,GPIO.OUT) +#GPIO.setup(37,GPIO.OUT) +#GPIO.setup(12,GPIO.OUT) +#GPIO.setup(16,GPIO.OUT) +#GPIO.setup(18,GPIO.OUT) +#GPIO.setup(22,GPIO.OUT) +#GPIO.setup(32,GPIO.OUT) +#GPIO.setup(36,GPIO.OUT) +#GPIO.setup(38,GPIO.OUT) +#GPIO.setup(40,GPIO.OUT) +# +# original pin-out Öland +# +GPIO.setup(26,GPIO.OUT) +GPIO.setup(24,GPIO.OUT) +GPIO.setup(21,GPIO.OUT) +GPIO.setup(19,GPIO.OUT) +GPIO.setup(23,GPIO.OUT) +GPIO.setup(11,GPIO.OUT) +GPIO.setup(12,GPIO.OUT) +GPIO.setup(15,GPIO.OUT) + + +WAIT=300 # Delay (s) between each cycle in control loop + +DOMOTICZ_IN=1 # Set this variable to 1 to read temperatures from Domoticz, otherwise 0 +DOMOTICZ_OUT=0 # Set this variable to 1 to control valves from Domoticz, otherwise 0 + +DOMOTICZ_URL="bobox.dyndns.org:8085" # URL to Domoticz server - use 127.0.0.1 for local +USERNAME = 'ubee' # update username and password to what is defined in Domoticz +PASSWORD = 'xyz' + +LOGFILE = '/home/pi/bbb_addon/bbb_domoticz.log' + +def tracefunc(frame, event, arg, indent=[0]): + calltrace="" + if event == "call": + indent[0] += 2 + logger.debug("-" * indent[0] + "> call function +%s",frame.f_code.co_name) + elif event == "return": + logger.debug("-" * indent[0] + "exit function +%s",frame.f_code.co_name) + indent[0] -= 2 + return tracefunc + + + +# +# The control loop reads those sensors (slaves). The control loop stop +# when id is 0 +# +# If Domoticz is used for control, the Domoticz idx is read from Domoticz. Otherwise configure with 1w id:s +# +# +# sensors[0] - first room +# sensors[1] - second room +# ... +# +sensors = [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0] + +# +#sensors = ["28-00000662b340","28-000006636be0","28-00000663000e","28-00000558923e","28-000006636545","28-0000066355d5","28-00000663137f",0,0,0,0,0,0,0,0,0] +# +# +# array of rooms holding the setpoint values we want +# +setpoints = [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15] +# +# +# the temperature value we read in each room +# +actualTemp = [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15] +# +# +# The GPIO pin used to control the valve for each room +# With Domoticz control, the value is configured and read from Domoticz. The number corresponds to the IDX of the associated +# switch controlling a defined pin +# + +pins = [26,24,21,19,23,11,12,15,0,0,0,0,0,0,0,0] + +# +# define logging handler +# +parser = argparse.ArgumentParser( description='BehovsBoBoxen Control daemon' ) +parser.add_argument("-v", "--verbose", help="Logging verbose", action="store_true") + +args = parser.parse_args() +if args.verbose: + logging.basicConfig(level=logging.DEBUG) +else: + logging.basicConfig(level=logging.INFO) + + +logger = logging.getLogger(__name__) + +# create a file handler + +handler = logging.handlers.RotatingFileHandler(LOGFILE,maxBytes=200000,backupCount=10) +# +# set level +# +handler.setLevel(logging.DEBUG) # Do not change this! + +# create a logging format + +formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s') +handler.setFormatter(formatter) + +# add the handlers to the logger + +logger.addHandler(handler) + +logger.info("BehovsBoBoxen control system: bbb_domoticz.py starting up") + +# +# Uncomment this line for extensive tracing +# +# sys.settrace(tracefunc) + +if DOMOTICZ_IN or DOMOTICZ_OUT: +# +# build authenticate string to access Domoticz server +# + + p = urllib2.HTTPPasswordMgrWithDefaultRealm() + p.add_password(None, DOMOTICZ_URL, USERNAME, PASSWORD) + + handler = urllib2.HTTPBasicAuthHandler(p) + opener = urllib2.build_opener(handler) + urllib2.install_opener(opener) + + + + + if DOMOTICZ_IN: +# +# Find all temperature sensors in Domoticz and populate sensors array +# + url= "http://"+DOMOTICZ_URL+"/json.htm?type=devices&filter=temp&used=true&order=Name" + logger.debug('Reading from %s',url) + try: + response=urllib2.urlopen(url) + data=json.loads(response.read()) + logger.debug('Response is %s',json.dumps(data, indent=4, sort_keys=True)) + for i in range(len(data["result"])): + a=data["result"][i]["Description"] + ini=a.find('%room') + if ini != -1: + ini=ini+6 + rIndex=int(a[ini:]) + logger.info('Configure room id %s with Domoticz sensor idx: %s', rIndex, data["result"][i]["idx"]) + sensors[rIndex]=data["result"][i]["idx"] + except URLError: + logger.warning('Cannot connect to Domoticz server %s', url) + +# +# end if DOMOTICZ_IN +# + +if DOMOTICZ_OUT: +# +# Find all swítches that control valves in Domoticz and populate output array +# + + url= "http://"+DOMOTICZ_URL+"/json.htm?type=devices&filter=light&used=true&order=Name" + logger.debug('Reading from %s',url) + response=urllib2.urlopen(url) +# response=urllib.urlopen(url) + data=json.loads(response.read()) + logger.debug('Response is %s',json.dumps(data, indent=4, sort_keys=True)) + + for i in range(len(data["result"])): + a=data["result"][i]["Description"] + ini=a.find('%room') + if ini != -1: + ini=ini+6 + rIndex=int(a[ini:]) + logger.info('Configure room id %s with Domoticz switch IDX %s',str(rIndex), data["result"][i]["idx"]) + + pins[rIndex]=data["result"][i]["idx"] +# +# end if DOMOTICZ_OUT +# +logger.info('======================================================================') + + +################################################################################# +# +# actualTemps() +# +# reads the temperatures in each room and returns array +# +# depending on the variable domoticz the temperatures are read through Domoticz +# or directly from 1-wire sensors. +# +################################################################################## + +def actualTemps(currentTemp,sensors): + + basePath="/sys/bus/w1/devices/" + tailPath="/w1_slave" + newTemp=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15] + readOK=True + + i = 0 + while i < 16 and sensors[i] != 0: + + if DOMOTICZ_IN: +# +# Read devices in Domoticz +# + try: + url= "http://"+DOMOTICZ_URL+"/json.htm?type=devices&rid=" + str(sensors[i]) + logger.debug('Reading from %s',url) + response=urllib2.urlopen(url) + data=json.loads(response.read()) + logger.debug("Response is %s",json.dumps(data, indent=4, sort_keys=True)) + except: +# +# no access to Domoticz server +# return old reading +# + readOK=False + logger.warning("No access to Domoticz server") + newTemp[i]=currentTemp[i] + if readOK : + try: + temperature = data ["result"][0]["Temp"] + logger.debug('Room index %s, temperature is %s', i, temperature) + newTemp[i] = (round(temperature,1)) + except KeyError: + logger.warning("Domoticz sensor idx %s is not known!",sensors[i]) + else: +# +# Read 1 wire sensors the old way +# + searchPath = basePath + sensors[i] + tailPath + logger.debug("Reading 1-wire from %s",searchPath) + try: + tfile = open(searchPath) + text = tfile.read() + tfile.close() + secondline = text.split("\n")[1] + temperaturedata = secondline.split(" ")[9] + temperature = float(temperaturedata[2:]) + temperature = temperature / 1000 + newTemp[i] = (round(temperature,1)) + except IOError: + logger.warning("Domoticz 1-wire %s is not known!",sensors[i]) + newTemp[i]=currentTemp[i] + logger.debug('Room index %s, temperature is %s', i, newTemp[i]) + i = i + 1 + return newTemp + +###################################################################### +# +# getdate() +# +# read actual time and date, removes microseconds +# +###################################################################### + +def getdate(): + date = datetime.datetime.now() + return(unicode(date.replace(microsecond=0))) + +###################################################################### +# +# updateTempFile() +# +# Write actual temperatures in file +# +###################################################################### + +def updateTempFile(actualTemp): + file = open("/var/www/html/application/textfile/temperature.txt", "w") + file.write(getdate()) + file.write("; ") + file.write('; '.join(map(str, actualTemp))) + file.close + +###################################################################### +# +# set_output() +# +# controls the specified GPIO.pin either through Domoticz or directly +# +###################################################################### + +def set_output(id, pin, value): + + readOK=True + + logger.info('Room id %s, GPIO id %s, output %s',id, pin,value) + if DOMOTICZ_OUT: + try: + if value: + url="http://"+DOMOTICZ_URL+"/json.htm?type=command¶m=switchlight&idx="+str(pin)+"&switchcmd=Off" + else: + url="http://"+DOMOTICZ_URL+"/json.htm?type=command¶m=switchlight&idx="+str(pin)+"&switchcmd=On" + logger.debug('Reading from %s',url) + response=urllib2.urlopen(url) + except: + readOK =False + logger.warning("No access to Domoticz server") + if readOK: + data=json.loads(response.read()) + logger.debug('Response is %s',json.dumps(data, indent=4, sort_keys=True)) + if data ["status"] != "OK" : + logger.warning("Domoticz switch idx %s is not known!",pin) + else: + GPIO.output(pin,value) + + + + + + +########################################################################## +# +# the control loop +# +######################################################################### + +def main(): + + actualTemp = [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15] + while 1 > 0: +# +# read actual temperatures and store in temporay file to be displayed by web service +# + actualTemp = actualTemps(actualTemp,sensors) + updateTempFile(actualTemp) + + + actualtime=datetime.datetime.now() #get time + actualhour=actualtime.hour #get hour + + x = 0 + while x < 16 and sensors[x] != 0: +# +# Get setpoints for room x from file +# + room = "room" + str(x) + string = "/var/www/html/application/textfile/" + room + ".txt" + logger.debug('Reading setpoints from room %s from file %s', x, string) + room = open(string, "r") + setpoints[x]=float(room.read().split(',')[actualhour]) + room.close() + logger.info('Room id %s, Temperature: %s, Setpoint: %s ', x, actualTemp[x], setpoints[x]) + + if actualTemp[x] > setpoints[x]: set_output(x,pins[x],False) + if actualTemp[x] < setpoints[x]: set_output(x,pins[x],True) + logger.info('--------------------------------------------') + x = x + 1 + + time.sleep(WAIT) + + +try: + + main() + +except: + logger.exception("bbb_domoticz.py terminated"); \ No newline at end of file From 0cc525933cb3d42095d4841cd51adc695e91dc4e Mon Sep 17 00:00:00 2001 From: bengtner Date: Sun, 1 May 2016 21:38:12 +0200 Subject: [PATCH 11/11] fixed path error in bbb_domoticz_local.sh --- scripts/bbb_domoticz_local.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/bbb_domoticz_local.sh b/scripts/bbb_domoticz_local.sh index 7805a49..f7f85d9 100755 --- a/scripts/bbb_domoticz_local.sh +++ b/scripts/bbb_domoticz_local.sh @@ -16,7 +16,7 @@ DESC="BehovsBoBox Control System" NAME=bbb_domoticz.py USERNAME=pi -DAEMON=/home/pi/scripts/$NAME +DAEMON=/home/pi/BehovsBoBoxen/scripts/$NAME DEAMON_OPTS=$2 PIDFILE=/var/run/bbb_domoticz.pid