jazzyisj/unavailable-entities-sensor

Only check specific device class?

Closed this issue · 3 comments

Like in #16
but I would like to only check device_class "battery". I don't want to check sensors with fixed power supply.

Wasn't able to reduce the results to this.
Regards :-)

Like this item, from the expanded list:
<template TemplateState(<state sensor.briefkasten_ms_power=unavailable; state_class=measurement, unit_of_measurement=%, device_class=battery, friendly_name=Briefkasten power @ 2023-03-02T08:53:59.750493+01:00>)>

|selectattr('attributes.device_class','defined')
|selectattr('attributes.device_class','eq','battery')

Oh I forgot attributes.
Thanks