From 05907acd66c20fc33812ab20165284f96a623ad0 Mon Sep 17 00:00:00 2001 From: jpawlowski Date: Wed, 29 Mar 2017 17:58:36 +0000 Subject: [PATCH] RESIDENTStk: improve wakeup macro template git-svn-id: https://svn.fhem.de/fhem/trunk/fhem@13844 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- FHEM/RESIDENTStk.pm | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/FHEM/RESIDENTStk.pm b/FHEM/RESIDENTStk.pm index 47583684c..f4add9926 100644 --- a/FHEM/RESIDENTStk.pm +++ b/FHEM/RESIDENTStk.pm @@ -215,12 +215,12 @@ if (\$EVTPART0 eq \"stop\") {\ # An additional notify for user state 'awoken' may take further actions\ # and change to state 'home' afterwards.\ if (\$EVTPART3) {\ - fhem \"define atTmp_9_\$NAME at +00:05:00 set \$EVTPART4:FILTERstate=asleep awoken\";;\ + fhem \"define atTmp_9_\$NAME at +00:05:00 set \$EVTPART4:FILTER=state=asleep awoken\";;\ \ # Without enforced wake-up, be jentle and just set user state to 'home' after some\ # additional long nap time\ } else {\ - fhem \"define atTmp_9_\$NAME at +01:30:00 set \$EVTPART4:FILTERstate=asleep home\";;\ + fhem \"define atTmp_9_\$NAME at +01:30:00 set \$EVTPART4:FILTER=state=asleep home\";;\ }\ }\ \ @@ -851,9 +851,9 @@ if (\$EVTPART0 eq \"stop\") {\ $nextWakeupDev = "none"; $nextWakeup = "OFF"; } - readingsBulkUpdate( $defs{$wakeupUserdevice}, + readingsBulkUpdateIfChanged( $defs{$wakeupUserdevice}, "nextWakeupDev", $nextWakeupDev ); - readingsBulkUpdate( $defs{$wakeupUserdevice}, + readingsBulkUpdateIfChanged( $defs{$wakeupUserdevice}, "nextWakeup", $nextWakeup ); readingsEndUpdate( $defs{$wakeupUserdevice}, 1 ); @@ -1195,9 +1195,10 @@ sub RESIDENTStk_wakeupRun($;$) { $nextWakeupDev = "none"; $nextWakeup = "OFF"; } - readingsBulkUpdate( $defs{$wakeupUserdevice}, + readingsBulkUpdateIfChanged( $defs{$wakeupUserdevice}, "nextWakeupDev", $nextWakeupDev ); - readingsBulkUpdate( $defs{$wakeupUserdevice}, "nextWakeup", $nextWakeup ); + readingsBulkUpdateIfChanged( $defs{$wakeupUserdevice}, + "nextWakeup", $nextWakeup ); readingsEndUpdate( $defs{$wakeupUserdevice}, 1 ); if ( $running && $wakeupOffset > 0 ) {