Basic Rule machine question - Required Expressions

If I have a required expression , say between two times and I use Sunset to Sunrise. Do I ALSO need a trigger, of does the required expression cover that ?

Rule actions will never run without a trigger event (or a "Run rule actions" from another rule or doing so manually in the Rule UI yourself).

In other words, for most people, the answer to your question is "yes." :slight_smile:

[EDIT: As in, "yes, you need a trigger" and "no, the required expression will not cover that.]

4 Likes

Well if the required expression is that the times needs to be between sunrise and sunset you'd likely have something else for the trigger. If you just want the rule to fire at sunrise or sunset you'd not need the required expression and you'd just want those as triggers,

2 Likes

Well, that was kind of what got me to thinking about this when I was working on the issue yesterday. I never did get that rule working right, and I had the required expression and a trigger time. Now I'm starting to this that hub just went bad. NONE of the automations are working on it. I removed all of the linked devices, and now I cant add them back.. It was great I got all the devices migrated to the C* no problem, but I', having to completely re do about 98% of my rules. I'm not saying this is a C* issue, that seems fine. I think I have a latent problem with the C7 that became very noticeable when I migrated the devices from the other C7 to the C8.

Can you post some logs of the failed rules along with the rule?

This is all that was generated, even though I had all logging turned on. I've sense gone nuclear and am rewriting it and several other rules from scratch. I'm beginning to thing there is an issue with the hub that runs the rules and automations.

image

So here is that rule rewritten this morning. For testing purposes I drastically lowered the illuminance level (12, will be 300 in production) as well as shortened the time (30 seconds, will be longer in production) .


Logs

The last log is confusing. Unless you are editing the rule multiple times and have pasted all of it. Typically "Initialized" only appears in the log when the rule is updated. So it's hard to follow what's going on. Currently when you run the actions is the light not dimming and then after 30 seconds (based on your test) turning the lamp off?

With the trigger set for 12 and the illuminance of 16 of course the trigger isn't being met so are you just using 'Run Actions' to test? That's fine just making sure I have a clear picture of how you are testing. Also remove the "filter" in the logs and go to Live Logs so we can see the events, triggers, actions, etc... more is better when trouble shooting.

Thanks.

Yeah. the problem right now is it is an overcast day (suposed to be rainy tomorrow too) , so I'm having trouble finding the right lux levels to test it. At the time (and currently) the Lux level indicated 16. so I was trying to get it to trigger below 16, and kick back off over 16. for testing the AND Stays were shortened to 30 seconds. In realilty the lux will be 300, that the below 300 will be 3 minutes, over 300 will be 15 minutes .

That rule has not generated any further logs since 13:24. I have the live log open and it isnt generating any thing, though the light in question is still on.

I was trying to figure out how to set up a virtual omni sensor as @bravenel suggested in my other thread yesterday, but I cant figure out how to do that .

Go to Devices page, and upper right corner, Add Device. The select Virtual...

Then pick Virtual Illuminance Sensor or Virtual Omni Sensor from the dropdown list.

1 Like

Thank you! I was thinking it was something else!

Looks like I finally Got this rule working as intended. Thank you to those who helped out!! Now on to the next thing!!
(Need Some help with a room lighting rule)

Summary

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.