Logic help with 2 sensors 1 bulb

I had 2 motion & mode lighting app children which used to work but no longer do. I believe it stopped with 228 but I can't honestly be sure.
The rule I want to make uses a merging of the 2 app children. The rule is to turn on the light when I enter the room- and if there is motion in the shower, to override the settings.
a) Do I make two rules?
b) If a rule is active, will a 2nd rule kick in anyway?
c) How can I import a motion app child to a rule?
d) Can this be done without a rule and by using the motion app better/properly?

Here is a screen cap of the original motion app child:


and the second child app:
image

thanks for your time!

What I understand is that you want to cancel the off delay from the first rule and instead use the one from the 2nd when there is motion in the shower - is this correct?

It depends - it might be less complex to do it with two rules, but they may need to be in Rule Machine (RM) instead. And even then, maybe one rule would suffice. Iā€™ll see if I can come up with an example.

In RM, this can be done. I donā€™t know the Mode lighting app enough to confirm if it can be done in that oneā€¦

You would need to re-write it.

Update: Here is one option on how it could be done in RM (Virtual Motion Sensor 2 would be the one in the shower):

heya.
' ...cancel the off delay ...' - yes - pretty sure thats what I want!
' ... less complex with two rules ...' - nomenclature things when I speak of rules, I think of Rule Machine - but your message implied something else. I like to stay away from RM when possible - and use the simplified apps. I was expecting my desires could only be obtained via RM but if you've got other simpler options ... do Tell!
'rm, this can be done.' - I don't fully understand the precendence of RM - if I have two rules, which goes first? That's always stuck in my head. But with the Motion app - all I know is my rules aren't working the way they used to anymore... again - feel free to guide me.
... your example - Okay... I think I understand - I'll translate it to my devices and try to follow verbatim! wish me luck.
I've already gotten confused - the Shower sensor can not be triggered on it's own. You'd have to walk past the bath sensor - wouldn't that stop this Rule? (replacing VirtSens1 and VirtSens 2)

1 Like

Gave it a go - Finding the else-if gave me trouble and RM hung up - had to delete and start over but eventually I persevered!

however - it didn't function quite right as I'm basically back to the beginning - once I walked into the bathroom, the general lights came on but triggering the shower motion didn't have any affect.
I think I've already dropped out of the first leg of the If-else... do I read that right?

1 Like

The code looks right, so it should have. Can you confirm that the sensor is working (batteries are not depleted, etc.)?

You can also enable logging to see what is happening.

I stand corrected :slight_smile: Happy to say it is working. The difference in values of the CT and level I guess I couldn't see. (I rarely shower in the day, usually mornings so it would have been better visible.)
I changed the 'day' values of the rule to warm white and 50% level and once I created motion in the shower it changed. I will say it was about a 1-2 second delay, I thought at first it didn't work...

I'm thankful for your help! I learned a lot.
Shumo

1 Like

Happy to help! I also learned a lot with the help of the community and am always very happy to share this knowledge!

1 Like