Originally posted by: <email address deleted>
Hello,
First of all sorry not to speak german, I learned this language long time
ago but I am not able to express myself using it.
I am using fhem to regulate the temperature in my appartment using an usb
rfxcom an chacon on/off modules.
I have written some small custom scripts that I load in fhem using telnet.
I was wondering if there is a simple way to store those scripts in standard
files without using
all the \ at the end of the line, while keeping the advantages of having
the different fhem functions available (like Value(), fhem "....").
Here is my script :
define salon_watcher notify temperature_salon { \
> my $current_temperature;; \
> my $radiateur = "radiateur_salon";; \
> my $temperature = "temperature_salon";; \
> my $confortlow = 20.0;;\
> my $conforthigh = 21.0;;\
> my $survivelow = 16.0;;\
> my $survivehigh = 17.0;;\
> sub animatetermal { \
> if ($_[0] <= $_[1]) \
> { \
> Log 1,"Temperature trop basse";; \
> if (Value($radiateur) eq "off") \
> { \
> fhem "set $radiateur on";; \
> Log 1, "$radiateur on" \
> }\
> } \
> elsif ($_[0] >= $_[2]) \
> { \
> Log 1,"Temperature trop haute";; \
> if (Value("$radiateur") eq "on") \
> { \
> fhem "set $radiateur off";; \
> Log 1, "$radiateur off" \
> }\
> } \
> } \
> \
> if (Value($temperature) =~ m/.*:(.*)H/ ) \
> { \
> $current_temperature = $1;; \
> Log 1,"Valeur de la temperature: ${current_temperature}" \
> };; \
> \
> if ( ( !$we && $hour >= 6 && $hour < 9) || ( !$we && $hour >= 17 && $hour
> < 21) || ( $we && $hour >= 11 && $hour < 21) ) \
> { \
> animatetermal($current_temperature,$confortlow,$conforthigh);; \
> } \
> else \
> { \
> animatetermal($current_temperature,$survivelow,$survivehigh);; \
> } \
> }
By the way, I am french and I think it is sad that your solution is not so
much popular in the french community that builds custom domitiks solutions.
Best regards,
Antoine
--
To unsubscribe from this group, send email to
fhem-users+unsubscribe@googlegroups.com
Salut Antoine :)
Yes, there is a way, check
http://www.fhemwiki.de/wiki/99_myUtils_anlegen
If you store your code there, just leave out all those backslashes, double
colons etc.
Bonne soiree
Uli
--
To unsubscribe from this group, send email to
fhem-users+unsubscribe@googlegroups.com