SmartThings Community

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


(Bruce) #13

It would throw that error if you didn’t define any Conditions, which you couldn’t do if you didn’t have the fields to input conditions into. :confused:

If you can’t get past the Number of Conditions input, my suggestion would be to uninstall that instance of the app, and try again. If that still fails, then we need to understand why Android can’t process submitOnChange properly.

@slagle, have you seen this before? This being Android mobile app not handling submitOnChange: true?


(Bobby) #14

Yup, did it several times. It gets even worse if you try to modify the number of conditions. I tried to change from 2 to 3 and the app got stuck running circles. The only way to delete it was to go in IDE…


(Bruce) #15

So, it would appear that this doesn’t work at all on Android? Very odd, and disappointing. The app is totally dependent on submitOnChange: true working, because everything it does is dynamically built, especially the rule itself. The app uses recursion both to build the rule and to evaluate it.


(Bobby) #16

No, no, it works! But not as smooth, so people may assume it doesn’t, if they are greeted with errors :slight_smile:


(Bruce) #17

Did you get the input fields for the Conditions?


#18

Very nice!

Just in case anyone stumbles on this and hasn’t used custom code in SmartThings before, here’s the FAQ for how you go about installing something like this to your own account:

FAQ: An Overview of Using Custom Code in SmartThings


(Tim Slagle) #19

Submit on change should work on android. This would be new if it doesn’t


(Guy Martin) #20

I’m seeing this behavior on Android as well, but it can be worked around by deleting/recreating the rules. Sub-optimal, but doable at this point.

Great stuff @bravenel! Now, my only other feature request would be ‘timer conditions’, so that I could replace some of the Smart Lighting app conditions for ‘wait x minutes after motion stops’ before firing the lights off rule.

Thanks for doing this app - it get’s closer to what I want to do with my system, and seems to be more stable in execution than some of the stock apps right now. :slight_smile:


(Bruce) #21

I can’t see how that could work.


(Guy Martin) #22

Hrm… maybe not… I was thinking something like ‘motion stopped AND timer >= x min’


#23

This is great! I have a case where if I have a switch turned on, I want to turn it off again within a few seconds. I’m working on a project where I use a push solenoid to physically press the power button on my Mac Mini as part of my media center. It’s an electronic power switch so I can’t automate it with the usual on/off power cycle. When I tell Alexa to turn on my TV, she does so but I still have to get up and power on my Mac Mini (I know I can keep it in sleep mode and press another button or keyboard to wake it but I want to keep it off). Currently, I’m using IFTTT to turn off power to the solenoid after a switch has been turned on but it can be unreliable. When I try to set up a rule to turn off, I’m not able to because there is only a “Switches to turn off when false” option. I think I need a “Switches to turn off when true” option as well or maybe I can “Run a routine when true” option…hmm…I think I just answered my own question. I’m going to try that.

Update: OK, that works! Thanks again for your hard work, your app solved my problem brilliantly. :slight_smile:


(Bruce) #24

The problem is by whom and when the timer is started. The timer would have to be within Rule Machine for it to see it. But, when would it start? Rule Machine runs continuously, looking for events that affect conditions. But, a timer is a one time thing, started by something, and then triggering something when it’s done. It just doesn’t make sense as a Condition.


(Mike Maxwell) #25

UPDATE: 2015-11-12
@bravenel has updated his app to parent child, I will be deleting the temp repo I created a few days ago.
Please use Bruces repo.


(The fish is still dead.) #26

You don’t need to publish the child, just save it. That way you only see the one you want to install in the list.


(Mike Maxwell) #27

they must have fixed that, it didn’t work that way when parent/child info was first released…


(Guy Martin) #28

Ah, ok… didn’t dive into the code too deeply - you’re polling regularly… yeah, I can’t see how it would work either…

Thanks for your work though Bruce - this is already turning out to be quite handy.


(Bruce) #29

Actually, it doesn’t poll at all. It simply subscribes to every event that could affect the state of the conditions.


#30

FTW!

:heart_eyes::heart_eyes::heart_eyes::heart_eyes::heart_eyes::heart_eyes::heart_eyes::heart_eyes::heart_eyes::heart_eyes::heart_eyes::heart_eyes::heart_eyes::heart_eyes::heart_eyes::heart_eyes::heart_eyes::heart_eyes::heart_eyes::heart_eyes:


(Colin) #31

Interested to see examples of use cases for this :slight_smile:


(Mike Maxwell) #32

lets see, turn the bathroom fan on if there’s motion and humidity is above xyz %
turn the lights on if there’s motion, but only if lux is below xxx and there are people home.
Think of it this way, currently there’s no simple way of taking multiple inputs with different values and then triggering something else based on standard logic.
I get that Boolean logic isn’t for everyone, but this fits the bill for complex automations where you may have been forced to create modes to deal with them, or just couldn’t do it all…