Help with Lighting Rule

I am trying to setup the lights to go on when lux is low between certain times and when motion is detected BUT also when the power plug is above 10(watching TV) the lights will dim to 50% and obviously won't turn off. I have been fiddling around with this but I am not sure if this will work. Can you guys have a look and give me some feedback please:

So, to summarize your requirements:
TV on, lights to 50% and don't turn off by motion.
Lux below level X turn lights on by motion
Lux below level x turn lights off by inactive motion after timeout of 5 minutes
Would that summarize what you are trying to do?

If so, then I would break this up into two rules. The first dealing with the power meter. In that rule I would turn the lights on and also set a global variable indicating that motion should not affect the lights.

In the second rule, I would have an overarching condition of the lux being low and the Global Variable set up in the first rule. Then you would just need a normal motion rule.

OMG! I just wrote this rule for a couple of rooms. It's slightly varied from your needs, but I'm confident you can adapt. I'll post them all for you.

I have two rules for the light and the living room to work together.
This is for the light in my upstairs living room.



The Upstairs Living room

Basement is a bit more simple

Wow! Those look complicated! But I am trying to learn RM 4 so it really helps to look at different rules to see how things work. I will try to incorporate into my rule.

Feels complicated, but they're categorized. Break them down. Look at each piece. That's what I did when I built them. Don't be afraid to ask if you need me to explain anything about these rules.