@Snowman said in DynamicGroupController Feedback:
Forgot to mention it requires double quotes.
Actually, it's a good idea to surround the entire expression in quotes, since expressions often contain special characters that YAML doesn't want to digest.
In this case, that means you'd have quotes in quotes, which is fine, as long as they are different. In the expression itself, the expression language doesn't care if you use single quotes or double.
filter_expression: "entity.attributes.x_hass.state == 'on'"
But I really think @Pabla 's form is the best... that's a special feature of YAML that works really well for expressions, so if you want to avoid headaches, write all your expressions the way he showed.
filter_expression: >
entity.attributes.x_hass.state == 'on'
In this case, everything idented under filter_expression is taken as part of the expression, so you can write multi-line expressions easily, too...
filter_expression: >
entity.attributes.leak_detector.state &&
entity.attributes.temperature_sensor.value < 35