Hello,
I found this code in another thread for system-monitoring. It displays all device_tracker devices (online and offline) as a number, Can I modify the code to get the number from all devices that are online/home only?
Thank you,
Philipp
- platform: template
sensors:
count_device_trackers:
entity_id: sensor.date
value_template: >
{%- set domains = ['device_tracker'] -%}
{%- for domain in domains -%}
{%- for item in states[domain] -%}
{% if loop.first %}
{{loop.length}}
{% endif %}
{%- endfor -%}
{%- endfor -%}