Yio Remote Community

YIO Remote with Logitech Harmony Hub and Home Assistant

Requirements: YIO Remote and Dock, Logitech Harmony Hub and Home Assistant.
Objective: Start activities from Harmony using the YIO Remote screen.

1. Logitech Harmony Hub
Setup your devices and create your activities using their official app.

2. Install Home Assistant

  • I did install it on my Raspberry Pi 3 Model B with an SD-card. I did follow their official instructions from here.

  • In the menu press “configuration” and then at integrations. Search for the Logitech Harmony Hub and install it. Press on entities at configuration and write down your “entity ID” from your Harmony Hub (mine is remote.harmony_hub).

  • In the menu press supervisor and then at Add-on Store. Search for File editor and install it. A new button will appear at the menu. You will need this to edit the Home Assistant files and create new ones.

  • I did follow an tutorial in HA forum from here. I did edit the code to fit my “entity ID” and activities “name”.

  • In File-editor press the top-left button (folder) and visit your Harmony config file. You will need the name of all activities later so copy them. Press folder and press configuration.yaml.

    switch: !include switch.yaml
    
    # Logitech Harmony Hub
    remote:
    - platform: harmony
      name: Harmony Hub
      host: 192.168.1.X (HUB IP-ADDRESS)
    
    sensor:
    - platform: template
    sensors:
    harmony_activity:
      value_template: >
        {% if is_state("remote.harmony_hub", 'on') %}
          {{ states.remote.harmony_hub.attributes.current_activity }}
        {% else %}
          PowerOff
            {% endif %}
    

Create an folder name “www” and then “images” inside it. Upload the images there in 1200x800px format.

Create an switch.yaml file and add following code.

- platform: template
switches:
    # APPLE TV / HARMONY ACTIVITY
    apple_tv:
      friendly_name: 'Apple TV4K'
      value_template: "{{ is_state_attr('remote.harmony_hub', 'current_activity', 'Apple TV4K') }}"
      turn_on:
        service: remote.turn_on
        data:
          entity_id: remote.harmony_hub
          activity: 'Apple TV4K'
      turn_off:
        service: remote.turn_on
        data:
          entity_id: remote.harmony_hub
          activity: 'PowerOff'
    
    # PS4 / HARMONY ACTIVITY
    ps4:
      friendly_name: 'PS4'
      value_template: "{{ is_state_attr('remote.harmony_hub', 'current_activity', 'PS4') }}"
      turn_on:
        service: remote.turn_on
        data:
          entity_id: remote.harmony_hub
          activity: 'PS4'
      turn_off:
        service: remote.turn_on
        data:
          entity_id: remote.harmony_hub
          activity: 'PowerOff'
    
    # SHIELD TV / HARMONY ACTIVITY
    shield_tv:
      friendly_name: 'NVIDIA SHIELD'
      value_template: "{{ is_state_attr('remote.harmony_hub', 'current_activity', 'SHIELD TV') }}"
      turn_on:
        service: remote.turn_on
        data:
          entity_id: remote.harmony_hub
          activity: 'SHIELD TV'
      turn_off:
        service: remote.turn_on
        data:
          entity_id: remote.harmony_hub
          activity: 'PowerOff'
    
    # BLURAY / HARMONY ACTIVITY
    bluray:
      friendly_name: 'Denon Bluray'
      value_template: "{{ is_state_attr('remote.harmony_hub', 'current_activity', 'Bluray') }}"
      turn_on:
        service: remote.turn_on
        data:
          entity_id: remote.harmony_hub
          activity: 'Bluray'
      turn_off:
        service: remote.turn_on
        data:
          entity_id: remote.harmony_hub
          activity: 'PowerOff'
    
    # Sonos Connect / HARMONY ACTIVITY
    sonos:
      friendly_name: 'Sonos Connect'
      value_template: "{{ is_state_attr('remote.harmony_hub', 'current_activity', 'Sonos Connect') }}"
      turn_on:
        service: remote.turn_on
        data:
          entity_id: remote.harmony_hub
          activity: 'Sonos Connect'
      turn_off:
        service: remote.turn_on
        data:
          entity_id: remote.harmony_hub
          activity: 'PowerOff'

Replace “entity_id” with your ID and activity names.

Visit the homepage of the Home Assistant, press the top-right button in the corner and then press “Configure UI”. Then press the top-right button again with 3-dots and choose “raw configuration editor”.
Add this following code:

 title: Media
 views:
 - cards:
  - cards:
      - entities:
          - switch.apple_tv
          - switch.ps4
          - switch.shield_tv
          - switch.bluray
          - switch.sonos
        entity: sensor.harmony_activity
        state_image:
          Apple TV4K: /local/images/appletv_logo.png
          Bluray: /local/images/denon_bluray_logo.png
          PS4: /local/images/playstation_logo.png
          PowerOff: /local/images/power_off.png
          SHIELD TV: /local/images/nvidia_logo.png
          Sonos Connect: /local/images/sonos_logo.png
        title: Harmony
        type: picture-glance
    type: vertical-stack

Then save and exit the editor. At the homepage you will now see the switches with your activities.

3. YIO Remote – Web configurator
On your YIO Remote go to settings and allow editing using the web configurator. Visit that IP-address in your browser. Add the integration for Home Assistant and add it’s installed “IP-address:8123”.
Now you can see your created switches as entities in the menu and all the activities. Then visit your profile and drag & drop where you want them on your remote.
Now everything should be working and updated on your screen. Sometimes the Home Assistant needs to be restarted for get all the changes, especially images.

In some cases it’s easier to copy the code from the link described, as Home Assistant can be sensitive to spaces in the code. I did add friendly names so it’s looks better in the UI at YIO.

If you have any questions regarding this tutorial then just ask me. I started from scratch and did just try the code and adapt until it worked as expected. I did get a lot of help from Marton since I’m new to Home Assistant and YIO :slight_smile: The start of activities and switch between them have worked great so far. My next step is to control the devices with IR.

Useful links:
Logitech Harmony Hub @ Home Assistant press here.

3 Likes