Created
December 3, 2024 05:43
-
-
Save tkroo/dcf9822052fd4900c14fae4712e382f4 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# create helper > template > Template a sensor | |
# put the code below in the State template field | |
{%- set tempslist = states.sensor | |
| selectattr('attributes.device_class','defined') | |
| selectattr('attributes.device_class','in',['temperature']) | |
| rejectattr('entity_id','search','battery|average|slzb_06') | |
| rejectattr('state','search','unknown|unavailable') | |
| map(attribute='state') | |
| map('float') | |
| list | |
-%} | |
{{ (tempslist | sum / tempslist | length) | round(2) }} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment