Conditions "Unused"

I am new to Hubitat and i am sure i am missing something but cant seem to find answer after searching.
I have a simple requirement for logic
If motion sensor triggers while mode = away or night send push alert to iphone

The alert is being sent correctly but it sends whenever motion is detected no matter the mode. I have set condition that mode should = away or night but it shows as "Unused"
I assume i am doing something wrong?

Youā€™ll have to edit the ā€œtriggerā€ section of the rule by adding the condition to a required expression.

As it stands now, you have defined a condition the rule has access to, but you still have to create a trigger that makes use of the condition.

2 Likes

Another option which would be to instead use ā€œRequired Expressionā€ by setting it to the same condition.

With this, the rule would be prevented to run unless the mode is either Night or Away.

Makes sense?

Thanks,
I have removed the condition (not sure what these are used for?) and added a "Required Expression" of Away and Night to the trigger which gives the desired result

2 Likes

Conditions can exist in triggers or in the ruleā€™s actions.

No, this is wrong. Only events can be in triggers. A condition is about state, while an event is an instantaneous thing. A contact opening is an event, while a contact being open is a state. Only states can be in conditions.

See this post: Introduction to Automation

3 Likes

My mistake, itā€™s been long enough since Iā€™ve needed to create a new rule that Iā€™m conflating required expressions and conditions.

FYI, the "?" icon in the top of most apps will take you to the docs, or you can go to docs2.hubitat.com to browse yourself. Here's where that takes you for Rule 5.1:

You're looking specifically for the section on Manage Conditions/Create Conditions (though the section on conditional actions shows you perhaps the most common way in which they are actually used).

That being said, the community is great, and you even got the staff member who wrote the app to help you out, so ... posting here is rarely a bad idea. :smiley: Just showing you another place you can look!

5 Likes

Actually, conflating conditions and events. Required Expressions also use conditions. Triggers use events.

3 Likes

Thanks all.

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