In need of programing

Hi guys Iv kinda moved on from setup to programming. I do have a extensive knowledge with programs and rules with the isy, however a bit lost at moment on how to create a somewhat rule. I didnt see option in simple rules to create this. Maybe I need rules machine.
If kitchen motion is active
and it is 60 min before sunset
or it is60 min after sunrise
then turn kitchen light on
wait until motion is inactive for 4 min
then turn kitchen light off
Now this is simple but with drop downs seems I cant get this rule to work. Do I need a different app, thus far iv used simple rules to play around and seem to work, maybe there is a different app that is easy to use. Or may someone point out how to do this so I can build from it seeing Ihave to make the same rule for 6 motion sensors. Thanks

Just to clarify, you only want the light on when it's daylight? Or did you just type that up the wrong way around? Oh - you want the light on if it's after 60 mins before sunset or before 60 mins after sunrise?

If you're already familiar with the logic of programming, I'd recommend you go straight to Rule Machine.

Just thinking quickly I'd put the times between as the Required Expression and have the motion as the Trigger, then obviously Action = turn on light - and then wait till inactive for however long and turn off

Yeah definitely do it in Rule Machine, it will be easier to get what you want I think

Please explain this logic a little more fully, so we can understand exactly what you want. My best guess is that you'd like for the light to come on Between the times of Sunset-60m and Sunrise+60m. Is that correct?

I would highly recommend the new Room Lighting app as it is purpose built for this.

Give me 5 mins I will post an example with motion and limited by time.



@robandchristy1 - If you really want to do this in Rule Machine, here is an example I created that should handle this scenario.

There are many other Apps, such as Room Lighting mentioned by @jtp10181 above, that are actually simpler to use than Rule Machine in this case. But, if you are curious about RM, I thought I'd provide an example.


I've not got along with it at all. Odd.

1 Like

Since all of my automations are already working in Simple Automation Rules, Motion Lighting, Rule Machine, and Advanced Button Controller (community) - I have not really had any need to try the new Room Lighting App. :wink:


Thats basically how mine all was as well but I like toying with new things to see if they are better. In the process I beta tested the heck out of it, and figured out how to use it. Moved all my stuff over and got rid of SAR and the ML apps. Got rid of a bunch of Button Controllers also, that got merged into new RL apps. I really like the grid interface at the top with the lights and current states. Happy with how it came out and in the end works the same (in some cases I was able to make it better). Also easier to make changes and maintain this way.


I did give it a try - I tend to feel as a beta tester I owe it to the project to at least give all the new features a run-through. I think probably it was that apart from nocturnal prowler situation, we actually just turn the lights on and off manually and by voice so it probably gave the impression of being overcomplex.

Maybe it condense but every thread I start seems to shed a lot more light and discussions. Im kinda simple wanting programs if this activate that or dont but this should go on. Im dipping into what I would consider basic rules. Coming from isy this is confusing because so many app do different things, rather then having 1 app with a certain flow. I get its nice for power users that know 100x more then I do. But it should be straight forward for the average day user which I think is primary market. With special apps for power users. So my program is simple I think? My downstairs hallway gets enough light but not at sunrise so id like the motion sensor if activated turn on downstairs hallway lights 60min prior to sunrise BUT stay off rest of the day until 60 min after sunset. Which is when lighting conditions get low. So again my logic is
if downstairs motion is active
and if time is 60 min before sunrise or 60 min after sunset
turn downstairs hallway light on
wait until motion sensor has 2 min of inactivity (i know about the 4 min default)
then turn downstair light off
Have several motion sensors that need this program because at moment they turn on every 4 min if activated, I want to limit this to a 1 after sunset and a hour before sunrise. Basically a night sensor. I did nt find anything in simple rules and have not played with advanced rules yet. If it aint broke dont fix it. Thanks for comments

I'd suggest you do Ogiewon's example in Rule Machine and then stick to Rule Machine for everything else you want to do. It covers everything, and then you only have to learn one Hubitat tool. All the other types of rule maker have more limited or specific scope. You know - until you feel inspired to explore the others that is :slight_smile:

1 Like

ill watch videos to run that, but seems unnecessary if hubitat can combine all these apps or hire the developers to make 1 top notch product. 1 ui to cover all. Iv had people show me apps never knew exited, so much talent out there. Im floored so many people doing things on their own time and also helping out on forums! Hubitat should hire these people, come up with one app and charge 3.99 or up the price of the hubitat. This is a way better community then isy but iys way more difficult. They should look at how isy is structured and build off of that.

Install Hubitat Package Manager and things should be much easier for you

Have had it from start.

1 Like

[quote="robandchristy1, post:10, topic:96646"]
because at moment they turn on every 4 min if activated, I want to limit this to a 1 after sunset and a hour before sunrise. Basically a night sensor. I did nt find anything in simple rules and have not played with advanced rules yet. If it aint broke dont fix it. Thanks for comments

