Initial version

git-svn-id: https://fhem.svn.sourceforge.net/svnroot/fhem/trunk/fhem@3 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
rudolfkoenig
2007-01-30 12:47:36 +00:00
commit a5b914121c
107 changed files with 14766 additions and 0 deletions

View File

@@ -0,0 +1,4 @@
All the Documentation of pgm3 is now only online
http://www.martin-haas.de/fhz
Enjoy it :-)

View File

@@ -0,0 +1,124 @@
Bitstream Vera Fonts Copyright
The fonts have a generous copyright, allowing derivative works (as
long as "Bitstream" or "Vera" are not in the names), and full
redistribution (so long as they are not *sold* by themselves). They
can be be bundled, redistributed and sold with any software.
The fonts are distributed under the following copyright:
Copyright
=========
Copyright (c) 2003 by Bitstream, Inc. All Rights Reserved. Bitstream
Vera is a trademark of Bitstream, Inc.
Permission is hereby granted, free of charge, to any person obtaining
a copy of the fonts accompanying this license ("Fonts") and associated
documentation files (the "Font Software"), to reproduce and distribute
the Font Software, including without limitation the rights to use,
copy, merge, publish, distribute, and/or sell copies of the Font
Software, and to permit persons to whom the Font Software is furnished
to do so, subject to the following conditions:
The above copyright and trademark notices and this permission notice
shall be included in all copies of one or more of the Font Software
typefaces.
The Font Software may be modified, altered, or added to, and in
particular the designs of glyphs or characters in the Fonts may be
modified and additional glyphs or characters may be added to the
Fonts, only if the fonts are renamed to names not containing either
the words "Bitstream" or the word "Vera".
This License becomes null and void to the extent applicable to Fonts
or Font Software that has been modified and is distributed under the
"Bitstream Vera" names.
The Font Software may be sold as part of a larger software package but
no copy of one or more of the Font Software typefaces may be sold by
itself.
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL
BITSTREAM OR THE GNOME FOUNDATION BE LIABLE FOR ANY CLAIM, DAMAGES OR
OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL,
OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR
OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE THE FONT
SOFTWARE OR FROM OTHER DEALINGS IN THE FONT SOFTWARE.
Except as contained in this notice, the names of Gnome, the Gnome
Foundation, and Bitstream Inc., shall not be used in advertising or
otherwise to promote the sale, use or other dealings in this Font
Software without prior written authorization from the Gnome Foundation
or Bitstream Inc., respectively. For further information, contact:
fonts at gnome dot org.
Copyright FAQ
=============
1. I don't understand the resale restriction... What gives?
Bitstream is giving away these fonts, but wishes to ensure its
competitors can't just drop the fonts as is into a font sale system
and sell them as is. It seems fair that if Bitstream can't make money
from the Bitstream Vera fonts, their competitors should not be able to
do so either. You can sell the fonts as part of any software package,
however.
2. I want to package these fonts separately for distribution and
sale as part of a larger software package or system. Can I do so?
Yes. A RPM or Debian package is a "larger software package" to begin
with, and you aren't selling them independently by themselves.
See 1. above.
3. Are derivative works allowed?
Yes!
4. Can I change or add to the font(s)?
Yes, but you must change the name(s) of the font(s).
5. Under what terms are derivative works allowed?
You must change the name(s) of the fonts. This is to ensure the
quality of the fonts, both to protect Bitstream and Gnome. We want to
ensure that if an application has opened a font specifically of these
names, it gets what it expects (though of course, using fontconfig,
substitutions could still could have occurred during font
opening). You must include the Bitstream copyright. Additional
copyrights can be added, as per copyright law. Happy Font Hacking!
6. If I have improvements for Bitstream Vera, is it possible they might get
adopted in future versions?
Yes. The contract between the Gnome Foundation and Bitstream has
provisions for working with Bitstream to ensure quality additions to
the Bitstream Vera font family. Please contact us if you have such
additions. Note, that in general, we will want such additions for the
entire family, not just a single font, and that you'll have to keep
both Gnome and Jim Lyles, Vera's designer, happy! To make sense to add
glyphs to the font, they must be stylistically in keeping with Vera's
design. Vera cannot become a "ransom note" font. Jim Lyles will be
providing a document describing the design elements used in Vera, as a
guide and aid for people interested in contributing to Vera.
7. I want to sell a software package that uses these fonts: Can I do so?
Sure. Bundle the fonts with your software and sell your software
with the fonts. That is the intent of the copyright.
8. If applications have built the names "Bitstream Vera" into them,
can I override this somehow to use fonts of my choosing?
This depends on exact details of the software. Most open source
systems and software (e.g., Gnome, KDE, etc.) are now converting to
use fontconfig (see www.fontconfig.org) to handle font configuration,
selection and substitution; it has provisions for overriding font
names and subsituting alternatives. An example is provided by the
supplied local.conf file, which chooses the family Bitstream Vera for
"sans", "serif" and "monospace". Other software (e.g., the XFree86
core server) has other mechanisms for font substitution.

