Tag: Harmony

Home Assistant + Logitech Harmony: De Ultieme Integratie (Volledige Handleiding)

Home Assistant + Logitech Harmony: De Ultieme Integratie (Volledige Handleiding)

 

De Logitech Harmony Hub blijft een van de krachtigste universele afstandsbedieningen, ook al wordt hij niet meer actief ontwikkeld. In deze handleiding laat ik zien hoe je de Harmony Hub volledig dynamisch integreert in Home Assistant.

We bouwen:

  • dropdowns per apparaat met alle commando’s
  • automatische activiteitenlijst
  • directe uitvoering van commando’s bij selectie
  • één enkele automation die alle apparaten ondersteunt
  • volledig dynamisch ingelezen uit de Harmony‑config

Deze methode is stabiel, onderhoudsvrij en werkt zonder custom componenten.

 

1. Harmony JSON exporteren

Ga in Home Assistant naar:

Instellingen → Integraties → Harmony Hub → Download config

Sla het bestand op in:

Code
 
config/harmony_5872655.conf
 

2. Helpers aanmaken per apparaat

Maak in Home Assistant per Harmony‑device een input_select helper aan. Laat de opties leeg — die vullen we automatisch.

Voorbeeld helpers:

Code
 
input_select.harmony_commands_av_serre_2
input_select.harmony_commands_av_woonkamer_1
input_select.harmony_commands_blue_ray_speler
input_select.harmony_commands_dvr_formuler
input_select.harmony_commands_dvr_vu
input_select.harmony_commands_eetkamer_3
input_select.harmony_commands_lg_70up7006lb
input_select.harmony_commands_marmitek_av_switch
input_select.harmony_commands_muziekserver_avedio_links
input_select.harmony_commands_sat_dm8000
 

3. Automation: Helpers automatisch vullen met commando’s

Deze automation leest je Harmony‑config in en vult alle helpers met de juiste commando’s.

yaml
 
