Extra keys error with Logitech Harmony 'Current Activity' sensor

Hi all, I’ve been getting the warning regarding extra keys since updating to 0.88, relating to my custom sensor to monitor my Harmony Hub’s current activity, the sensor is currently working fine but I saw the warning that it will break in the next release:

Your configuration contains extra keys that the platform does not support.
Please remove [app_id], [app_key], [queries]. (See C:\Homeassistant\sensor.yaml, line 5)

The section of my sensors.yaml in question:

- platform: template
  sensors:
    current_activity:
      friendly_name: 'Harmony Activity'
      value_template: "{{ states.remote.harmony_hub.attributes.current_activity }}"

How can I solve the problem whilst still being able to query the current_activity attribute of the hub? Thanks in advance

what config do you have for the harmony hub?

Relevant config snippets are below and the warning message specifically refers to the ‘value_template’ field shown in my original post

scripts.yaml:

input_select_harmony:
  alias: Start activity from input select
  sequence:
  - service: remote.turn_on
    data_template:
      entity_id: remote.harmony_hub
      activity: "{% if is_state(\"input_select.harmony\", \"PowerOff\") %}\n    -1\n\
        {% elif is_state(\"input_select.harmony\", \"Watch TV\") %}\n    27258281\n\
        {% elif is_state(\"input_select.harmony\", \"Watch Kodi Livingroom\") %}\n\
        \    27265761\n{% elif is_state(\"input_select.harmony\", \"Watch Smart TV\"\
        ) %}\n    31840527\n{% endif %}"

input_select.yaml:

harmony:
  name: Harmony Control
  options:
    - Select Input
    - Watch TV
    - Watch Kodi Livingroom
    - Watch Smart TV
    - PowerOff
  icon: mdi:monitor

automations.yaml:

- id: 6804350d23484e9797d0f9d1bf78cc5d
  alias: Remote external update living room
  initial_state: true
  trigger:
  - entity_id: remote.harmony_hub
    from: '*'
    platform: state
    to: '*'
  action:
  - data_template:
      entity_id: input_select.harmony
      option: '{{ states.remote.harmony_hub.attributes.current_activity }}'
    service: input_select.select_option

Review the list of valid options (keys) for Harmony Hub Remote. The list does not include: app_id, app_key, and queries.

Look in your configuration.yaml file and find an entry similar to this:

remote:
  - platform: harmony

Revise the options it contains so they conform with the documentation (i.e. remove the three invalid options).

Thanks but Harmony is now setup by discovery so I no longer need to use a manual entry for it in my configuration.yaml

So the automatic discovery of Harmony Hub Remote includes options that Home Assistant considers invalid? Sounds like a potential bug.

Can you post the first few lines of C:\Homeassistant\sensor.yaml because Home Assistant seems to be complaining about something on line 5 (or thereabouts).

Line 5 is ‘value_template’ (see below). This grabs the ‘current activity’ of the harmony hub

- platform: template
  sensors:
    current_activity:
      friendly_name: 'Harmony Activity'
      value_template: "{{ states.remote.harmony_hub.attributes.current_activity }}"

Don’t worry, I’ve fixed it, it wasn’t the harmony entry at all, there were some entries much further down (line 23 & 24) which weren’t properly commented out, not sure why it was reporting them as line 5 though!?

#- platform: uk_transport
  app_id: XXX
  app_key: XXX
  queries:
    - mode: train
      origin: STP
      destination: AFK

Well, this is the comment that threw us me off:

That’s why I asked to see the contents of C:\Homeassistant\sensor.yaml since it was sensor-related.

Home Assistant isn’t always precise when it reports an ‘offending line number’. That’s why I included “or thereabouts” because the reported line number might be several lines away from the trouble spot. My guess is that, in this case, line 5 contains the start of another entity’s definition. Because only this line was commented out #- platform: uk_transport its options (app_id, etc) were considered to be part of the previous entity.

Glad to hear it’s resolved.

It was your “thereabouts” comment that pointed me in the right direction as I’d been focusing purely on line 5 which referred to the harmony hub…so thanks for that.

Will teach me to be less lazy when commenting out old lines.

Thanks