Triggering problem among others

Background; I've just completed a fish room/house within it are 4 dimmable ceiling bulbs and 5 outlets.

I want the ceiling lights to come on and fade up, simulating dawn and then the outlets turn on at specific times, each outlet has a number led tank lights connected, several hours later everything reverses.

Very simple if, else if, rule with specific time triggers. After 5 failed rules I've reached my patience limit and the hubitat box is a cat whisker away from being thrown out of the nearest window open or closed, dont care which.

First attempt I had all the lights go through the on/off/fade process and tried to be clever and use ceiling lights to simulate moonlight, ended up with numerous issues with lights either not coming on or fading up/down

Second attempt, forget the moonlight effect and start at 8am with dawn effect and work way through the day to sunset. Again fades didn't work as expected, lights would fade down 3 or 4 steps then bounce to off, switches erratically turned on off, using the log info link I found that a PAUSED earlier script was running at the same time. Deleted the paused RM. Still had issues so started again.

3rd Attempt, tried using Dim, Adjust and Fade up/down, still had issues with some lights not doing what they were supposed to do, found that the motion lighting app was activating, during hours it wasn't supposed to AND NOBODY WAS IN THE ROOM AND THE SENSORS DIDNT ACTIVATE.

Deleted the motion zone and Soft Reset the hub

4th Attempt, used 2 hourly periodic triggers one on the hour the other offset 30min
Changed a few fades to dim, and split the 4 lights to come on individually with 30 mins between.

Needless to say that didnt work

5th attempt today. Removed periodic and replaced with certain time tried to get each light to come on ar a different time I.e. 8am, 8:30, 9 and 9:30 with dim to 10% for each

8am and 8:30am triggers didnt work, 9am trigger did but instead of dim light to 10% got 100%, 9:30 and 10am triggers missed, 11am trigger fired and light fade up successfully

Really at a loss to what to try next, I have time of day triggers not firing, fade up/down intermittently working, sometimes undertaking 4-5 steps, I have had paused RM's running at the same time with conflicting commands, I have even had motion zones kicking in, outside the hours set and when nobody is in the room.

It is a very simple
If time = 8am then do this
Else if time = 8:30am then do this
So why doesn't the dammed thing work

A screenshot of your rule would help the boffins on here give you advice on your rule.

Sorry was using mobile, here are the screen shots of triggers and actions

Light Logs for today

Light 1

dev:15712020-06-01 12:45:08.425 infoFish room one was turned off

dev:15712020-06-01 11:09:06.297 infoFish room one level was set to 100%

dev:15712020-06-01 11:08:05.878 infoFish room one level was set to 91%

dev:15712020-06-01 11:07:05.271 infoFish room one level was set to 82%

dev:15712020-06-01 11:06:04.655 infoFish room one level was set to 73%

dev:15712020-06-01 11:05:03.784 infoFish room one level was set to 64%

dev:15712020-06-01 11:04:03.301 infoFish room one level was set to 55%

dev:15712020-06-01 11:03:02.710 infoFish room one level was set to 46%

dev:15712020-06-01 11:02:02.265 infoFish room one level was set to 37%

dev:15712020-06-01 11:01:01.616 infoFish room one level was set to 28%

dev:15712020-06-01 11:00:32.748 infoFish room one level was set to 9%

dev:15712020-06-01 11:00:01.154 infoFish room one level was set to 19%

Light 2

dev:15732020-06-01 14:13:05.638 infoFish Room two was turned off (ME TURNING OFF MANUALLY)

dev:15732020-06-01 12:45:42.877 infoFish Room two was turned on (IT TURNED ITSELF BACK ON)

dev:15732020-06-01 12:45:04.064 infoFish Room two was turned off (ME TURNING OFF MANUALLY)

dev:15732020-06-01 11:09:06.454 infoFish Room two level was set to 100%

dev:15732020-06-01 11:08:05.940 infoFish Room two level was set to 91%

dev:15732020-06-01 11:07:05.429 infoFish Room two level was set to 82%

dev:15732020-06-01 11:06:04.883 infoFish Room two level was set to 73%

dev:15732020-06-01 11:05:04.036 infoFish Room two level was set to 64%

dev:15732020-06-01 11:04:03.440 infoFish Room two level was set to 55%

dev:15732020-06-01 11:03:02.925 infoFish Room two level was set to 46%

dev:15732020-06-01 11:02:02.553 infoFish Room two level was set to 37%

dev:15732020-06-01 11:01:12.876 infoFish Room two level was set to 60%

dev:15732020-06-01 11:01:01.840 infoFish Room two level was set to 28%

dev:15732020-06-01 11:00:01.323 infoFish Room two level was set to 19%

Light 3

