Harmony Remote

Hi,

I have a logitech harmony hub with some activities assigned, and presented to HA

Is it possible to toggle these activities in homehabit, like create buttons in on my dashboard for them? I cannot seem to find a way to do it

@buzurk what kind of entities are those activities in HA?

The entity is remote.theatreroom

The calls i believe are activity calls, as the harmony hub is a UI based i integration into HA

You certainly can. Ive done it in a couple of ways.

  1. input select in ha, and automations
    Create an input selection in ha with an entry for each activity, plus off. Then create automations that are triggered when the input selection is set to something and have the action to fire the harmony remote service to start an activity.
    You can add further automations which are triggered when harmony activity starts changes, to set the input select to the right option, so that the input select is correct even when harmony is controlled from elsewhere.
    Then add a scene in HH and bind it to the input select

  2. Template switches in ha
    Create a template switch which takes its state from whether the current harmony activity is set to the activity you wish to control. Then set the turn on behaviour to be calling the remote service to start an activity. Set the turn off value to being the remote service to turn off the harmony activities.
    Then add a switch to HH and bind it to the template switch.

1 Like

Great info, thank you ill try work those out :wink:

My automation for the scene option if it helps:
Looks like I use a template sensor too, just to more easily pull out the active activity from harmony:
Automations.yaml includes:

- alias: cinema_room_scene_automation
  trigger:
    platform: state
    entity_id: input_select.cinema_room_scenes
  action:
    service: remote.turn_on
    data_template:
      entity_id: remote.cinema_room
      activity: >
        {% if is_state("input_select.cinema_room_scenes", "Chromecast") %}
          Cinema Room Chromecast
        {%-elif is_state("input_select.cinema_room_scenes", "NintendoSwitch") %}
          Cinema Room Switch
        {%-elif is_state("input_select.cinema_room_scenes", "PS4") %}
          Cinema Room PS4
        {%-elif is_state("input_select.cinema_room_scenes", "Roku") %}
          Cinema Room Roku
        {%-elif is_state("input_select.cinema_room_scenes", "PS3") %}
          Cinema Room PS3
        {%-elif is_state("input_select.cinema_room_scenes", "LiveTV") %}
          Cinema Room Humax
        {% else %}
          PowerOff
        {% endif %}

- alias: cinema_room_scene_automation_sync
  trigger:
    platform: state
    entity_id: sensor.cinema_room_state
  action:
    - service: input_select.select_option
      data_template:
        entity_id: input_select.cinema_room_scenes
        option: >
          {% if is_state('sensor.cinema_room_state', 'Cinema Room Chromecast') %}
            Chromecast
          {%-elif is_state('sensor.cinema_room_state', "Cinema Room Switch") %}
            NintendoSwitch
          {%-elif is_state('sensor.cinema_room_state', "Cinema Room PS4") %}
            PS4
          {%-elif is_state('sensor.cinema_room_state', "Cinema Room Roku") %}
            Roku
          {%-elif is_state('sensor.cinema_room_state', "Cinema Room PS3") %}
            PS3
          {%-elif is_state('sensor.cinema_room_state', "Cinema Room Humax") %}
            LiveTV
          {% else %}
            False
          {% endif %}

Configuration.yaml includes:

input_select:
  cinema_room_scenes:
    options:
      - Chromecast
      - NintendoSwitch
      - PS4
      - Roku
      - PS3
      - False
    initial: False

sensor:
  - platform: template
    sensors:
      cinema_room_state:
        value_template: "{{ state_attr('remote.cinema_room', 'current_activity') }}"

Meant to post the switch too, for an individual activity:

    cinema_room_humax:
      value_template: "{{ is_state_attr('remote.cinema_room', 'current_activity', 'Cinema Room Humax') }}"
      turn_on:
        service: remote.turn_on
        data:
          entity_id: remote.cinema_room
          activity: 'Cinema Room Humax'
      turn_off:
        service: remote.turn_on
        data:
          entity_id: remote.cinema_room
          activity: 'PowerOff'

Great - thank you for that information!