no, just a large family
did a small rewrite of the OP sensor with attribute_sensors and will test this shortly:
entities_domains_counter:
entity_id: sensor.date #<--- not sure if this needs to stay coming 115? maybe to keep it from updating too frequently;-)
friendly_name: Entities per domain
value_template: >
{{states|count}}
attribute_templates:
headline: >
{{states|count}} entities in {{states|groupby('domain')|count}} domains
alert: >
{{states.alert|count}}
automation: >
{{states.automation|count}}
binary_sensor: >
{{states.binary_sensor|count}}
camera: >
{{states.camera|count}}
climate: >
{{states.climate|count}}
counter: >
{{states.counter|count}}
cover: >
{{states.cover|count}}
device_tracker: >
{{states.device_tracker|count}}
geo_location: >
{{states.geo_location|count}}
group: >
{{states.group|count}}
input_boolean: >
{{states.input_boolean|count}}
input_datetime: >
{{states.input_datetime|count}}
input_number: >
{{states.input_number|count}}
input_select: >
{{states.input_select|count}}
input_text: >
{{states.input_text|count}}
light_only: >
{{expand('group.all_lights_only')|count}}
media_player: >
{{states.media_player|count}}
person: >
{{states.person|count}}
proximity: >
{{states.proximity|count}}
remote: >
{{states.remote|count}}
scene: >
{{states.scene|count}}
script: >
{{states.script|count}}
sensor: >
{{states.sensor|count}}
sun: >
{{states.sun|count}}
switch: >
{{states.switch|count}}
timer: >
{{states.timer|count}}
variable: >
{{states.variable|count}}
weather: >
{{states.weather|count}}
zone: >
{{states.zone|count}}
zwave: >
{{states.zwave|count}}
btw, Maybe I am overly puristic, but I don’t like the fake icon_templates, so took the out and customize it
sensor.entities_domains_counter:
icon: mdi:home-assistant
I know it’s 1 line extra, but the dev’s wont complain if anything goes awol…
bw, missed an important 1: persistent_notifications. But I already had that in my notification package, so added the attibute as
persistent_notification: >
{{states('sensor.count_persistent_notifications')}}
atomicpapa
(Glenn Morrison)
September 11, 2020, 4:56pm
11
You lost 30 sensors. Did one of your zones attempt to proclaim its independence and many sensors were destroyed in the ensuing battle?
even worse!
Ive lost several Waze sensors, and Weatherbit integration:
at startup
after a while
the culprits:
hi!
not sure why you’d post that, but if your ‘pulling the data’ from this Roldy's Home Assistant - 190+ sensors - 440+ entities - 70+ automations - Floorplan you now should have noticed that could be done much better…
consider that code:
count_automations:
entity_id: sensor.date
value_template: >
{%- set domains = ['automation'] -%}
{%- for domain in domains -%}
{%- for item in states[domain] -%}
{% if loop.first %}
{{loop.length}}
{% endif %}
{%- endfor -%}
{%- endfor -%}
and compare it to
{{states.automation|count}}
tom_l
November 10, 2020, 11:24am
15
Hey @uiguy come here and blow their minds…
Template editor tool:
{%- for d in states | groupby('domain') %}
{{ d[0] }} - {{ states[d[0]] | count }}
{%- endfor %}
1 Like
uiguy
November 10, 2020, 11:36am
16
my code on @Mariusthvdb link above came initially from @Mariusthvdb i seem to remember… oh and sorry I did not credit you before…
atomicpapa
(Glenn Morrison)
November 11, 2020, 12:48am
17
So, I threw this into the Template editor and it popped up a long list of domains as it should, but one in particular caught my eye -
sensor - 666
Thanks 2020!
1 Like
What would be the best way to display this in Lovelace? I tried a Markdown Card but the formatting was ugly, not having each domain on a new line. Is there a way for format the use of new lines in the Markdown Card?
tom_l
November 11, 2020, 8:43am
20
I tried to put it in a table but failed. This is the best I can do.
type: markdown
content: |-
{% for d in states|groupby('domain') %}
**{{ d[0]|replace('_', ' ')|title }}** {{ states[d[0]]|count }}
{%- endfor %}
title: Domain Counts
2 Likes
Much better than mine. Thanks
Crap:
Better:
elRadix
(elRadix)
November 11, 2020, 1:11pm
22
how can one make the numbers to have at least 3 digits, ie 001 instead of 1
this way to have it nicely aligned
tom_l
November 11, 2020, 1:39pm
23
type: markdown
title: Domain Counts
content: |-
{% for d in states|groupby('domain') %}
{{ '{:03}'.format(states[d[0]]|count) }} **{{ d[0]|replace('_', ' ')|title }}**
{%- endfor %}
2 Likes
elRadix
(elRadix)
November 11, 2020, 2:14pm
24
thank you works great now, multi column would be nice instead one big list.
like this:
pure and simple more-info on a sensor…
Mutt
(Muttley)
November 11, 2020, 5:12pm
26
Now Marius, where is the “Mark this post as : - Evil Bastard ” on the response options ?
1 Like
klogg
(Klogg)
December 7, 2020, 5:21pm
27
I did this:
- type: markdown
# title: Components
content: >
Domain | Count
:---|---:
{% for d in states | groupby('domain') %}
{{ d[0].replace('_', ' ') | title }} | {{ states[d[0]] | count }}
{% endfor %}
3 Likes
since we were counting before…
has anyone else noticed the state machine being flooded with so many new entities (probably because of the new design decisions to breakout attributes and use dedicated sensors?
Ive been weeding out my hand made template sensors, but can not fight this… ok, I wrote a few more scripts and automations, and added a few zones but the Hue integration alone adds about 200 scenes…
Hope this wont grow out of hand…or put differently, force some serious hardware step-ups
Vetsus
(Vetsus)
January 4, 2022, 7:18pm
29
i’m not sure if this is really the best place to ask a question like this but…
is there a way you can use something similar to these but maybe more specific?
how about count just sensors?
and then only sensors that have a specific value in the friendly name? let’s say ‘birthday’
and then maybe on top of that? a numeric value less than 60?