switch off Fish Room Thee was turned off DEVICE 2020-06-01 12:45:01.480 BST
level 91 % Fish Room Thee level was set to 91% DEVICE 2020-06-01 12:15:32.962 BST
level 100 % Fish Room Thee level was set to 100% DEVICE 2020-06-01 12:13:05.824 BST
level 91 % Fish Room Thee level was set to 91% DEVICE 2020-06-01 11:10:42.878 BST
level 100 % Fish Room Thee level was set to 100% DEVICE 2020-06-01 11:09:06.369 BST
level 91 % Fish Room Thee level was set to 91% DEVICE 2020-06-01 11:08:05.859 BST
level 82 % Fish Room Thee level was set to 82% DEVICE 2020-06-01 11:07:05.339 BST
level 73 % Fish Room Thee level was set to 73% DEVICE 2020-06-01 11:06:04.772 BST
level 64 % Fish Room Thee level was set to 64% DEVICE 2020-06-01 11:05:03.954 BST
level 55 % Fish Room Thee level was set to 55% DEVICE 2020-06-01 11:04:03.386 BST
level 46 % Fish Room Thee level was set to 46% DEVICE 2020-06-01 11:03:02.879 BST
level 37 % Fish Room Thee level was set to 37% DEVICE 2020-06-01 11:02:02.381 BST
level 28 % Fish Room Thee level was set to 28% DEVICE 2020-06-01 11:01:01.753 BST
level 10 % Fish Room Thee level was set to 10% DEVICE 2020-06-01 11:00:32.829 BST
level 19 % Fish Room Thee level was set to 19% DEVICE 2020-06-01 11:00:01.179 BST
switch on Fish Room Thee was turned on DEVICE 2020-06-01 09:05:52.920 BST
level 10 % Fish Room Thee level was set to 10% DEVICE 2020-06-01 09:05:52.920 BST
level 19 % Fish Room Thee level was set to 19% DEVICE 2020-06-01 09:05:43.061 BST
switch off Fish Room Thee was turned off DEVICE 2020-06-01 09:05:43.053 BST
switch on Fish Room Thee was turned on DEVICE 2020-06-01 09:05:42.965 BST
level 10 % Fish Room Thee level was set to 10% DEVICE 2020-06-01 09:05:42.965 BST

Light 4

dev:15702020-06-01 12:45:05.316 infoFish Room Four was turned off

dev:15702020-06-01 12:45:02.992 infoFish Room Four was turned on

dev:15702020-06-01 12:45:02.564 infoFish Room Four was turned off

dev:15702020-06-01 11:09:06.180 infoFish Room Four level was set to 100%

dev:15702020-06-01 11:08:05.696 infoFish Room Four level was set to 91%

dev:15702020-06-01 11:07:05.174 infoFish Room Four level was set to 82%

dev:15702020-06-01 11:06:04.367 infoFish Room Four level was set to 73%

dev:15702020-06-01 11:05:03.717 infoFish Room Four level was set to 64%

dev:15702020-06-01 11:04:03.194 infoFish Room Four level was set to 55%

dev:15702020-06-01 11:03:02.638 infoFish Room Four level was set to 46%

dev:15702020-06-01 11:02:02.140 infoFish Room Four level was set to 37%

dev:15702020-06-01 11:01:01.523 infoFish Room Four level was set to 28%

dev:15702020-06-01 11:00:01.002 infoFish Room Four level was set to 19%

I've never used 'Fade To' so cannot comment on it.
I think the first thing I would do is create a rule that just controls one dimmer.
Get that working how you want it.
You can then move on to the next device in a separate rule and get that working ok.
It doesn't matter if you end up with a number of rules controlling the room, rules are free. :wink:
A number of people on here quote the KISS method and it is very true.
Plus it makes it easier to troubleshoot if your rules are relatively simple

In case you're wondering.
KISS = Keep It Simple Stupid.
This is not directed at you but it is a very valid statement.

Edit. Once you have the first rule working you can clone it and just change the triggers, timings and devices without having to write the complete rule again if that is easier.

1 Like

Great believer in KISS and to be honest I don't see how much simpler it could of been.

My biggest concern today is that the triggers didn't fire, up to now only 9am and 11am have fired, 11am almost perfect 9am not so much

Happy to create RM's but if the triggers don't fire what's the sense in it?

I still feel this should be your starting point now.
You can clone your rule above and take out everything not referring to dimmer 1.
Does it work?
Then move on.

If you plan to continue with on the hour and half hour triggers I'd replace your triggers with simply "Every 30 minutes". Also, I rarely use exact matches in if statements preferring range comparisons "Time => 12:00 and Time <= 12:29" this way if say the trigger happens at 12:00.55 time may roll over to 12:01 before execution reaches that statement.

Update: I didn't recall the syntax there is a "Time between" statement.

1 Like

If you look at this rule, you should be able set the fade, up down, and frequency, one statement should be able to get you from 0 to 100, with a time trigger
Then as said another rule to get you back down smoothly

