Quantcast
Channel: Configuration - Home Assistant Community
Viewing all articles
Browse latest Browse all 101645

Logitech Harmony commands based on activity

$
0
0

@dgaust wrote:

Hi,

I’m going through building a UI for a basic remote based on the logitech harmony. I’m wondering if there is an easy way to send command based on the current activity rather than send the command to a selected device.

For example, if the activity is Play Xbox the commands for up, down, left and right need to be sent to the xbox device. However, if the activity is Watch Fetch, those commands need to be sent to the Fetch TV box. The physical remote is setup to do this, but I cannot find a service option to send command to an activity (so the hub can decide the code) rather than device.

At the moment I’ve simulated this by using scripts like this

'1579329073616':
  alias: HarmonyButtonEnter
  sequence:
  - service: remote.send_command
    data_template:
      entity_id: remote.lounge
      command: >
          {% if is_state("sensor.currentactivity", "Watch TV") %} 
            OK
          {% elif is_state("sensor.currentactivity", "Watch Fetch") %} 
            Select
          {% elif is_state("sensor.currentactivity", "Play Xbox") %} 
            Ok
          {% else %}
            Ok
          {% endif %}
      device: >
          {% if is_state("sensor.currentactivity", "Watch TV") %} 
            38539290
          {% elif is_state("sensor.currentactivity", "Watch Fetch") %} 
            38539289
          {% elif is_state("sensor.currentactivity", "Play Xbox") %} 
            46058342
          {% else %}
            38539290
          {% endif %}

But that means creating a script for every option, and then calling that script from a button in the UI.

Am I overcomplicating it, or is this the only approach?

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 101645

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>