I recently bought two sensors to put in my bathroom and service room.
I installed the first sensor but unfortunately i'm having some issues with it.
The light turns on perfectly when I open the door but while i'm in the bathroom it isn't consistent staying on. Sometimes after a few seconds the light, while i'm still in the bathroom and moving. Also when the light goes off it is not always turning back on even if i'm moving directly in front of the sensor.
Does it sound familiar to someone who uses the sensor? Are there any ideas how I can solve this problem? Could it be something with the rule I wrote?
Side note that 45 seconds is a VERY aggressive turn off time frame.
I expect unless you are moving around constantly you will get MANY nuisance lights off events.
I'll just point out that you will spend (much) more on replacing bulbs from early failure due to excessive on/off cycles than you will for the electricity from extending the off time to something like 5 minutes. Just my $0.02.
Here is a slightly more complex bathroom dimmer rule I wrote quite a while ago (I wanted lights at 100% during the day, but when it's night time to just have them come on very dim).
In your rule, as soon as the motion sensor reports inactive, the 45 second count down starts and nothing stops it from turning off the lights - even continued motion in the bathroom doesn't stop it from turning off. By making the off action cancelable (and putting the "cancel delayed actions" in the "motion active" part of your if), it means that if motion is detected again, it cancels the "off". This could happen literally dozens of times while someone is going about their business in the bathroom and the lights will stay on while occupied. Then, when the person leaves, the motion sensor goes inactive and nothing cancels the delay, so the lights turn off.
Notwithstanding all of this, you should really take @JasonJoel's advice - 45 seconds is too short. I used 5 minutes in this rule for the main bathroom light and 30 minutes for the shower lights (this is a basement bathroom and the shower is a very large steam shower - if the lights were to go off while it was in use, it could actually be dangerous, so 30 minute delay).
You may notice a theme that RM is not the preferred place for motion lighting as there are other built in apps that handle it in a more "turn key" fashion. The rule I snipped for you is the only motion lighting rule that I have left in RM and that's just because I didn't feel like figuring out how to do the different actions depending on the time of day in those Apps (I'm sure it can be done, I just didn't bother since my rule was working fine).