A simple sensor that counts all other sensors
sensor:
- platform: template
sensors:
hass_count:
friendly_name: HASS Count
icon_template: mdi:home-assistant
value_template: "{{ states | count }}"
attribute_templates:
automation: "{{ states.automation | count }}"
binary_sensor: "{{ states.binary_sensor | count }}"
camera: "{{ states.camera | count }}"
climate: "{{ states.climate | count }}"
device_tracker: "{{ states.device_tracker | count }}"
light: "{{ states.light | count }}"
media_player: "{{ states.media_player | count }}"
scene: "{{ states.scene | count }}"
script: "{{ states.script | count }}"
sensor: "{{ states.sensor | count }}"
switch: "{{ states.switch | count }}"
zwave: "{{ states.zwave | count }}"
To list all domains (and current count) in your environment you can run this:
{%- for d in states | groupby('domain') %}
{{ d[0] }} - {{ states[d[0]] | count }}
{%- endfor %}
And the result