Why do rules stop working so often?

I think I've got a situation that I can document that has unexpected behavior, perhaps similar in nature to those above.

I have 2 motion sensors, 1 and 2, and 2 lights, controlled by 2 ML apps. The 1st app has Sensor 1 controlling Light A. The 2nd app has Sensor 2 controlling Light A and Light B.

These sensors and lights are on either side of a door. I want only 1 light on if sensed from 1 side of the door, but both lights on if sensed from the other side of the door. Frequently both sensors will be active at the same time as one passes through the doorway.

As of now, the rules don't work as expected. If I activate Sensor 1 Light A goes on as expected, If I then activate Sensor 2 after walking through the doorway, Light B does not come on. (Light A stays on, but due to the timing settings of the app controlling the first sensor).

If I look at the "on" variable of the Application State the ML app that uses the 2nd sensor to turn on both lights, I see the "on" state as true even if Sensor 2 has not been activated. If I had to guess, it's because the ML app is checking the state of any subscribed lights (or) instead of all (and) to determine the "on" variable state. Which is not what I would personally expect.

Having a light controlled by two Motion Lighting Apps is going to cause a lot of trouble. If motion sensor 2 detects motion but light A is on, light B will not be turned on. Or be turned off by the lack of motion by sensor 2.

The situation you described would be much better handled by Rule Machine than Motion Lighting.

A given light should only be controlled by a single instance of ML. So instance one controls light A, and it turns on from either motion sensor. Instance two controls light B, and turns on from Sensor 2 only. That should work for your use case, shouldn't it?

Descriptions of the options are also in the docs

https://docs.hubitat.com/index.php?title=Motion_Lighting_Apps

I think that does work! In my simple apps (and mind) I've thought about constructing rules having a single sensor control more than one light as opposed to having a single light controlled by more than one sensor. So thanks!

I didn't see any advice or documentation about not having lights in multiple ML instances and the behavior is not what I would have expected.

1 Like

Sorry but I have to give my opinion on this even being a rookie.
You are experienced users of HE and I trust you are having those issues but on my experience on this almost a year with HE I realize almost 99% of the problems are due wrong rules, problems with the network, devices or sensors failing, 3rd apps with bugs, etc.

When I face an issue with HE I contacted support or this forum and I got a solution and at the end was my fault, not HE.

One day many years ago when I was very young and I started to learn to programm (Turbo Pascal 4.0 :smiley: ) a smart guy told me: "...machines 99% of the times do not make mistakes, the errors are due your mistakes programming, debug carefully and you will see...".

So my first advise for you before post here behaviour like this ones is to try to contact support (they answer in 1 or 2 days), read a lot and then... just then blame on the hub.

Note: Sorry for my english... is not my mother tongue.

2 Likes

New guy here (my Hubitat Elevate just arrived today) and getting my reading in on the new platform. @aguileramekin, your Turbo Pascal 4.0 reference sure takes me back! :slight_smile:

1 Like

Guys, I learned to program with Ashton-Tate Framework II. No, in fact I learned hexadecimal on a book, waiting for my Commodore 64 to arrive in the store, a long long time ago :smiley:

1 Like

I started with basic, but quickly moved to doing almost everything in assembly on my c64. Ah, the days when I had TIME to program in assembly...

3 Likes

@pgitta I use a app call Zone Motion Controller and it been working steady now for a few years.