Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only check specific device class? #29

Closed
tispokes opened this issue Mar 2, 2023 · 3 comments
Closed

Only check specific device class? #29

tispokes opened this issue Mar 2, 2023 · 3 comments

Comments

@tispokes
Copy link

tispokes commented Mar 2, 2023

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 :-)

@tispokes
Copy link
Author

tispokes commented Mar 2, 2023

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>)>

@jazzyisj
Copy link
Owner

jazzyisj commented Mar 2, 2023

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

@jazzyisj jazzyisj closed this as completed Mar 2, 2023
@tispokes
Copy link
Author

tispokes commented Mar 2, 2023

Oh I forgot attributes.
Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants