Skip to content

amosyuen/ha-registry

Repository files navigation

Home Assistant Registry

GitHub Release GitHub Activity License

pre-commit Black

hacs Project Maintenance BuyMeCoffee

Community Forum

Description

Adds services for home assistant registry operations.

WARNING: These are low level APIs that only have basic validation. They are intended for power users. Misuse could result in entities getting into strange states.

HA core has decided to not support services for common registry operations mentioned in home-assistant/core#86281 (comment).

Services

Remove Entity

Remove all targeted entity registry configs,

entity_id is a repeated field that takes comma separated values in a string or a yaml list

service: ha_registry.remove_entity
data:
  entity_id:
    - sensor.bathroom_temperature
    - sensor.bedroom_temperature

Update Entity

Updates all targeted entity registry configs to the specified values.

entity_id and aliases are repeated fields that take comma separated values in a string or a yaml list

service: ha_registry.update_entity
data:
  entity_id: sensor.bathroom_temperature,sensor.bedroom_temperature
  aliases:
    - Alias1
    - Alias2
  area_id: bedroom
  device_class: temperature
  disabled: true
  hidden: true
  icon: mdi:home
  name: Bedroom Temperature
  new_entity_id: sensor.new_entity_id
  options_domain: sensor
  options:
    unit_of_measurement: °F

{% if not installed %}

Installation

HACS

  1. Install HACS
  2. Go to HACS "Integrations >" section
  3. In the lower right click "+ Explore & Download repositories"
  4. Search for "Home Assistant Registry" and add it
    • HA Restart is not needed since it is configured in UI config flow
  5. In the Home Assistant (HA) UI go to "Configuration"
  6. Click "Integrations"
  7. Click "+ Add Integration"
  8. Search for "Home Assistant Registry"

Manual

  1. Using the tool of choice open the directory (folder) for your HA configuration (where you find configuration.yaml).
  2. If you do not have a custom_components directory (folder) there, you need to create it.
  3. In the custom_components directory (folder) create a new folder called ha_registry.
  4. Download all the files from the custom_components/ha_registry/ directory (folder) in this repository.
  5. Place the files you downloaded in the new directory (folder) you created.
  6. Restart Home Assistant
  7. In the Home Assistant (HA) UI go to "Configuration"
  8. Click "Integrations"
  9. Click "+ Add Integration"
  10. Search for "Home Assistant Registry"

{% endif %}

Contributions are welcome!

If you want to contribute to this please read the Contribution guidelines

Credits

Code template was mainly taken from @Ludeeus's integration_blueprint template