tom_l
8
Hold up. Try this:
{{states.sensor | selectattr('entity_id', 'search', 'sonoff.*battery')
| map(attribute='state')
| map('int', 101)
| select('lt', 50)
| list}}
If there is anything that can’t be converted to an integer it will be replaced with 101 and thus will not be selected by the less than test.
Shamelessly adapted from this:
1 Like