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

Objective: Control the devices using Logitech Harmony Hub.
Requirements: YIO Remote and Dock, Logitech Harmony Hub and Home Assistant (integration v0.5.2).
Method: In YIO web configurator we will work in the remote entity (advanced in menu) for control each device. Remember to always back-up the config file in case of some error.

  1. Edit the configuration file.

    The “integration/someID” = your ID of Home Assistant, scroll down in your YIO config-file to find that.

In commands the “device” is your actual hardware (ex. Shield), the ID you will find in the Harmony config file in Home Assistant (see image). Update the code depending on which buttons you need to map from your remote control. For example is “DirectionDown” matched with the feature “CURSOR_DOWN”.


For the audio (vol up/down/mute), I will always match my receiver device. I will include a link below to which buttons that YIO currently support.

The Logitech Harmony Hub is blasting the IR to the devices and YIO Remote talks with it using Home Assistant. Therefore you don’t need to point the YIO Remote to an actual device.

  1. Add the entities to your profile and page
    Create a page (TV) and a group (Remote control). After the configuration is saved it will automatically create new entities and you can do the “drag and drop” as normally for all entities with Home Assistant.

  1. Summary
    I have got a lot of help by @marton and @mKeRiX who did update the integration for Home Assistant regarding the remote entity. Since we only get one “entity_ID” from our Harmony Hub, the solution is to add + something in our configuration file in remote entity. With that solution each device get’s an unique “entity_ID” and therefore can be added in YIO pages. Since the “entity_ID” needs to be unique in Home Assistant.

  2. Useful links:

3 Likes

Great! We can use that for the Bluetooth Control Function of the Harmony hub… But why do we need home Assistant?

The Harmony Hub offers an API…Or is there any other Binding available?

Greetings

@DerPicknicker If your device is added by bluetooth in Harmony Hub it will use that. I’m using Home Assistant for integrate the Harmony Hub. That integration makes me send commands using their API in a simple way. I also use Home Assistant for other smart devices.

If you have the knowledge you could create an integration for YIO using the Harmony Hub API/CLI.