Sunrise sunset rule says false incorrectly?

Am I getting this backwards?

I have several Rule Machine rules for the master bathroom dimmer to try to not blind myself at night. Basically I want, between sunrise+30 and sunset-30 (daytime), go to level 40 when button 1 (top) is pressed. Between sunset-30 and sunrise+30 (night time), go to level 1 when button 1 is pressed. When button 2 is pressed, go to level 1 and then go to off (just in case the dimmer remembers its setting and turns on before talking to HE). Go to 99 when button 1 is double tapped.

The double tap and the button 2 presses seem to work well. The problem today (and today is really my first day to test) is it only went to level 1 at 9am. Checking the rules it looks like it thinks it's still between sunset and sunrise (night)? The screen shot didn't capture the top of the screen, but the picture was taken at 9:17am -- definitely the sun is up, even here in MN.

I've checked and HE knows my zip code and my exact longitude and latitude (as reported by Google Maps).

Even now, at nearly 10am it's saying that between sunrise and sunset is false.

HE is running 2.3.1.130, hardware Rev C-7, it shows my zip code, my lat/long, time zone, and current time correctly.

All ideas welcome, thanks in advance!

You have shown the 'managed conditions' section.
Are you actually using these in your rule actions/triggers.
Consider Managed Conditions to be a repository where you can define/edit/delete conditions but you need to actually use these in your rule for them to do anything.
Maybe show a screen shot of all your rule to give a better idea of what is going on.

1 Like

Sure thing! Here's what I have:



If I've set it up all wrong, please be gentle. :wink:

Thanks!

From what you are showing you are not actually using the managed conditions you defined in your action section as an expression so they will be totally ignored.
Maybe something like (I do not use RM anymore but here goes)......

TRIGGER
Button 1 pressed

ACTIONS
IF
Button 1 pressed
THEN 
IF
Time is between aaa and bbb. 
THEN
Set dimmer to xxxx
ELSE-IF
Time is between ccc and ddd. 
THEN
Set dimmer to yyyy.
END-IF
END-IF

You can write 2 more rules for your other actions or try to integrate them into this rule.
Your choice.

I hope this all makes sense.
There is a tutorial about somewhere for RM which might be worth a read.
Good luck.

Ah, that makes sense! I didn't realize that the conditionals weren't automatically applied.

So now I have:

However, as you can see, it still thinks it's not daytime. Is there a "confused" emoji?

I'm going to add an else clause to consolidate the night time and day time rules into one, but I feel like this shows the real problem -- it think it's night time...

In you condition you are showing it as
Between Sunrise +30 and Sunset -30. I'm afraid this is daytime.

You need
Between Sunset -30 and Sunrise +30. I'm afraid this is night time.
Keep going. You'll get there. :wink:

Just throwing some test cases together:

Between sunrise and sunset is daytime. It's currently daytime. Why does the expression result return false? Either this is a bug, or I've totally been programming wrong for the last 25 years, and I think I would have noticed that by now... :wink:

Thanks!

1 Like

Hhmmm.
Not sure what to say.
It is currently daytime here in the UK and when I define between sunrise and sunset then it shows as TRUE.
image

Maybe a bug in yesterday's firmware update... I'll give it some time and see what other people say.

But thanks for the tip on having the IF THEN to do the setting!

Maybe do a backup and then do a reboot in case something got screwed in your hub. :man_shrugging:
Not sure what else it could be. You've already confirmed your location settings are correct. :thinking:

BTW I'm on the latest firmware so I don't think it could be a general bug.

A little aside from your question, but have you considered doing this simply using the Button Controller App instead of Rule Machine. I use Button Controller-5.1 to achieve similar functionality using mode-based dimming.

I had originally done it with the Button Controller, but I wasn't sure if that was the right place to do it and since I already had other Rule Machine rules I deleted it from BC and redid it in RM. I swear the times showed correctly as TRUE and FALSE when I was working with them yesterday in BC.

Six of one half-dozen of another? Or does Button Controller give some extra functionality?

When in doubt, reboot! Is this thing running Windows? :wink: It's showing correctly now:

Thanks!

I wonder if the rule somehow got corrupt. :person_shrugging:
As long it's now working, onwards and upwards. :slight_smile:

2 Likes