View File

@@ -0,0 +1,5 @@
Gnuplot is now automatically supported for HMS, KS300 and FHT.
If you really want to change the graphics then look at the include/gnuplot.php
######################################################################

View File

@@ -0,0 +1,10 @@
If the files are too big the system will be slower than usual.
In the config.php it is now possible to automatic logrotate the HMS, FHT and KS300-Logs. But it is only possible if the user of the pgm3 (e.g. wwwrun) has the rights to write the logfiles from fhz1000.pl (user=???????)
If you want do that manually then read the enclosed examples for your crontab.
Every Linux-System normally has a logrotate-Daemon. Put the fhz1000.logrotate in your /etc/logrotate.d/ to lograte the fhz1000.cfg and edit it or use the builtin method: "logfile /tmp/fhz1000-%Y-%m.log"

View File

@@ -0,0 +1,11 @@
/var/tmp/fhz1000.log {
rotate 6
size 2M
compress
missingok
notifempty
postrotate
[[ `ps -ef | grep fhz1000.pl | grep -v grep` ]] && \
/etc/init.d/fhz1000 restart
endscript
}

View File

@@ -0,0 +1,24 @@
#!/bin/bash
# this script should be installed in e.g. /etc/crontab:
# 0 3 * * * root /usr/local/bin/logrotate.wz.sh > /dev/null 2>&1
# then there are only about 5 days in the logfile for the FHT-Device
logs="adi bao bau leo wz wzo"
for fht in $logs
do
newlogs="0"
# first time
[[ ! -f /var/tmp/$fht.log.main ]] && cp -p /var/tmp/$fht.log /var/tmp/$fht.log.main
cat /var/tmp/$fht.log | while read line;
do
[[ "$newlogs" = "1" ]] && echo $line | egrep -v 'measured-temp: [0-2]\.' >>/var/tmp/$fht.log.main
[[ "$line" = "NEWLOGS" ]] && newlogs="1"
done;
# 4500 for about 5 days
tail -4500 /var/tmp/$fht.log.main >/var/tmp/$fht.log
echo "NEWLOGS" >>/var/tmp/$fht.log
done;

View File

@@ -0,0 +1,30 @@
#!/bin/bash
# this script should be installed in e.g. /etc/crontab:
# 0 3 * * * root /usr/local/bin/logrotate.hms100.ks300.sh > /dev/null 2>&1
# then there are only about 4 days in the logfile for the HMS/KS300-Device
logpath=/var/tmp
logs="heating laundry ks300"
for dev in $logs
do
newlogs="0"
# first time
if [ ! -f $logpath/$dev.log.main ]; then cp -p $logpath/$dev.log $logpath/$dev.log.main; fi;
cat $logpath/$dev.log | while read line;
do
if [ "$newlogs" = "1" ];
then echo $line >>$logpath/$dev.log.main; fi;
if [ "$line" = "NEWLOGS" ]; then newlogs="1"; fi;
done;
# 1900 for about 5 days
tail -1900 $logpath/$dev.log.main >$logpath/$dev.log
echo "NEWLOGS" >>$logpath/$dev.log
done;

View File

