Hi,
I cannot get this sensor to count correctly. I have a feeling it is because the state isn’t a number (even though it looks like one).
It currently matches/counts 4 binary_sensors
, only 1 of which actually has a state <=50.
Any help would be appreciated. I am not great at using filters (all my knowledge has been from examples others have written). I have tied the jinja2 website to learn, but that isn’t easy reading.
- name: "count of MQTT low link quality"
icon: mdi:signal
unique_id: count_of_mqtt_low_linkquality
unit_of_measurement: "lqi"
state: >
{{ states.binary_sensor
| selectattr('name','match','.*linkquality')
| selectattr('state','<=','50')
| list
| count
}}