alias: Harmony – Fill Per‑Device Helpers
triggers:
- event: start
trigger: homeassistant
- minutes: /10
trigger: time_pattern
actions:
- action: file.read_file
data:
file_name: harmony_5872655.conf
file_encoding: JSON
response_variable: harmony_data
- variables:
harmony: "{{ harmony_data.data }}"
- action: input_select.set_options
data:
entity_id: input_select.harmony_commands_av_serre_2
options: |
{{ [''] + harmony.Devices['AV-Serre 2'].commands }}
- action: input_select.set_options
data:
entity_id: input_select.harmony_commands_av_woonkamer_1
options: |
{{ [''] + harmony.Devices['AV-Woonkamer 1'].commands }}
- action: input_select.set_options
data:
entity_id: input_select.harmony_commands_blue_ray_speler
options: |
{{ [''] + harmony.Devices['Blue-Ray speler'].commands }}
- action: input_select.set_options
data:
entity_id: input_select.harmony_commands_dvr_formuler
options: |
{{ [''] + harmony.Devices['DVR Formuler'].commands }}
- action: input_select.set_options
data:
entity_id: input_select.harmony_commands_dvr_vu
options: |
{{ [''] + harmony.Devices['DVR Vu+'].commands }}
- action: input_select.set_options
data:
entity_id: input_select.harmony_commands_eetkamer_3
options: |
{{ [''] + harmony.Devices['Eetkamer 3'].commands }}
- action: input_select.set_options
data:
entity_id: input_select.harmony_commands_lg_70up7006lb
options: |
{{ [''] + harmony.Devices['LG 70UP7006LB'].commands }}
- action: input_select.set_options
data:
entity_id: input_select.harmony_commands_marmitek_av_switch
options: |
{{ [''] + harmony.Devices['Marmitek AV Switch'].commands }}
- action: input_select.set_options
data:
entity_id: input_select.harmony_commands_muziekserver_avedio_links
options: |
{{ [''] + harmony.Devices['Muziekserver Avedio Links'].commands }}
- action: input_select.set_options
data:
entity_id: input_select.harmony_commands_northern_lichtbediening
options: >
{{ [''] + harmony.Devices['Northern International
Lichtbediening'].commands }}
- action: input_select.set_options
data:
entity_id: input_select.harmony_commands_sat_dm8000
options: |
{{ [''] + harmony.Devices['SAT DM8000'].commands }}
- action: input_select.set_options
data:
entity_id: input_select.harmony_commands_homeseer
options: |
{{ [''] + harmony.Devices['homeseer'].commands }}
 

4. Eén automation die ALLE commando’s verstuurt

Zodra je een commando kiest in een dropdown, wordt het direct uitgevoerd.

yaml
 
alias: Harmony – Send Command From Any Device Helper
triggers:
- entity_id:
- input_select.harmony_commands_av_serre_2
- input_select.harmony_commands_av_woonkamer_1
- input_select.harmony_commands_blue_ray_speler
- input_select.harmony_commands_dvr_formuler
- input_select.harmony_commands_dvr_vu
- input_select.harmony_commands_eetkamer_3
- input_select.harmony_commands_lg_70up7006lb
- input_select.harmony_commands_marmitek_av_switch
- input_select.harmony_commands_muziekserver_avedio_links
- input_select.harmony_commands_sat_dm8000
trigger: state
actions:
- action: file.read_file
data:
file_name: harmony_5872655.conf
file_encoding: JSON
response_variable: harmony_data
- variables:
harmony: "{{ harmony_data.data }}"
device_id: "{{ harmony.Devices[device_name].id }}"
- target:
entity_id: remote.huiskamer
data:
device: "{{ device_id }}"
command: "{{ command }}"
action: remote.send_command
- action: input_select.select_option
data:
entity_id: "{{ changed_helper }}"
option: ""
variables:
changed_helper: "{{ trigger.entity_id }}"
device_name: |
{% set map = {
'input_select.harmony_commands_av_serre_2': 'AV-Serre 2',
'input_select.harmony_commands_av_woonkamer_1': 'AV-Woonkamer 1',
'input_select.harmony_commands_blue_ray_speler': 'Blue-Ray speler',
'input_select.harmony_commands_dvr_formuler': 'DVR Formuler',
'input_select.harmony_commands_dvr_vu': 'DVR Vu+',
'input_select.harmony_commands_eetkamer_3': 'Eetkamer 3',
'input_select.harmony_commands_lg_70up7006lb': 'LG 70UP7006LB',
'input_select.harmony_commands_marmitek_av_switch': 'Marmitek AV Switch',
'input_select.harmony_commands_muziekserver_avedio_links': 'Muziekserver Avedio Links',
'input_select.harmony_commands_sat_dm8000': 'SAT DM8000'
} %} {{ map[changed_helper] }}
command: "{{ states(changed_helper) }}"
 

5. Activiteiten dropdown automatisch vullen

yaml
 
alias: Harmony – Update Activity Helper
trigger:
  - platform: homeassistant
    event: start
  - platform: time_pattern
    minutes: "/10"

action:
  - action: file.read_file
    data:
      file_name: harmony_5872655.conf
      file_encoding: JSON
    response_variable: harmony_data

  - variables:
      harmony: "{{ harmony_data.data }}"

  - action: input_select.set_options
    data:
      entity_id: input_select.harmony_activity
      options: >
        {{ harmony.Activity.keys() | list + ['PowerOff'] }}
 

6. Activiteit starten bij selectie

yaml
 
alias: Harmony – Start Activity On Selection
trigger:
  - platform: state
    entity_id: input_select.harmony_activity

action:
  - action: file.read_file
    data:
      file_name: harmony_5872655.conf
      file_encoding: JSON
    response_variable: harmony_data

  - variables:
      harmony: "{{ harmony_data.data }}"
      activity_name: "{{ states('input_select.harmony_activity') }}"
      activity_id: >
        {% for id, name in harmony.Activities.items() %}
          {% if name == activity_name %}
            {{ id }}
          {% endif %}
        {% endfor %}

  - service: remote.turn_on
    target:
      entity_id: remote.huiskamer
    data:
      activity: "{{ activity_id }}"
 

7. Activiteit stoppen bij PowerOff

yaml
 
alias: Harmony – Stop Activity On Selection
trigger:
  - platform: state
    entity_id: input_select.harmony_activity
    to: "PowerOff"

action:
  - service: remote.turn_off
    target:
      entity_id: remote.huiskamer
 

Resultaat

Met deze setup heb je:

  • volledig dynamische Harmony‑integratie
  • dropdowns per apparaat met alle commando’s
  • directe uitvoering bij selectie
  • één automation voor alle devices
  • automatische activiteitenlijst
  • start/stop activiteiten via dropdown

Dit is de meest complete en onderhoudsvrije Harmony‑integratie voor Home Assistant.

Loading