@@ -0,0 +1,150 @@
##############################################
# Low Budget ALARM System
##############################################
# ATTENTION! This is more a toy than a professional alarm system!
# You must know what you do!
##############################################
#
# Concept:
# 1x Signal Light (FS20 allight) to show the status (activated/deactivated)
# 2x Sirene (in/out) (FS20 alsir1 alsir2 )
# 2x PIRI-2 (FS20 piriu pirio)
# 1x Sender (FS20 alsw) to activate/deactivate the system.
# Tip: use the KeyMatic CAC with pin code or
# optional a normal sender (FS20 alsw2)
#
# Add something like the following lines to the configuration file :
# notifyon alsw {MyAlsw()}
# notifyon alsw2 {MyAlswNoPin()}
# notifyon piriu {MyAlarm()}
# notifyon pirio {MyAlarm()}
# and put this file in the <modpath>/FHZ1000 directory.
#
# Martin Haas
##############################################
package main;
use strict;
use warnings;
sub
ALARM_Initialize($$)
{
my ($hash, $init) = @_;
$hash->{Type} = "none";
}
##############################################
# Switching Alarm System on or off
sub
MyAlsw()
{
my $ON="set allight on; setstate alsw on";
my $OFF="set allight off; set alsir1 off; set alsir2 off; setstate alsw off";
if ( -e "/var/tmp/alertsystem")
{
unlink "/var/tmp/alertsystem";
#Paranoia
for (my $i = 0; $i < 2; $i++ )
{
fhz "$OFF";
};
Log 2, "alarm system is OFF";
} else {
system "touch /var/tmp/alertsystem";
#Paranoia
for (my $i = 0; $i < 2; $i++ )
{
fhz "$ON"
}
Log 2, "alarm system is ON";
};
}
##############################################
# If you have no Keymatic then use this workaround:
# After 4x pushing a fs20-button within some seconds it will activate/deactivate the alarm system.
sub
MyAlswNoPin()
{
my $timedout=5;
## first time
if ( ! -e "/var/tmp/alontest1")
{
for (my $i = 1; $i < 4; $i++ )
{
system "touch -t 200601010101 /var/tmp/alontest$i";
}
}
## test 4 times
my $now= `date +%s`;
for (my $i = 1; $i < 4; $i++ )
{
my $tagx=`date -r /var/tmp/alontest$i +%s`;
my $testx=$now-$tagx;
if ( $testx > $timedout )
{
system "touch /var/tmp/alontest$i";
die "test$i: more than $timedout sec";
}
}
system "touch -t 200601010101 /var/tmp/alontest*";
Log 2, "ok, let's switch the alarm system...";
#if you only allow to activate (and not deactivate) with this script:
# if ( -e "/var/tmp/alertsystem") { die "deactivating alarm system not allowed"};
MyAlsw();
}
##############################################
# ALARM! Do what you want!
sub
MyAlarm()
{
#alarm-system activated??
if ( -e "/var/tmp/alertsystem")
{
my $timer=180; # time until the sirene will be quiet
my $ON1="set alsir1 on-for-timer $timer";
my $ON2="set alsir2 on-for-timer $timer";
#Paranoia
for (my $i = 0; $i < 2; $i++ )
{
fhz "$ON1";
fhz "$ON2";
}
Log 2, "ALARM! #################" ;
# have fun
my @lights=("stuwz1", "stuwz2", "nachto", "nachtu", "stoliba" ,"stlileo");
my @rollos=("rolu4", "rolu5", "roloadi", "rololeo", "roloco", "rolowz", "rolunik1", "rolunik2");
foreach my $light (@lights) {
fhz "set $light on"
}
foreach my $rollo (@rollos) {
fhz "set $rollo on"
}
}
}
1;

View File

@@ -0,0 +1,80 @@
##############################################
# Switching the FHTs with e.g. a Button
##############################################
# This is only an example.
# After pressing e.g. a button it will change the values
# of desired-temp against the value of windowopen-temp
# With small changes it is possible to change e.g. all FHTs to
# 2 degrees less if you are leaving the house and activating
# the alarm system.
# Don't change the values very often within a time because the FHT seems
# to hang if there are too much values within a time.
#
# Add something like the following lines to the configuration file :
# notifyon NameOfButton {MyFHTswitch("NameOfFHT")}
# and put this file in the <modpath>/FHZ1000 directory.
# Martin Haas
##############################################
package main;
use strict;
use warnings;
sub
FHTswitch_Initialize($)
{
# my ($hash) = @_; ## for fhz1000 >3.0
# $hash->{Category} = "none"; ## for fhz1000 >3.0
my ($hash, $init) = @_; ## for fhz1000 <=3.0
$hash->{Type} = "none"; ## for fhz1000 <=3.0
}
###### ok, let's learn perl ;-)...
sub
MyFHTswitch($)
{
my $str;
my $fhtorder;
my @a = @_;
my $fht=$a[0];
my @windowopentemp;
my @desiredtemp;
no strict "refs";
$str = &{$devmods{$defs{$a[0]}{TYPE}}{ListFn}}($defs{$a[0]});
my @lines = split("\n", $str);
use strict "refs";
foreach my $l (@lines) {
my ($date, $time, $attr, $val) = split(" ", $l, 4);
if($attr eq "desired-temp")
{
Log 3, "old $attr of $a[0]: $val";
@desiredtemp = split(" ", $val);
}
if($attr eq "windowopen-temp")
{
Log 3, "old $attr of $a[0]: $val";
@windowopentemp = split(" ", $val);
}
}
$fhtorder="set $fht desired-temp $windowopentemp[0] ";
fhz "$fhtorder";
$fhtorder="set $fht windowopen-temp $desiredtemp[0] ";
fhz "$fhtorder";
fhz "set $fht refreshvalues";
}
1;

View File

@@ -0,0 +1,4 @@
These are some Modules for the fhz1000.pl.
Read the docu from fhz1000 howto intall them.
They are intended as an example.