Setting the value of a dummy device to the value of another dummy device

Begonnen von Guest, 03 Mai 2012, 10:45:20

Vorheriges Thema - Nächstes Thema

Guest

Originally posted by: <email address deleted>

Hi all,

I'm trying to control my ventilation (3 levels) by means of 2 input
parameters:

1) The humidity level in the bathroom
2) Time based

In order to do so, I defined a dummy called "Timeventilation".
"Timeventilation" is controlled by "at" definitions. So I have a dummy
device which tells me the ventilation level (1-3) depending on the
time of day.

A humidity-check is executed every 5 minutes ("at" Humiditycheck). So
what I would like to do is check every 5 minutes and set the
ventilation to level "3" in case the humidity exceeds a threshold (70
in this case), in case the humidity is below the threshold I would
like to set the ventilation to the value of the "Timeventilation" -->
in the example below indicated with @@@

The humidity is checked by a "Notify": HumidityCheck { my $a =
ReadingsVal("RTGR328N_67","humidity",101);; if ($a gt "70") { fhem
"set Ventilation 3" } else { fhem "set Ventilation @@@" } }

Question: How can I set "Ventilation" to the value of the other
"dummy" device (=Timeventilation), indicated by @@@?

***********************************
Just for all of you to understand the full solution; setting
"Ventilation" to a specific value triggers a "notify" definition that
switches two IT switches in order to control the fan-unit (off-off, on-
off and off-on). So I have defined a notify for each level (1,2,3) and
added the attribute WebCmd (1:2:3) to "Ventilation", so it can be
controlled from the web-interface also. If I put a fixed value in @@@
(e.g. "1"), the solution works fine but without time scheduled
ventilation of course.

Thanks for your help,

Eeg.

--
To unsubscribe from this group, send email to
fhem-users+unsubscribe@googlegroups.com

Guest

Originally posted by: <email address deleted>

Am Donnerstag, 3. Mai 2012 10:45:20 UTC+2 schrieb Superbert:
>
> Question: How can I set "Ventilation" to the value of the other
> "dummy" device (=Timeventilation), indicated by @@@?
>
 
HumidityCheck { my $a =
ReadingsVal("RTGR328N_67","humidity",101);; if ($a gt "70") { fhem
"set Ventilation 3" } else { fhem "set Ventilation *$a*" } }
or
 
{ fhem "set Ventilation Value('OtherDummy')" }
 
Hope I got your requirement right?
 
Cheers, Uli

--
To unsubscribe from this group, send email to
fhem-users+unsubscribe@googlegroups.com

Guest

Originally posted by: <email address deleted>

Hi Uli,

I think the second proposed solution is what I'm looking for;
Value(Timeventilation). The dummy device "Timeventilation" hold the
ventilation-level depending on the time of day (e.g. "1" at night, "2"
during the day and "3" from 17.00 - 18.00 / during cooking).

Your first proposal copies the value of $a into "Ventilation", so that
would set the "Ventilation" to the humidity level that was read. So
the format for copying the value of a variable would be: *$a* (I
didn't know that, so thanks!)

For your understanding: The ventilator is actually a 3 speed solution
(1, 2, 3) and is controlled by 3 mains lines (1 is connected
continuesly to 220V, the second and third lines are for setting the
speed to either 2 or 3).

I will actually extend the ventilation solution also with a manual
control (to put the Ventilation for example to level 3 for a
predetermined time).

Thanks for you help (I will try this evening if I can get it to work),

Eeg.


On 3 mei, 11:16, UliM wrote:
> Am Donnerstag, 3. Mai 2012 10:45:20 UTC+2 schrieb Superbert:
>
>
>
> > Question: How can I set "Ventilation" to the value of the other
> > "dummy" device (=Timeventilation), indicated by @@@?
>
> HumidityCheck { my $a =
> ReadingsVal("RTGR328N_67","humidity",101);; if ($a gt "70") { fhem
> "set Ventilation 3" } else { fhem "set Ventilation *$a*" } }
> or
>
> { fhem "set Ventilation Value('OtherDummy')" }
>
> Hope I got your requirement right?
>
> Cheers, Uli

--
To unsubscribe from this group, send email to
fhem-users+unsubscribe@googlegroups.com

Guest

Originally posted by: <email address deleted>

Am Donnerstag, 3. Mai 2012 14:53:58 UTC+2 schrieb Superbert:
>
> So the format for copying the value of a variable would be: *$a*

 
Nope, just $a
Maybe the asterisks are a display problem, I formatted the $a bold.  So
handing over the content of a variable looks like
{ fhem "set Ventilation $a**" }

=8-)

--
To unsubscribe from this group, send email to
fhem-users+unsubscribe@googlegroups.com