Motion Lighting to Support Rules Machine Actions

I love the idea of Rule Machine enabling me to create actions that are specific to a device need. Example: Kitchen RGBw Lighting to be set a certain color when called

I would like to use Motion Lighting App to call my custom Rules Machine Action when it motion is detected. Is there any way to add this capability? If not can you add color bulb control?

I don’t really understand why you’d want to call RM from ML, but it may be possible. What would you envision, Action Per Mode?

Adding color bulb per mode probably does make sense.

Why not just turn on a virtual dimmer or a virtual bulb? Then just have the rule use that dimmer or bulb as the RM trigger or condition.

I’d like to be able to call a motion lighting rule from RM. specifically I’d like to be able to use a trigger to force an evaluation of motion Rule.

Just reverse what I suggested above. Create a RM trigger that turns on a virtual motion sensor.

@bravenel

To be honest I am hoping I could call any number of actions based of a motion trigger. Here is my scenario:

Kitchen has the following lights:

  • Kitchen Table using ZWave Dimmer Switch
  • Kitchen Island using ZWave Dimmer Switch
  • Kitchen Upper Cabinets using SmartLife RGBW H801 project usually in a color of cyan
  • Kitchen Lower Cabinets using SmartLife RGBW H801 project usually in a color of natural warm white

So overall (4) control devices in the kitchen. The issue is that I do not have color control in ML currently. After fooling around with RL I discovered I could create a standard color variance for my RGBW lights and might be able to change in one location while execute this rule from anywhere.

The scenario:

  • Motion Lighting triggers on certain modes (day, night, evening) and depending on LUX all (4) light scenes are controlled by a single ML action.
  • If mode "MovieTime" occurs then the Dimmer switches shut off and the two RGBw controllers go deep blue. Once MovieTime is over and there is new motion then ML would use the RL action rule(s) to reset the lights accordingly.

Personally if it is just easier to get hue/sat/level into ML I would be ok with that. Just a pain to change the default colors for the kitchen whenever the wifey wants a new color up above cabinets.

Appreciate any help on this. :slight_smile:

Is there some reason you don't just do this with Rule Machine?

I can't seem to get rule machine to perform the same way as ML. Doesn't trigger as expected. Probably due to over engineering the rule.

That makes no sense.

Condition: Motion active
Rule: Motion active
Action for true: Turn on some stuff (or run Actions)
Action for false: Turn off some stuff after a delay with cancel

For a rule to fire, it's truth has to change. If that's a problem, separate the on and off halves into two triggers:

Trigger event: Motion active
Action: Turn some stuff on

Trigger event: Motion inactive
Action: Turn some stuff off

@bravenel

So question between RL and ML. Does either run more effectively than the other in the sense of performance? The issue I had with WebCORE was the amount of pistons (~48) to run different scenes in my home. After about ~15 pistons running I noticed significant delays in custom automation.

I don't want to repeat that craziness again if there are potential limitations.

Thoughts?

BTW I have 51 of my 74 devices moved over to HE. Hence why the significant amount of questions suddenly from me.

Hope you don't mind me commenting but I had around 90 pistons running on ST. You name it I automated it. Probably a third were unnecessary. I just went mad.
When I moved over to HE I decided to rationalise but still use webCoRE.
Didn't work too well.
Went to SL, ML and RM and have 85 rules so far.
Everything is working fast with no issues. I keep my rules as simple as possible. For example I have 1 complex piston split into 5 separate RM rules and they work well.
Just need to think it through.
Personally I would stick to HE's native apps whenever you can and you should not have issues.
I now have:-
85 HE native rules.
5 pistons. I just cannot do these with HE apps. (the way I want them to work anyway).
3 custom apps doing things.
Have fun. :smile:

1 Like

ML is "technically" more efficient than RM (because it doesn't check restrictions and is smaller), but we're talking a few milliseconds at most. You can run as many rules as you want and you won't have any speed degradation. When a rule runs, there is not a lot of code that actually executes.

The most common mistakes people make with RM are over-complicating things, and not being aware of the rule truth change issue. As @bobbles says, keep things simple -- KISS

1 Like

Alright I will keep it simple and move to RM.

Next question about delay off. If a motion zone aggregate is set for 3 minutes before considered inactive and then the rule's delay begins for 2 minutes is that delay off cancelled if new motion begins or does the delay continue and then shuts off the lights?

Just seeing some weirdness with my KISS rules. In the kitchen I am using (2) Bosch Motion Sensors. So trying to figure out what I am missing. The kitchen lights keep turning off due to the appearance of no activity but there is activity.

See this discussion here. My aggregator never worked the way I needed it to in my bathroom. I ended up using RM to get to working the way I needed. Sounds like you have a similar issue.

How did you do it though? Could you share your RM logic for the lighting and motion control?

:smile: I've been through a few variations over time. I used RM but switched to @bangali excellent app, Room Manager. Over time that became way more than I needed....so I wrote my own smartApp (only so I could have the lights dim temporarily before shutting off). For simple motion lighting...RM is your best bet.

I will recreate it in RM sometime today and share.

Did you write your own version of Room Manager with lights dim incorporated? I would be interested in that code as I have used @bangali app on ST. Wasn't sure how well it worked on HE as of yet. I may have to switch over sooner than later.

Q bout Rooms - are you using the adjacent room settings or just each room independent of the other?

Each room independent...and no my app is Nooooo way near as awesome as Room Manager. One of the main reasons I used It was simply to give me a visual indicator that the lights were about to shut off by dimming and an easy way to disable the entire automation. I never really needed the extra stuff...which is why I wrote a very simple app that did those 2 things for me easily.

This is what I used in RM:

Note: In the Actions for False depicted above, there is an action available called

Turn on or off these switches after a delay, pending cancellation (default is OFF)

This is the normal way to accomplish turning lights off in a motion lighting context, as opposed to the way shown above, although both accomplish the same thing.

How this works: When motion is activated, the rule becomes true and the lights are turned on. When motion becomes inactive, the rule becomes false and the delayed-off timer starts and the lights stay on. If during that period motion is activated again, the rule truth changes from false to true, and the timer is cancelled. When motion becomes inactive again, the rule becomes false again, and the timer starts. This cycle will continue with the lights still on until there has been no motion for the entire period of the delay, at which point the light is turned off.

Also, please note, this very same rule could be done with Simple Lighting, or with Motion Lighting.