Sorry im beat with 110 deg weather so no going to say much besides it confusing to use which app to do what. I played around a bit and discovered simple rules. Why have basic rules or simple rules or rules, or room lighting. Why not combine it into 1 app simply if you have a light on turn it off, or expand the app to turn on at certain times or give a option to do it at certain times and run different scenes. This is my struggle with isy it was one app that did a 4 or 6 apps. You didnt have to learn anything besides basic rules yet you could make complex rules with same app. On a side note to tired to remember but the suggestion of z-bee motion sensors. I set one up to test and it is spot on! .3 seconds of lag. Which is soooooo acceptable. Ill set up another one tomorrow maybe 2. Not sure why a zig-bee sensor acts so much faster then a complete z-wave mesh? I only have 2 zig-bee devices connected and yes they are fast! To end my night Im happy my journey has brought a lot of people out of the wood work to discuss issues, Problem solve issues and teach people who thought they understood. Seems no 1 person FULLY understands z-wave and people are being corrected or educated by my post. I will continue to comment as I progress and mostly understand the hubitat. I think my post edacities us more with all the responses and will help making better setup up videos and guides. Thanks again community

There is one rule app to rule them all. It is called Rule Machine. The other apps are simplified rule apps that were created because RM is overkill for many situations. If you only want to deal with one app, that would be RM. If you want to make things easier for yourself, you should look into some of the other apps. The new Room Lighting app makes it much easier to create lighting for rooms. This basically replaces several other apps that you can probably now ignore (Motion and Mode Lighting, and Groups and Scenes, for instance.) Basic Rules replaced Simple Automation Rules, so you can probably ignore SAR. I mostly use RM, Basic Rules, and Room Lighting. I still have some rules in some of the "older" apps that I haven't converted, as they still work fine.


Partly because of history, but mostly because purpose-built apps like Room Lighting are generally easier to use than all-purpose apps like Rule Machine. As suggested above, if you're comfortable with Rule Machine, that is by far the most versatile app in the box, so feel free to use it for whatever you want. But lots of the other, smaller apps are easier to configure and leave less room to make mistakes, and lots of people prefer them for various reasons.

This ties into the "history" part. :slight_smile: (But it's still true that different apps targeted towards specific purposes are generally easier to set up.) Room Lighting was just added in the latest platform update, and it includes features formerly found in Motion Lighting and Groups and Scenes, plus a lot more, and is the most versatile built-in lighting app. But, again, it can be a bit complicated to set up. Motion Lighting may be a bit easier for only moderately complicated setups, but even Basic Rule can can handle simple on/off things.

Keep in mind that not everyone wants the same thing out of an automation, and Hubitat can't read your mind. You said "if you have alight on, turn it off." But turn it off when? After a certain time? In response to no motion? The hub can do either of these, plus a lot more, but you have to know what you want and, in turn, what to tell the hub. (The purpose-built apps, again, make this a bit easier in that you don't have to think through as many of the details as you would with, say, Rule Machine.)

So, again, Rule Machine may be what you want--but keep in mind that Hubitat lets you import Basic Rules or Simple Automation Rules into Rule Machine, so you can start with the simpler app and move towards the more complex one if you end up needing to, all without having to totally re-create your automation. (This feature is also relatively new.)

Yes, they are still separate apps technically. Perhaps one day they'll have a rule app that can do both simple and complex things without overwhelming new users with the complexity. Basic Rule is a relatively new addition aimed at doing the latter, though it sacrifices some power. (BTW, I wouldn't say that it "replaces" Simple Automation Rules per se, but for new users, I'd probably suggest it instead unless you've tried SAR and like its interface better. Some history, again: Simple Automation Rules was originally called Simple Lighting and was a good replacement for a common motion lighting app on another platform that many early Hubitat users migrated from, though it grew in possibilities since.)

Personally, I create my automations in the app that I think is best suited for their purpose. Sometimes that is Rule Machine, but often it's another built-in app. I also wrote a variety of custom apps to do things I didn't want to do (or couldn't do, or couldn't do easily) with either--also an option if you get there.


I am not a great fan of Simple Rules. I'd say choose one rule app that suits you and stick to that until the day comes you need to do something it won't do, by which time you'll have more experience and learning a new one won't be such a steep curve.


It's a much faster protocol, far superior than z-wave for many reasons. But z-wave has its pros, price and take up for example.

This is what room lighting is. Rule machine can do everything but it's complicated to learn hard to see how things go together at times. Room lighting is born from being simple but powerful, it combines multiple old apps into one. For doing what you want you should stick with this and this alone for now.

That is still not acceptable by HE standards.

I still believe you have a issue with your switches and lights. Please answer the question on how long it take to turn on the light manually when it's been off for a while and you turn it on from the load switch. This is fixed time so if this is 1-2 seconds then that is your lag and nothing to do with the network or HE.

Download the Hubitat app