Or you could use wait for event, ie when it gets to 30% set off another fade with another quicker increase and so on

Ok I cloned it and removed everything except light one, then found that I didnt have the update or run rule buttons.

Thought it might of been me doing something wrong so deleted it and tried again, this time I opened it made no changes clicked done (only choice other than remove) and reopened still no update or run rule buttons.

Had this problem a week or so ago, people said it was me I'd likely done something wrong, so I rewrote RM this time with fewer triggers and it cloned with update and run rule buttons.

I'm seriously of the opinion there is something wrong with the hub, software, or both, I've had far more complex RM's without these issues, so why get them now with what is basic scripting. I have written 5 versions of this script from scratch and the syntax is fine, could proberbly make it smaller and more efficient and would likely do that IF I COULD GET THE DAMMED THING TO RUN IN THE FIRST PLACE.

Seriously wish a window was open, I'd love to see how far this could fly!!!!

A cloned rule is the same as a brand new rule. You will not see these buttons until it has been saved for the first time. When you open it up gain, they will be there.
At the risk of repeating myself, why don't you concentrate on getting one dimmer to work. Make sure it is working as you want and then add to it or create a new rule for dimmer 2.

1 Like

Appreciate your help, but if you read what I put you will see that I did save it and when reopened there was no update or run rule buttons.

After deleting triggers a few at a time saving then reopening I finally got the update and run rule buttons when all triggers were removed

As I have stated previously there is a problem with triggers, software or Hub in general, I have been programming on and off for years, I started with the ZX Spectrum when it first came out and took a computer science degree in my 40's I'm now in my 60's still have all my facilities and know my way around software.

I feel you, man. The UI and event model for Rule Machine is quite challenging.

Since what you want is basically a cascade of events, one alternative you could try here is to use delays rather than explicit time.

image

Obviously I'm using a switch rather than a schedule to start the cascade, and a very short delay for testing, but based on your comments I think you'll get the drift.

@dondo’s approach seems cleaner.

Trigger: when time is 8:100:
Rule:
Dim fish room one 10 -> fade 30
Dim fish room two 10 -> fade 30, delay 30 min
Dim fish room four 10 -> fade 30, delay 60 min
Etc.

Then create a second rule to do the fade out at night.

1 Like

Thanks for the suggestion, already instigated the delay in previous versions and have added it back in the new version.

The basic issue is that there is a problem with triggers, whatever the reason, possibly because I had so many, some didn't fire, which meant the script didn't run, when it did run I found that the lights sometimes had a life of their own, like some unknown trigger was firing affecting some of the lights, in fact the new RM (below) I had to build in code to catch where lights hadn't done what they were told to do.

I even had to write in the last bit, at the bottom of the code that between 23 00 and 07 00 the lights were set to 0, because they kept coming on, even though there are no triggers to fire the script between these time.

I also found that if the bulbs were at 5% and I wanted to fade up, they first went down to 0 then climbed back up.

Saying that the script has worked over the past 24hrs, even if there were a few minor glitches, over the weekend I will tweak it, even if it makes it more long winded and get it working the way I want it.

Good grief, that must bring the hub to a crawl. Isn't there a way to break that into smaller rules? No wonder it doesn't fire at times.

1 Like

I had around 24 time of day triggers, what I found was the first 2 or 3 or 4 didnt fire (varied from day to day). I then tried cloning the rule to re-write, that didnt work, didnt get update or run rule buttons, so usually started from scratch.

Started simple with on - fade up - off followed by on - fade down - off with outlets turning on/off in the middle.

Placed the outlets into separate scripts to reduce triggers, used delay to reduce even further, brought it down to 15 triggers and still had issues. I doubt the triggers had any real impact on the system, I doubt the script had any real impact just a simple If, else if syntax, so at a loss as to why so many issues.

As I said earlier in this, there is a problem with triggers, Rule Machine and/or hub. Take your pick of any one, two or three.

All I know is I want to turn lights on/off in a particular way and what should of taken less than a day has so far taken a week and is still far from perfect

Hhmmm. Seem to have heard that before. :wink:

1 Like

Seems how very few if any other people have complained about this, I would say it is the way your rule is written.

In my opinion, you have 8 separate rules, if I counted correctly. Making this overly complex rule is hell for troubleshooting, as well as making it easy to make a mistake. All those nested rules, and delays, and everything! The hub has to process this whole thing every time the rule triggers.

If you had smaller rules, you could easily figure out where the problem happens. It would also have been quicker to write.

1 Like

It's not just me then.

@stuart I don't want to get in any sort of argument or anything but can I ask why the reluctance to try different things and stick with your idea of using only one rule.
Why don't you try and build the rule slowly by adding things gradually till things start to go wrong.
It's the only way I can see you getting round this.
Anyway, good luck with whatever you try. :+1:

2 Likes