Where can I find a list of domains?

I’m trying to exclude domains with the homekit component. I’ve looked all over and I can’t seem to find a list of available domains. Is this defined anywhere? I’m trying to exclude every domain and only add the devices I want in HomeKit.

I found a list assembled from all components and I built a filter from that.

filter:
  exclude_domains:
    - alarm_control_panel
    - automation 
    - input_boolean -
    - remote 
    - script
    - binary_sensor
    - climate
    - cover
    - device_tracker
    - fan
    - light
    - lock
    - media_player
    - sensor
    - switch
1 Like

why don’t you just use include_domains… Then you only need to know what you want to include.

Hell, only use include_entities if you know exactly which ones you want.

You still have to exclude the domains?

If that’s the case, that’s a poor implementation. It completely defeats the purpose of exposed domains and maintaining small configurations. I doubt it would be different than other components. For example, in emulated hue I only have exposed domains. Any domain not in that list is ignored and not exposed.

I just looked at the code, it uses the same library as emulated hue. You should only need to configure exposed domains and the entity id’s you want to expose.

If my understanding of the documentation is correct (and both could be wrong) there is a precedence that included entities override excluded domains.

Yes. That way you can exclude (say) the entire switch domain, and then include a single switch.

Of course, if you only specify included domains or entities, then it’ll automatically exclude everything else.

2 Likes

Here is a list of domains. It’s going to be different for you because there isn’t a specific list. Here are mine and also a command you can use to generate a list.

# hass-cli state list | grep -o '^[a-z][^.]*' | sort | uniq
alarm_control_panel
alert
alexa
automation
binary_sensor
camera
climate
device_tracker
ENTITY
fan
group
image_processing
input_boolean
input_select
light
media_player
person
remote
script
sensor
sun
switch
timer
weather
zigbee2mqtt_networkmap
zone
8 Likes

Well that’s a list for your instance of HA. It will change depending on what you have integrated.

Using this template in the template editor will get you the list of domains that are being used in your instance:

{%- for d in states | groupby('domain') %}
{{ d[0] }}
{%- endfor %}

EDIT: Seeing that this gets so much foot traffic. Here 1 line template that does the same thing.

{{ states | groupby('domain') | map(attribute='0') | list | join('\n') }}
60 Likes

Hi, is it possible to get a list of notify services?

I tried this command
hass-cli --no-headers --output json service list 'notify.'
or
hass-cli --no-headers service list 'notify.'
and this
http://hassio:8123/api/services

but I don’t know how to do a rest full command or command line

I would like to get the list of notification services and then populate an input_select
Thank you very much if you can help me.

I don’t believe so. Sorry. I have often been wrong so maybe someone else may know.

Use grep?

On Linux variants:

hass-cli --no-header service list  | grep notify

On Windows

hass-cli --no-header service list   |findstr -i notify

Blockquote
hass-cli --no-header service list | grep notify

Yes thanks. On Linux this works without --no-headers with the end point

hass-cli service list | grep notify.
and it is the same as this one
hass-cli --no-headers service list 'notify.'

But the question is: how can I import this data into hass? in an input_text separated by a comma maybe? But how? Or else I don’t know …

notify

by the path /api/services

thanks anyway :+1:

what is it in you mean when you say you want to import this into hass with an input select ?

didnt see the solution to finding used domains in your setup yet, so here’s what shows all your domains in use:

  - platform: template
    sensors:
      domains_in_use:
        friendly_name: Domains in use
        value_template: >
          {%- for d in states | groupby('domain') %}
          {{ d[0] }}
          {%- endfor %}

or count them also:

           {%- for d in states | groupby('domain') %}
            {% if loop.first %}{{loop.length}} Domains:
            {% endif %}- {{ d[0] }}
          {%- endfor %}

this will show all components:

  - platform: rest
    name: Hassio Main config
    resource: !secret resource_hassio_main_config
    authentication: basic
    value_template: >
      {{ value_json.version }}
    json_attributes:
      - components
      - unit_system
      - config_dir
    headers:
      Content-Type: application/json
      Authorization: !secret api_bearer_token
      User-Agent: Home Assistant REST sensor

and you need to have/create an api_bearer_token for that

4 Likes

Thank you both!
@Mariusthvdb, I suggest your post here

It was what I wanted, but I didn’t know that config existed
resource: http://hassio:port/api/config

In the link there are many interesting things. Thank you so much for your super shares.

2 Likes

i installed HA in ubuntu venv. when i entered this command at the terminal, i get error of:
hass-cli: command not found

hass-cli --no-header service list  | grep notify

any idea what i did wrong?

You need to install hass-cli: