Help using the new condition selector in a script?

Would love to able to use a condition selector-selected value in normal scripts (evaluate the supplied conditions). Would appreciate it if anyone can share how to accomplish this.

Is this worth filing an issue / feature request on GitHub for?

1 Like

Use the choose statement structure.
Script Syntax - Home Assistant.

@jiehan As best as I can tell, as of 2023.12.3, the condition selector doesn’t appear to be compatilbe with Home Assistant scripts—only blueprints. (See also @Didgeridrew’s findings earlier in this thread.)

And if perhaps you had wanted to file an issue / feature request on GitHub for this, I think that would be great! (And if you do, please feel free to link to it here.)

1 Like

I haven’t tested it, but perhaps try a construct like this, but replace the input with the variable containing the condition. Worth a try…

condition:
  - condition: state
    entity_id: sensor.banana
    state: "rotten"
  - condtion: and
    conditions: !input condition_selector_input

The !input tag is not working. The editor won’t allow to save the script if the tag is present (red bar on the left, and no save button):

I have no idea what you are doing there or how it relates to this topic. Also sharing code as images is just painful to see and use.

May I suggest you start a new topic and provide some of your code to help ask a full question.

That would be helpful.