Alexa Skill - TV group members & group item are both discovered by Alexa

Hi,

OH3.2.0

My general understanding is, that for group items Alexa will only discover one device per group.
Since 2 or 3 weeks (not 100% sure if this happened at the same time when the new skill was released) in addition to my TV group item Alexa also shows all the individual group members as additional devices.

The TV group itself is continuing to work as expected and I have disabled the additional items in the Alexa app, therefore I do not have any issues with this situation. But as I was not sure if this is by design or not, or maybe will create additional issues in future, I thought its worth to report this behavior.

I have already removed the group device and individual devices & rediscovered, but behavior did not changed.

Here is my item definition (I have removed the options from the channel & application items to shorten it):

{
  "members": [
    {
      "link": "https://XXX/rest/items/EGWohnzimmerFernseher_Mute",
      "state": "OFF",
      "metadata": {
        "alexa": {
          "value": "Television.MuteState"
        }
      },
      "type": "Switch",
      "name": "EGWohnzimmerFernseher_Mute",
      "label": "Fernseher Stumm",
      "category": "SoundVolume",
      "tags": [
        "Switch"
      ],
      "groupNames": [
        "EGWohnzimmerFernseher"
      ]
    },
    {
      "link": "https://XXX/rest/items/EGWohnzimmerFernseher_Volume",
      "state": "19",
      "stateDescription": {
        "minimum": 0,
        "maximum": 100,
        "pattern": "%.0f",
        "readOnly": false,
        "options": []
      },
      "metadata": {
        "alexa": {
          "value": "Television.VolumeLevel"
        }
      },
      "type": "Dimmer",
      "name": "EGWohnzimmerFernseher_Volume",
      "label": "Fernseher Lautstärke",
      "category": "SoundVolume",
      "tags": [
        "Switch",
        "SoundVolume"
      ],
      "groupNames": [
        "EGWohnzimmerFernseher"
      ]
    },
    {
      "link": "https://XXX/rest/items/EGWohnzimmerFernseher_MediaControl",
      "state": "PLAY",
      "metadata": {
        "alexa": {
          "value": "Television.Playback"
        }
      },
      "type": "Player",
      "name": "EGWohnzimmerFernseher_MediaControl",
      "label": "Fernseher Media Control",
      "category": "MediaControl",
      "tags": [
        "Control"
      ],
      "groupNames": [
        "EGWohnzimmerFernseher"
      ]
    },
    {
      "link": "https://XXX/rest/items/EGWohnzimmerFernseher_Power",
      "state": "OFF",
      "metadata": {
        "alexa": {
          "value": "Television.PowerState"
        }
      },
      "type": "Switch",
      "name": "EGWohnzimmerFernseher_Power",
      "label": "Fernseher An / Aus",
      "category": "switch",
      "tags": [
        "Switch",
        "Power"
      ],
      "groupNames": [
        "EGWohnzimmerFernseher"
      ]
    },
    {
      "link": "https://XXX/rest/items/EGWohnzimmerFernseher_Channel",
      "state": "7_88_3_0_1089_12003_1",
      "stateDescription": {
        "pattern": "%s",
        "readOnly": false,
      },
      "metadata": {
        "alexa": {
          "value": "Television.Channel"
        }
      },
      "type": "String",
      "name": "EGWohnzimmerFernseher_Channel",
      "label": "Fernseher Sender",
      "category": "",
      "tags": [
        "Switch"
      ],
      "groupNames": [
        "EGWohnzimmerFernseher"
      ]
    },
    {
      "link": "https://XXX/rest/items/EGWohnzimmerFernseher_Application",
      "state": "UNDEF",
      "stateDescription": {
        "pattern": "%s",
        "readOnly": false,
      },
      "metadata": {
        "alexa": {
          "value": "Television.Input"
        }
      },
      "type": "String",
      "name": "EGWohnzimmerFernseher_Application",
      "label": "EG Wohnzimmer Fernseher Input",
      "category": "",
      "tags": [
        "Point"
      ],
      "groupNames": [
        "EGWohnzimmerFernseher"
      ]
    }
  ],
  "link": "https://XXX/rest/items/EGWohnzimmerFernseher",
  "state": "NULL",
  "metadata": {
    "alexa": {
      "value": "Television"
    }
  },
  "editable": true,
  "type": "Group",
  "name": "EGWohnzimmerFernseher",
  "label": "Fernseher",
  "category": "",
  "tags": [
    "Television"
  ],
  "groupNames": [
    "Wohnzimmer"
  ]
}

This is an odd behavior. I am unable to reproduce your issue using your item definition (including semantic models) although using the latest 3.3 snapshot but I don’t expect any differences. What do you mean by disabled the additional devices? Have you tried to remove all your OH related devices and trigger a discovery? Out of curiosity does your Wohnzimmer group item have an Alexa metadata configuration?

On a side note, I am currently making some changes to the Channel attribute to improve the support for String-based channel items. I’m intrigued by the state 7_88_3_0_1089_12003_1 of your EGWohnzimmerFernseher_Channel item. Which binding are you using to control the channel and also what does that value represents?

Before and after the update of the skill I have used Alexa metadata, therefore I did not expected any impact while reading the notes.

