Originally posted by: <email address deleted>
Hi,
I'm using a cron job and with a script to simualte and oregon device
to set the PID
The script contains
#!/bin/sh
datum=$(date +%Y-%m-%d)
tijd=$(date +%H:%M:%S)
temp=$(/usr/bin/fhem.pl localhost:7072 "l Slaapkamertempje" | grep T:
| cut -d " " -f11)
/usr/bin/fhem.pl localhost:7072 'trigger tempslaap ; {\
$defs{tempslaap}{STATE}="T: '$temp' H: 0";;\
$defs{tempslaap}{READINGS}{temperature}{VAL}="'$temp'";;\
$defs{tempslaap}{READINGS}{temperature}{TIME}="'$datum' '$tijd'"}'
While running the script it works
fhem> l tempslaap
Internals:
CODE THGR228N_00
DEF THGR228N_00
IODev RFXCOM
NAME tempslaap
NR 23
STATE T: 16.8 H: 0
TYPE OREGON
Readings:
2011-10-19 19:40:02 temperature 16.8
Attributes:
fm_order 22
When settig the PID with an desired temp it works
fhem> set thermostaat_slaapkamer desired 18
fhem> l thermostaat_slaapkamer
Internals:
DEF tempslaap:temperature:([\d\.]*) thermostaat_slaap
NAME thermostaat_slaapkamer
NR 45
STATE 16.8 (delta 1.2)
TYPE PID
actor thermostaat_slaap
command valve
dFactor 5.88235294117647
iFactor 3.05882352941176
pFactor 25.4901960784314
reading temperature
regexp ([\d\.]*)
satMax 100
satMin 0
sensor tempslaap
Readings:
2011-10-19 19:45:54 actuation 37.9294117647059
2011-10-19 19:45:54 delta 1.2
2011-10-19 19:45:54 desired 18
2011-10-19 19:45:54 integrator 7.34117647058823
Attributes:
room Slaapkamer
But the script runs every 5 minutes, but the PID doesn't update. the
tempslaap went to 16.9 but not the state of the pid. Is this beacuse
trigger is not enough???
If I do set thermostaat_slaapkamer desired 18
it reads then tempslaap again.
any ideoa howto solve this?
regards Richard
--
To unsubscribe from this group, send email to
fhem-users+unsubscribe@googlegroups.com
> /usr/bin/fhem.pl localhost:7072 'trigger tempslaap ; {\
> $defs{tempslaap}{STATE}="T: '$temp' H: 0";;\
> $defs{tempslaap}{READINGS}{temperature}{VAL}="'$temp'";;\
> $defs{tempslaap}{READINGS}{temperature}{TIME}="'$datum' '$tijd'"}'
This is most certainly not what you want. As you are generating an event for
the devices tempslaap WITHOUT any arguments, the PID is not reacting to it.
Setting some internal fhem variables AFTER the trigger is quite useless.
I propose:
trigger tempslaap:$temp;; setstate tempslaap T: $temp H: 0
The second command is only cosmetic, in case you'd like to see the current value
in tempslaap too and not only in the PID.
--
To unsubscribe from this group, send email to
fhem-users+unsubscribe@googlegroups.com
Originally posted by: <email address deleted>
Rudolf,
You mean like this
#!/bin/sh
datum=$(date +%Y-%m-%d)
tijd=$(date +%H:%M:%S)
temp=$(/usr/bin/fhem.pl localhost:7072 "l Slaapkamertempje" | grep T:
| cut -d " " -f11)
/usr/bin/fhem.pl localhost:7072 'trigger tempslaap:'$temp';; setstate
tempslaap T: '$temp' H: 0'
i get error
Please define tempslaap:17.2; first
And I have this in the config in fhem.cfg
define tempslaap OREGON THGT228N_00
define thermostaat_slaapkamer PID tempslaap:temperature:([\d\.]*)
thermostaat_slaap
what goes wrong???
On Oct 20, 8:45 am, Rudolf Koenig wrote:
> > /usr/bin/fhem.pl localhost:7072 'trigger tempslaap ; {\
> > $defs{tempslaap}{STATE}="T: '$temp' H: 0";;\
> > $defs{tempslaap}{READINGS}{temperature}{VAL}="'$temp'";;\
> > $defs{tempslaap}{READINGS}{temperature}{TIME}="'$datum' '$tijd'"}'
>
> This is most certainly not what you want. As you are generating an event for
> the devices tempslaap WITHOUT any arguments, the PID is not reacting to it.
> Setting some internal fhem variables AFTER the trigger is quite useless.
>
> I propose:
> trigger tempslaap:$temp;; setstate tempslaap T: $temp H: 0
>
> The second command is only cosmetic, in case you'd like to see the current value
> in tempslaap too and not only in the PID.
--
To unsubscribe from this group, send email to
fhem-users+unsubscribe@googlegroups.com
> what goes wrong???
Please read http://fhem.de/commandref.html#trigger carefully:
trigger
->
/usr/bin/fhem.pl localhost:7072 "trigger tempslaap $temp"
--
To unsubscribe from this group, send email to
fhem-users+unsubscribe@googlegroups.com
Originally posted by: <email address deleted>
Rudolf
Ok I get it but PID doesn't respond also, the pid stays wrong?
fhem> trigger tempslaap 17
fhem> l tempslaap
Internals:
CODE THGT228N_00
DEF THGT228N_00
IODev RFXCOM
NAME tempslaap
NR 23
STATE T: 17
TIME 2011-10-20 17:00:02
TYPE OREGON
Readings:
2011-10-20 17:00:02 temperature 17.2
Attributes:
fm_order 22
fhem> l thermostaat_slaapkamer
Internals:
DEF tempslaap:temperature:([\d\.]*) thermostaat_slaap
NAME thermostaat_slaapkamer
NR 46
STATE 17.4 (delta -1.4)
TYPE PID
actor thermostaat_slaap
command valve
dFactor 5.88235294117647
iFactor 3.05882352941176
pFactor 25.4901960784314
reading temperature
regexp ([\d\.]*)
satMax 100
satMin 0
sensor tempslaap
Readings:
2011-10-19 22:37:20 actuation 0
2011-10-19 22:37:20 delta -1.4
2011-10-19 22:37:20 desired 16
2011-10-19 22:37:20 integrator 0
Attributes:
room Slaapkamer
On Oct 20, 5:37 pm, Rudolf Koenig wrote:
> > what goes wrong???
>
> Please readhttp://fhem.de/commandref.html#triggercarefully:
>
> trigger
>
> ->
> /usr/bin/fhem.pl localhost:7072 "trigger tempslaap $temp"
--
To unsubscribe from this group, send email to
fhem-users+unsubscribe@googlegroups.com
Originally posted by: <email address deleted>
Rudolf
I got the issue
trigger tempslaap temperature 17
than it works.
On Oct 20, 7:18 pm, kroonen wrote:
> Rudolf
>
> Ok I get it but PID doesn't respond also, the pid stays wrong?
>
> fhem> trigger tempslaap 17
> fhem> l tempslaap
> Internals:
> CODE THGT228N_00
> DEF THGT228N_00
> IODev RFXCOM
> NAME tempslaap
> NR 23
> STATE T: 17
> TIME 2011-10-20 17:00:02
> TYPE OREGON
> Readings:
> 2011-10-20 17:00:02 temperature 17.2
> Attributes:
> fm_order 22
>
> fhem> l thermostaat_slaapkamer
> Internals:
> DEF tempslaap:temperature:([\d\.]*) thermostaat_slaap
> NAME thermostaat_slaapkamer
> NR 46
> STATE 17.4 (delta -1.4)
> TYPE PID
> actor thermostaat_slaap
> command valve
> dFactor 5.88235294117647
> iFactor 3.05882352941176
> pFactor 25.4901960784314
> reading temperature
> regexp ([\d\.]*)
> satMax 100
> satMin 0
> sensor tempslaap
> Readings:
> 2011-10-19 22:37:20 actuation 0
> 2011-10-19 22:37:20 delta -1.4
> 2011-10-19 22:37:20 desired 16
> 2011-10-19 22:37:20 integrator 0
> Attributes:
> room Slaapkamer
>
> On Oct 20, 5:37 pm, Rudolf Koenig wrote:
>
>
>
>
>
>
>
> > > what goes wrong???
>
> > Please readhttp://fhem.de/commandref.html#triggercarefully:
>
> > trigger
>
> > ->
> > /usr/bin/fhem.pl localhost:7072 "trigger tempslaap $temp"
--
To unsubscribe from this group, send email to
fhem-users+unsubscribe@googlegroups.com