Hauptmenü

off-in-timer ?

Begonnen von franc, 14 April 2015, 04:33:11

Vorheriges Thema - Nächstes Thema

franc

Hi,

I have a motion sensors in each room that turn the lights for some period of time. When I go in to a room it also sets timers to turn lights in other rooms off (it's not immediate in case I am moving between rooms).

I am wondering if their is a standard way of doing this as my solution is pretty messy

thanks

rudolfkoenig

#1
I have just added the defmod command, which may help.

define mdRoom1Ntfy notify motionDetect.* {
  my $room = AttrVal($NAME, "room", "");
  if(!data{mdRoom} || $data{mdRoom} ne $room) {
    fhem("defmod mdOff at +00:05 set room!=$room:FILTER=comment=mdSwitch:FILTER=STATE!=off off");
  }
  $data{mdRoom} = $room;
}


I assumed that all your motiondetectors are prefixed with motionDetect, that they have the same room attribute, as the corresponding switches, that all of your switches can be switched off with the off command, and that only the devices with the comment attribute containing mdSwitch should be affected.

Note that you have to add ;; and \ if changing the code directly in fhem.cfg

Caveat: you have to stay at least 5 minutes in the same room.

franc

thanks,

I'll read through your approach to understand it

cheers

franc


The defmod command is useful - thanks

However, Rre-reading my original email, I realised that I did not describe situation correctly.

The messy part of what I want to do is that I only want to modify the off timer if it would make the lights turn off sooner. If a light in one room was just about to turn off I don't want a new 'off timer' to come along and give it another 'N' minutes.

cheers