Rule machine - as per the app developer, this app is no longer available for new installs, distribution, or support

Hello, I think I’m being a bit boneheaded about creating rules to control lights that follow a virtual dimmer and was hoping for some guidance.

  1. I created a virtual dimmer using MichaelS’s code (thanks by the way Michael).
  2. I used Rule Machine to control the dimmer of my lights to follow the master virtual dimmer. This works great except the lights don’t turn off when the dimmer is set to 0% or the dimmer switch is toggled off. I wasn’t expecting this because when I use the dimmer for the light (OSRAM Lightify) it works that way.
  3. I created a second rule to turn the lights off if either of the following triggers fired: Virtual Dimmer level = 0% or Virtual Dimmer switch was turned off. This is great but they won’t turn back on if I just hit the switch (using smarttiles).
  4. Created a third rule to turn the lights on if the Virtual Dimmer switch was turned on.

So this works but I can’t help but feel I’m going about this the wrong way. Any advice? On another note, I can’t imagine how limited smartthings would be without Rule Machine. Really appreciate this community.

1 Like

For reasons that I don’t understand, there seem to be issues with OSRAM and perhaps LIFX lights and using a virtual dimmer to control them. I should look into this. It doesn’t make much sense because ordinary dimmers don’t exhibit these problems.

About dimming to 0 turning off the light, this could be something that some apps do, I don’t know. Rule Machine does not do anything special for 0. I don’t believe the device type for Dimmer Switch does anything special for 0. What the hardware does is yet another question. So I wouldn’t be relying on dim level to 0 to accomplish turning off a light.

Dimmer Switch allows a maximum dimmer level of 99; anything higher than 99 becomes 99.

I managed to get a rule setup that I can’t open to actually delete. I was looking at the different triggers and must have saved one with a missing parameter? How can I delete this rule without deleting everything and starting over? This happens each time I try to open it:

java.lang.NullPointerException: Cannot get property ‘value’ on null object @ line 514

In the IDE, go to My Locations / List SmartApps / Edit (upper right corner) / scroll to the rule and Uninstall.

1 Like

Am I mixing apples and oranges here, or triggers and rules? I set up tracking dimmers to a virtual dimmer but I can’t get the on/off to work. Do I have to create 2 more rules for on/off?

You don’t need the Conditions at all for this. Just the trigger and the actions for true. Also, you don’t need to turn on the lights, because dimming them with track dim turns them on.

I know changing the dimming level turns them on but I have no way of just switching the lights on or off via the virtual switch without changing the dim level. I had just the trigger and the tracking dimmers originally but I could never switch them on/or off, that’s what the bizarre rule was trying to do.
Edit - I put the ON trigger back in and removed the rule so I’m back to turning on and dimming properly. Just don’t see a way to turn off the lights without another rule.

Hi All

I want to use Rule Machine to turn my lights on and off based on a motion sensor with a 2 min delay after motion stops.

(I will be using the conditions but at a later stage).

However im not entirely sure how this will work.

Do I need two rules.

One to turn it one when motion detected
One to turn it of when motion stops?

if so what happens when motion stops and the 2 min timer starts and then motion is activated again.
Will it cancel the time to turn them off?

Many thanks.

One rule. More than one way to do it.

Condition: motion active
Rule: motion active
Action for true: lights on
Action for false: lights off after delay, cancellable

This keeps them on until x minutes after motion goes inactive, and remains inactive.

Version 1.7.2 Released

This supports new actions: select dimmer levels per mode, and run another rule’s actions.

See this post:

1 Like

bruce, I manually installed Rule Machine from code first time around. What do I have to do to update and not lose my configuration information? I believe I only have to copy in the new code, save then publish for both Rule and Rule Machine, but want to be sure to not lose current rules. Sorry as I know this must be covered somewhere, but not in your wiki or main post.

Thanks,

Dave

Updating as per the instructions will not invalidate your existing rules. For this latest update, you need to update both Rule Machine and Rule, in each case, save and publish.

Thanks as always. First time updating any smart apps so I just wanted to be sure now that I have most stuff working well.

@bravenel I needed Rule Machine again so I tried again to install with success this time.

I read your instructions and found the tip to install using github. I LOVE THAT ! I have been hating the github integration because I didn’t do it right. I forked the full SmartThings repo and added my code and added that to github. I should have created repos for all my projects, and added them individually including the SmartThings Fork (Without, my code added to it) I have been wondering why they had the ability to add repos. And now I get it !!! Thanks !!!

And of course THANKS for Rule Machine, it rocks !!!

2 Likes

@bravenel Thank you, didnt fully understand how the rules worked. that cleared it up

Thanks again.

Loved the new additions, especially the run rules actions, as i can use several backup rules (as per ST poor performance) more simpler.

Just so I understand. If I update from the repo do I still need to publish it after every update also?

I’m having a problem using the truth of one rule as a condition in two other rules. When the truth of Rule1 changes it evaluates differently in Rule2 and Rule3.
The original rule has a single condition (time of day) and no triggers or actions. No matter its truth, the conditions using it in the other rules always evaluate TRUE. Whether Rule1 is TRUE or FALSE, here’s what I see:
Rule 2: Rule truth of Rule1 true [TRUE]
Rule 3: Rule truth of Rule1 false [TRUE]
I have deleted and recreated all of them and it doesn’t change the result. Am I doing something wrong?

Thanks

Yes, always save and publish for an update. Most updates are only for Rule. Some, including the one last night, are for both Rule Machine and Rule.

1 Like

Please check the version number that shows in the bottom of Rule Machine main page. If it’s less than 1.7.2b that would explain the behavior. Let me know, and we’ll figure out what’s happening.