Why arent simple compare conditions and triggers built into the UI. Very frustrating that something this basic is left out and even the numeric comparisons in the UI is greatly lacking.
Dunno where you found that, but taking an explicit string and applying the string filter to it would not make any difference whatsoever. So no definitely do not do that.
Finally, the state option accepts helper entities (also known as input_* entities). The condition will pass if the state of the entity matches the state of the given helper entity.
Example in the docs:
conditions:
- condition: state
entity_id: alarm_control_panel.home
state: input_select.guest_mode
For this particular case, you can create a State Condition in the Automation Editor in Visual mode.
I don’t have a screenshot handy but the resulting YAML would look like this:
conditions:
- condition: state
entity_id: input_select.house_mode
state: input_select.house_mode_selector
@123 I was commenting on the UI not exposing basic evaluation methods… <>; >=, <=, ==
example: Entity_A <> Entity_B
HA can do these comparisons in templates but it should 100% be UI based (no need for templates) as this is super common trigger and condition for automation.
The example in your first post showed a template checking if one entity’s state is equal to another. That’s why I qualified my reply “for this particular case”.
The Numeric State Trigger Condition can handle less/greater than.
I dont see any way to create a state condition to test == or <> two helper entities values that are strings. Please provide a screenshot of this example, I could not figure out how to do it in the UI (without using a template).
I didnt ask about Numeric values, I asked about NON-Numeric values (strings).
The visual editor does -not- do what I asked about, even for Numeric State Conditions. I have not see ANY way in the visual editor to do EntityA <> EntityB without a template.
If Im wrong, and I’d be happy to be wrong, please show an exact screenshot of comparing two separate entities’ values against each other.
The Automation Editor in Visual mode assumes the State field of a State Condition will contain the value of the selected entity.
However, as explained in the documentation, it’s not limited to a value but can also be the entity_id of an Input helper.
If you type an entity_id in the State field, the Automation Editor will accept it.
Is it self-evident? Not at all; the Automation Editor’s Visual mode doesn’t provide visual guidance for everything that’s documented. (Yet another reason why experienced users eventually outgrow it.)
As for “not equal to”, that’s not possible with only a State Condition. You would need to combine a State Condition with a Not “Building Block” as it’s called in the Automation Editor. The resulting YAML that’s produced looks like this:
- condition: not
conditions:
- condition: state
entity_id: input_boolean.foo1
state: input_boolean.foo2
NOTE
RE: screenshots. I don’t currently have access to my laptop and posting screenshots from my phone is miserable.
Thank you. Def not obvious. Comparisons like that are very needed, very useful when doing workflows to check states of helpers. I hope they make the Visual Automation Editor more robust… YAML and template coding is suboptimal in many ways so the visual editor helps ensure we dont mess up YAML (syntax, spacing, etc). Unfortunate that HA did not embed a real scripting language like JS… people like me would post 98% fewer questions