Hauptmenü

notify state

Begonnen von fatman, 26 Januar 2017, 23:07:00

Vorheriges Thema - Nächstes Thema

fatman

Hi,
I do not understand what is a state of notify device. I have the following notify device:
define NOTIFY_TEMP_EXT notify MYSENSOR_BALKON:temperature|MYSENSOR_OKNO:temperature
{
no warnings 'redefine';;
#use List::Util qw[min max];;
sub my_max ($$) { $_[$_[0] < $_[1]] }
sub my_min ($$) { $_[$_[0] > $_[1]] }
my $t_balkon = ReadingsVal("MYSENSOR_BALKON", "temperature", 128);;
my $t_okno   = ReadingsVal("MYSENSOR_OKNO", "temperature", 128);;
my $t_min = my_min ($t_balkon, $t_okno);;
my $t_max = my_max ($t_balkon, $t_okno);;
fhem ("setreading $SELF temperature_min $t_min");;
fhem ("setreading $SELF temperature_max $t_max");;
fhem ("setstate $SELF $t_min");; ### lets try to enforce my state
$t_min;;
}

and it has:
Internal STATE 2017-01-26 22:49:04
reading state active 2017-01-26 21:10:29

even if I set state to measured value (fhem ("setstate $SELF $t_min")).
I am confused... how to set the state (value visible in room view) to measured value? stateFormat is unfortunately not supported by notify device.
Thanks HB

rudolfkoenig

Use MYSENSOR_BALKON (whatever this is) or a dummy to set radings/stateFormat/etc, not the notify.