Metadata-Version: 2.4
Name: ha-voice-label-sync
Version: 0.2.0
Summary: Generate voice assistant configuration from Home Assistant labels.
Author: Philippe Le Bonhomme
License-Expression: MIT
Project-URL: Homepage, https://github.com/flimo44/ha-voice-label-sync
Project-URL: Documentation, https://github.com/flimo44/ha-voice-label-sync#readme
Project-URL: Issues, https://github.com/flimo44/ha-voice-label-sync/issues
Project-URL: Source, https://github.com/flimo44/ha-voice-label-sync
Keywords: home-assistant,google-assistant,voice-assistant,automation,yaml
Classifier: Development Status :: 3 - Alpha
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Home Automation
Requires-Python: >=3.11
Description-Content-Type: text/markdown
License-File: LICENSE
Dynamic: license-file

<img width="1024" height="559" alt="image" src="https://github.com/user-attachments/assets/6918c5ae-b95b-4d81-9108-7b2cd8acd0fd" />

### Automatically generate your voice assistant configuration from Home Assistant labels.

[![Python checks](https://github.com/flimo44/ha-voice-label-sync/actions/workflows/python-check.yml/badge.svg?branch=main)](https://github.com/flimo44/ha-voice-label-sync/actions/workflows/python-check.yml)

✨ Features

✔ Generate Google Assistant YAML from labels
✔ Home Assistant integration
✔ CLI
✔ Automatic backups
✔ PyPI package
✔ HACS support (coming soon)

> 🚧 Early development project
>
> Feedback and ideas are welcome.

## Why?

Do you maintain dozens of Google Assistant entities manually?

Managing voice assistant configurations manually quickly becomes difficult.

HA Voice Label Sync automatically generates the required configuration from Home Assistant labels, making your labels the single source of truth.

With the current release you can:

Stop maintaining large YAML files manually.
Avoid duplicated configuration.
Keep Home Assistant as the only place where entities are managed.
Generate your configuration in seconds.

## Current Status

## Project status

HVLS is currently under active development.

Latest stable release: `v0.1.2`

Current development version: `0.2.0.dev0`

Current capabilities:

- Standalone CLI
- Reusable Python core
- Google Assistant YAML generation
- Dry-run support
- Safe atomic file writing
- Automatic backups and retention
- Initial Home Assistant integration skeleton

Not yet available:

- Full Home Assistant configuration UI
- Home Assistant actions and buttons
- Backup restoration from the UI
- HACS installation

HA Voice Label Sync has been designed to support multiple voice assistants.

- Currently supported :


      ✅ Google Assistant

- Planned :

      Amazon Alexa
      Apple HomeKit

Instead of maintaining a long list of exposed entities manually, simply assign a label in Home Assistant, run the script, and let HA Voice Label Sync generate the configuration for you.


## Features

- Select entities using a Home Assistant label
- Generate `entity_config` for Google Assistant
- Use Home Assistant friendly names
- Use Home Assistant areas as Google rooms
- Ignore disabled or hidden entities
- Dry-run mode before writing the file

## How it works


```
                           Home Assistant
                                │
                                ▼
                              Labels
                                │
                                ▼
                        Voice Assistant Sync
                                │
                         ┌──────┴───────┐
                         │              │
               Google Assistant    Amazon Alexa
       
```

## Generated entity_config

```yaml
switch.prise_pompe:
  expose: true
  name: Pompe piscine
  room: Piscine
```


Home Assistant configuration

```yaml
google_assistant:
  project_id: YOUR_PROJECT_ID
  service_account: !include google_key.json
  report_state: true
  expose_by_default: false
  entity_config: !include google_assistant_entities.yaml
```

## Quick start

Installation

Option 1 – Download the script

Download the latest version of ga_label_sync.py from the repository.

Copy it to your Home Assistant scripts directory.

Typical locations are:

```text
/config/scripts/

or

<home-assistant-config>/scripts/
```

depending on your Home Assistant installation.

Option 2 – Clone the repository
```bash
git clone https://github.com/flimo44/ha-voice-label-sync.git
```
The script is located in:
```text
scripts/ga_label_sync.py
```

```Tip

If you simply want to use the script, downloading scripts/ga_label_sync.py is enough.

Cloning the repository is recommended only if you plan to follow development or contribute to the project.
```

Usage :

### Step 1 — Add the label

<img width="455" height="375" alt="Capture d&#39;écran 2026-06-26 201643" src="https://github.com/user-attachments/assets/a262942a-5fb1-4a84-b88e-5db12eb67be8" />


### Step 2 — Preview the generated configuration


<img width="555" height="172" alt="Capture d&#39;écran 2026-06-26 203136" src="https://github.com/user-attachments/assets/66ea6d63-983b-467b-9870-198d64b027bd" />

```bash
python3 /config/scripts/ga_label_sync.py --label "google_assistant" --dry-run
```

```
# --- Couloir ---
lock.serrure_maison:
  expose: true
  name: Serrure porte entrée
  room: Couloir

# --- Jardin ---
switch.portail:
  expose: true
  name: Portail
  room: Jardin

# --- Piscine ---
input_select.piscine_mode_gestion:
  expose: true
  name: "Piscine - Mode Gestion"
  room: Piscine

switch.piscine_chauffage:
  expose: true
  name: Pac Piscine
  room: Piscine

switch.prise_pompe2:
  expose: true
  name: Pompe piscine
  room: Piscine
```


### Step 3 — Generate the file
```bash
python3 /config/scripts/ga_label_sync.py --label "google_assistant"
```
<img width="454" height="446" alt="Capture d&#39;écran 2026-06-26 200340" src="https://github.com/user-attachments/assets/6f0938ae-13e9-4856-9b4f-7db5e8290171" />


### Step 4 — Restart Home Assistant



### Step 5 — Synchronize Google Home


Google Home before synchronization

<img width="1080" height="2400" alt="Screenshot_2026-06-26-19-44-33-60_2d2bd67b5e15ae98c151ac739cd6881e" src="https://github.com/user-attachments/assets/a03d1005-fde8-4186-b8ea-da2f426c5a84" />

Google Home after synchronization

<img width="1080" height="2400" alt="Screenshot_2026-06-26-19-45-48-86_2d2bd67b5e15ae98c151ac739cd6881e" src="https://github.com/user-attachments/assets/5b4d96cc-9da9-4419-9d1f-f5eac4fbec8c" />

License
MIT
