PIR issues

Hi all

Just a quick heads up about a PIR I’ve found that seems to be working really well, it’s also cheap, very small, has a tilt and turn facility too and its range is at least 20ft.

However, I do have a problem and was hoping someone might be able to help.

I have been banging my head over this for the last two weeks and just can’t make a rule that works how I’d like it to work.
All I need is it to be active between sunset/rise where it triggers so it can turn a lamp on.

Eric suggested a few things for me to try but unfortunately I couldn’t get it to work, I guess that may be my lack of experience. But I’d be so grateful if anyone has made a rule to do this you might be kind enough to post it as my head is on course to explode😮.

Thanks in advance. Alex

Link below to eBay. You may find it even cheaper , good luck.

Just a thought… Creating a rule with multiple criteria is sometimes not easy. When I first started I opined about not being able to input parenthesis in a rule to nest AND and OR conditions.

Don’t know if you tried this (I have not), but try creating a simple DateTime rule using only the DARK condition to turn a device ON. I would hope it turns the device ON around sunset. It may, or may not, turn the device OFF at sunrise, and may, or may not, monitor the light and keep turning it OFF again.

You may need to add a second rule to turn the device OFF when it’s LIGHT. In this case the condition is similar to SUNRISE and SUNSET.

If you want to include multiple conditions in your rule you can select AND or OR conditions using the pull-down. Mixing both AND or OR in a rule is not clear how it will be parsed.

Let us know how these test suggestions work in your environment…


I just read the DateTime addon README at this URL:

These 2 could be an issue:

  • The DARK condition is defined as a BOOLEAN, not an EVENT. This might mean it could be read in a rule but will not fire an event to initiate a rule

  • There is a BUG documented when creating a DARK rule. The rule must be created when it’s “not dark”. Go figure. See the bottom of the URL to read the issue…

Hi Eric,

Thanks for trying to help again, I really appreciate it.

The method you’ve mentioned sounds good and logical and I have to say I’ve tried a few options but not tried that so I shall certainly give it a go over the next few days.

And ok about the two extra points you mentioned, thanks for the prompt.

You know I just thought it would be easy to do and I thought it would be a common thing that people would want to use a sensor between certain times.

But at least this will keep me busy over the weekend. Thanks Eric, much appreciated. Alex

Hi Eric
Just a quick thanks for pointing me in the right direction, I think I’ve sorted it.
Well it seems to be ok over the last four days.

How I did it was with these rules, this is for the evening when I need it to turn on and off a light. Hopefully others may want to do the same and can use this too.

The rules are;
“If workshop Motion Sensor is not Motion and DateTime is Dark, turn workshop Lights off”
Then to turn it on
“If Workshop Motion Sensor is Motion and DateTime is Dark, turn workshop Lights on”

It stays on the length of time the PIR sensors no movement, in my case is 1 minute, then turns off

When it’s daytime I need it to stay off so used the following rule…

" If DateTime is not Dark and workshop Motion Sensor is not Motion, turn workshop Lights off.

If DateTime is not Dark and workshop Motion Sensor is Motion, turn workshop Lights off

As I mentioned, it’s only been going a few days, if it keeps working I’ve another place where I could use one!!

So Eric thanks for the idea and advice because being a novice it’s great to get help and support from others who have more experience.
Merry Christmas to you​:evergreen_tree::christmas_tree::santa:

It’s always a challenge to learn new stuff… After recent WT announcements and lack of current development/support, I installed a Home Assistant Supervised environment on my home Ubuntu server laptop and have been struggling to learn that system for a few months. It’s not easy. Keeps me technically active after my retirement and learning a possible HA replacement as WT becomes stale.

Q: what happens when you want the light on independent of the pir motion sense? Using a “flag” to indicate manual intent could help. Something to think about.

Hi, I LIKE your idea of the home assistant Eric, nice one indeed.

I’m not at that level yet, so maybe when or if I ever get there, it’s one certainly to consider. Glad you’ve found plenty to do in your retirement too👍.

As for the suggestion of turning my light on, overriding the PIR, I thought about that but as yet I’ve not spent time on it, but I’m sure I will as I think I could use that.
That said, I don’t think I explained properly but as long as the sensor picks up movement the light stays on.

But having an override would be very useful I think. A future project maybe.

Right off to the workshop, all been well it will still be working when I walk into it…

Cheers !

My thing is “Max2play”. It’s a media player, but it’s what it does and mainly what you can do with it. I’ve had it for about 8 years in different forms. If you’re into music, or just want a “easy” project, this is amazing and great support and documentation.