However I have just tried again to remove the tv device & the duplicate devices from Alexa and start a rediscovery:

If the group item has Alexa metadata, than no device is found during discovery. If I remove the Alexa metadata from the group, then it will discover 6 individual devices (= all the members of the oh group, as they have individual metadata) and the group is ignored due to missing metadata.

Therefore it more seems that there is an issue with the group and/or television device type.

Is there any way to lookup a logfile or putting Alexa into a debug mode to see what’s happening?

Removing all OH devices:
To be honest I want to avoid this, as this would break all the routines and groups I have created within Alexa, therefore I hoped that it is enough of I only remove the TV device from Alexa.

Regarding disabling:
At the time when I had all the items discovered two times, I have disabled within the Alexa app the duplicated devices (linked to the group members) and only keep the old TV device (that’s linked to the group) active (to avoid the Alexa will mix up the devices).

Other:
The parent group Wohnzimmer does not have Alexa metadata.

The TV is a LG device using the WebOS binding.
The channel is some internal ID, that is part of the options & commandOptions. Here is the relevant part with a few samples, I have removed the remaining definition to keep it short

{
  "link": "https://XXX/rest/items/EGWohnzimmerFernseher_Channel",
  "state": "7_88_3_0_1089_12003_1",
  "stateDescription": {
    "pattern": "%s",
    "readOnly": false,
    "options": [
      {
        "value": "7_70_1_0_1019_10301_1",
        "label": "1 - Das Erste HD"
      },
      {
        "value": "7_66_2_0_1011_11110_1",
        "label": "2 - ZDF HD"
      },
      {
        "value": "7_88_3_0_1089_12003_1",
        "label": "3 - RTL Television"
      }
      ]
  },
  "commandDescription": {
    "commandOptions": [
      {
        "command": "7_70_1_0_1019_10301_1",
        "label": "1 - Das Erste HD"
      },
      {
        "command": "7_66_2_0_1011_11110_1",
        "label": "2 - ZDF HD"
      },
      {
        "command": "7_88_3_0_1089_12003_1",
        "label": "3 - RTL Television"
      }
      ]
    }

1 Like

The latter is expected. Related to the former, I cannot reproduce. Actually, since it’s a functional group (no group type), it doesn’t matter if it’s part of group configured for Alexa. It should be discovered as a group endpoint. So my original question related to the parent group is irrelevant.

How are you determining the device isn’t discovered on the Alexa side? Have you tried to rename the group item name and label?

After discovery the Alexa app told me that nothing was found and in addition I have manually checked the list of all devices, if the TV is available or not.

But my raspberries SD card died this morning, therefore I have reinstalled openhab on a new card, applied the backup and everything is working fine now.

1 Like

I’m using openHAB 3.4.0.M2 - Milestone Build and I’m having the same issue however, I believe it has nothing to do with TV device type. It has to do with using Equipment groups vs traditional groups (non-semantic groups).

For ease of troubleshooting, I use the Alexa web interface instead of the Alexa app:
https://alexa.amazon.com/spa/index.html#appliances

In my case I’m using Contact Sensors. I have tested this with virtual items as well as real device items. When I configure an alexa-enabled group for the contact sensor via the items file, Alexa discovers only the group and everything works as expected. Here’s the config:

Group  contact_sensor           "Contact Sensor"                {alexa="ContactSensor"}
Switch contact_sensor_state     "State"         (contact_sensor) {alexa="ContactSensor.ContactDetectionState"}
Number contact_sensor_battery   "Battery Level" (contact_sensor) {alexa="ContactSensor.BatteryLevel"}

This is what I see in the Alexa web-interface:

And this is what I see in the group metadata in OH UI:

Notice how the group metadata also displays the Group Endpoint Capabilities.

Using the real contact sensor called “Back Gate” with the same metadata for the equipment group and the items:



Notice how it does not show the Group Endpoint Capabilities.

Then I did another test by creating a non-semantic group and adding the real device items above without changing anything.

Group   BackGateSensorAlexa     "Test Gate"                     {alexa="ContactSensor"}



Notice how now it shows the Group Endpoint Capabilities properly.
I also tried creating a non-semantic group from the OH UI and everything works as expected.

Again, this has to do using semantic vs non-semantic groups.

Thoughts?

If the behavior would really be different because of semantic model, then the behavior for the same group / item wills need to change of you add/remove the semantic properties. Maybe try this (and make sure to remind your items from Alexa again and run a full rediscovery).

Also I would compare the code of the metadata and not what’s down in the GUI. Maybe even in the current setup you spot some differences not visible in the GUI version

This is a UI display bug when accessing the Alexa metadata directly from the equipment model level. If you select the item attached to that model and then go into the metadata configuration, the “Group Endpoint Capabilities” section will be displayed. The underlying configuration is not affected and has no impact on how the device is discovered on the Alexa side.

Actually, while troubleshooting further the display issue seem to have disappeared. I can now see the “Group Endpoint Capabilities” section at the equipment model level. It seems a full refresh of my Main UI session did the trick.

I ended up removing the groups in question and recreated them by using “Create equipment from thing”.

Now all of them are behaving as expected.