Quantcast
Channel: Configuration - Home Assistant Community
Viewing all articles
Browse latest Browse all 95394

Template to add values of all sensors _actueel

$
0
0

@Mariusthvdb wrote:

cleaning/checking my template sensors, Ive stumbled on this verbose state addition template:

           {{(states('sensor.freezer_garage_actueel')|int)
           + many more
           + (states('sensor.cv_garage_actueel')|int)
           + (states('sensor.cv_stookhok_actueel')|int)
           + (states('sensor.cv_zolder_actueel')|int)
           + (states('sensor.zonneboiler_zolder_actueel')|int)
           + (states('sensor.patchboard_zolder_actueel')|int)}}

I suppose this must be possible in a more intelligent way, but don’t see it at the moment…
add the values of all sensors ending with _actueel

anyone with a hint getting me on the road please? Ive had it before, long time ago… see Template to add values of all sensors with certain name ending.

but then I had the sensors in a group (no longer available) and the python script was way to powerful and at a high HA processor cost, because it was triggered by an automation that constantly ran…

so, hope while time has flowed, new possibilities have arisen… or skills for that matter :wink:

this almost selects the right sensors

{% for state in states.sensor if '_actueel' in state.entity_id  %}
 {{state.state}}
{% endfor %}

should only filter out None and unknown

like this:

{% for state in states.sensor if '_actueel' in state.entity_id and state.state != 'unknown' and state.state != 'None' %}
 {{state.state}}
{% endfor %}

thanks!

Posts: 6

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 95394

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>