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