@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 _actueelanyone 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
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