Struggling with a motion lighting app

Hi everyone!

Very new to HE so apologies for the probably stupid question about something as simple as a motion lighting app.

What I'm trying to achieve is: if the bedroom motion sensor is activated during night mode turn the bedroom lamp on for 2min BUT if it is activated during sleep mode (ie we've gotten up for a midnight toilet break) turn the corridor lights on red at 30% for 2mins.

I've managed to get this to work, EXCEPT that whenever I add in the bit that controls the corridor lights, no matter what I seem to do, those lights turn off after 2mins of inactivity from the bedroom motion sensor. This means my corridor goes dark all the time -> not ideal. I've turned on 'don't turn off if already on' to try and get around this but they still turn off!

What am I missing?

Thanks for your ideas in advance!

What it sounds like is happening is exactly as described in the rule. When the bedroom motion sensor goes inactive, it turns off the corridor light as expected. If I remember correctly, "Don't turn off if already on" just prevents the light from turning off if it was turned on manually; Not by the motion rule itself.

A better way to do this would be with a RM4 rule:

IF ((BR) motion sensor is active) THEN
    Cancel Delayed Actions
    Dimmers per mode: (BR) Lamp
        Entertaining: 100
        Night: 100
    Color per mode: (LNG) Couch strip 1, (LNG) Couch strip 2
        Sleep: Red, level: 30
ELSE
    Off: (BR) Lamp --> delayed: 00:02:00 (cancel)
    Off: (LNG) Couch strip 1, (LNG) Couch strip 2 --> delayed: 0:04:00 (cancel)
END-IF

Another idea is to get an additional motion sensor for your corridor and use that for your corridor lighting (which is what I do). That way, you have a rule controlling your bedroom light and another controlling your corridor.

Thanks so much for your quick reply! Much appreciated! :smiley:

This is the bit I'm confused by, I can't figure out why it's turning the lights off even when I've turned them on manually, or via a separate rule. From my reading of the app logic, if they lights were already on, the rule shouldn't turn them off, but alas it seems to be.

Thanks so much for the RM4 rule, I will give it a shot! :smiley:

1 Like

Yeah, it's one of the many reasons I don't use Motion Lighting for anything beyond the most simple of rules. I've had many cases where I can lay out the exact same logic in a RM rule and a ML rule and get two different results.

once the light is linked to the motion sensor its linked both for the ON and OFF so you then need to tell the app to ignore the OFFs in modes X and Y (or indeed ignore the ON's for modes X and Y).

The issue is if you disable the OFF in mode X that would also disable it for the other light. So in this case you because you want them to work completely differently you need to split them into two apps.
Both using the same motion sensor but one for corridor light to only turn on and off in night sleep mode and you normal bedroom light. I currently do this for my kitchen roof lights from my dining room because i don't have sensor in there yet. So that rule has a longer time out and different settings across the modes

i have some very complex motion lighting rules and RM rule that work together perfectly. You just need to understand how the app is working then it will click. I love motion lighting It's a very powerful app :smile:

1 Like

Oh yeah, don't get me wrong, I like the ML app, but I think my brain is wired better for RM rules. Especially with RM4, I find it's just easier for me to understand what's going on in a rule than in a ML app.

1 Like