Page 1 of 3

Home Assistant Agent for Media Device Types?

PostPosted: Mon Mar 11, 2024 6:00 am
by vtmikel
Moving from Indigo would be way too much of a disruption for me at this point. I'm banking on a strategy of using HA plugins with the Home Assistant Agent plugin that FlyingDiver built to bring those devices to Indigo. The problem is that strategy does not work for a non-standard device, like the Onkyo. We can bring the device over from HA, but the actions would be missing to control the AVR.

Re: Upgrade to Python 3?

PostPosted: Mon Mar 11, 2024 8:00 am
by srkinard
vtmikel wrote:
Moving from Indigo would be way too much of a disruption for me at this point. I'm banking on a strategy of using HA plugins with the Home Assistant Agent plugin that FlyingDiver built to bring those devices to Indigo. The problem is that strategy does not work for a non-standard device, like the Onkyo. We can bring the device over from HA, but the actions would be missing to control the AVR.


I tried this...and after a short time the HA Agent plugin would spike IndigoServer to the point of becoming unresponsive. The more HA devices added to Indigo, the faster it happened. I just didn't feel like troubleshooting.

But it took me a while to finally decide to just redo it all...I love Indigo in a lot of ways so it was a tough choice

Re: Upgrade to Python 3?

PostPosted: Mon Mar 11, 2024 8:17 am
by FlyingDiver
vtmikel wrote:
Moving from Indigo would be way too much of a disruption for me at this point. I'm banking on a strategy of using HA plugins with the Home Assistant Agent plugin that FlyingDiver built to bring those devices to Indigo. The problem is that strategy does not work for a non-standard device, like the Onkyo. We can bring the device over from HA, but the actions would be missing to control the AVR.


That's probably because I have not attempted to implement any kind of media device type from HA. What exactly is the Home Assistant device type for the AVR?

Re: Upgrade to Python 3?

PostPosted: Mon Mar 11, 2024 11:45 am
by vtmikel
FlyingDiver wrote:
vtmikel wrote:
Moving from Indigo would be way too much of a disruption for me at this point. I'm banking on a strategy of using HA plugins with the Home Assistant Agent plugin that FlyingDiver built to bring those devices to Indigo. The problem is that strategy does not work for a non-standard device, like the Onkyo. We can bring the device over from HA, but the actions would be missing to control the AVR.


That's probably because I have not attempted to implement any kind of media device type from HA. What exactly is the Home Assistant device type for the AVR?


I just assumed this would be a nightmare, but maybe it's not?

The HA type is a media_player (https://www.home-assistant.io/integrati ... ia_player/)
I noticed that the Onkyo integration creates an Entity, not a Device.

Re: Upgrade to Python 3?

PostPosted: Mon Mar 11, 2024 11:48 am
by FlyingDiver
vtmikel wrote:
I just assumed this would be a nightmare, but maybe it's not?

The HA type is a media_player (https://www.home-assistant.io/integrati ... ia_player/)
I noticed that the Onkyo integration creates an Entity, not a Device.


HA does multiple entities for any one physical device. Devices are physical, entities are the HA internal reference.

My initial implementation only did entity types that had a (more or less) one to one correlation with native Indigo device types. Indigo doesn't have a media-player device type.

Let me take a look at the media player entity type and see what I can do with it.

Re: Upgrade to Python 3?

PostPosted: Mon Mar 11, 2024 12:03 pm
by FlyingDiver
In your Indigo client, please use the menu command that writes the HA entity info to the log. Then search for the media_player section, and post that entire section to this thread.

Re: Upgrade to Python 3?

PostPosted: Mon Mar 11, 2024 12:11 pm
by vtmikel
FlyingDiver wrote:
In your Indigo client, please use the menu command that writes the HA entity info to the log. Then search for the media_player section, and post that entire section to this thread.


I'm using v2023.3.2 of your plugin. When I click to write to log, nothing happens. Did this get fixed in your latest release? Unfortunately I'm stuck on Indigo 2022.2 because of the Onkyo integration.

If no other way, I can fire up the latest Indigo on a new config to get this log.

Re: Upgrade to Python 3?

PostPosted: Mon Mar 11, 2024 12:30 pm
by FlyingDiver
vtmikel wrote:
I'm using v2023.3.2 of your plugin. When I click to write to log, nothing happens. Did this get fixed in your latest release? Unfortunately I'm stuck on Indigo 2022.2 because of the Onkyo integration.

If no other way, I can fire up the latest Indigo on a new config to get this log.


I don't recall that any bugs with that function. It certainly works on the current release. If you can upgrade temporarily to get that info, I'd appreciate it.

Re: Upgrade to Python 3?

PostPosted: Mon Mar 11, 2024 12:32 pm
by FlyingDiver
I've requested the Indigo team move the latest posts in this thread about using HAA to the HAA forum.

Re: Upgrade to Python 3?

PostPosted: Mon Mar 11, 2024 1:12 pm
by vtmikel
FlyingDiver wrote:
vtmikel wrote:
I'm using v2023.3.2 of your plugin. When I click to write to log, nothing happens. Did this get fixed in your latest release? Unfortunately I'm stuck on Indigo 2022.2 because of the Onkyo integration.

If no other way, I can fire up the latest Indigo on a new config to get this log.


I don't recall that any bugs with that function. It certainly works on the current release. If you can upgrade temporarily to get that info, I'd appreciate it.


I was a dummy, I had the plugin config set to Error Messages only. Here's the log. Not that while you see only one source listed here, there will be multiple and user-specific. You can see how the HA plugin allows for configurable sources here: https://www.home-assistant.io/integrations/onkyo/


Code: Select all
        "receiver": {
            "attributes": {
                "friendly_name": "receiver",
                "source_list": [
                    "Playstation 3"
                ],
                "supported_features": 20364
            },
            "context": {
                "id": "01HRQA79J0V1PRQ0027SF008PJ",
                "parent_id": null,
                "user_id": null
            },
            "entity_id": "media_player.receiver",
            "last_changed": "2024-03-11T17:51:00.672765+00:00",
            "last_updated": "2024-03-11T17:51:00.672765+00:00",
            "state": "off"
        },
        "receiver_zone_2": {
            "attributes": {
                "friendly_name": "receiver Zone 2",
                "source_list": [
                    "Playstation 3"
                ],
                "supported_features": 20364
            },
            "context": {
                "id": "01HRQA79MNBYW8KQKF9XSNKND5",
                "parent_id": null,
                "user_id": null
            },
            "entity_id": "media_player.receiver_zone_2",
            "last_changed": "2024-03-11T17:51:00.757252+00:00",
            "last_updated": "2024-03-11T17:51:00.757252+00:00",
            "state": "off"
        },


Re: Upgrade to Python 3?

PostPosted: Mon Mar 11, 2024 1:18 pm
by FlyingDiver
That was all wrapped by the "media_player" section, right? Just those two entries in it? Bummer, apparently that integration doesn't include the "device_class" attribute, which is really useful.

Re: Upgrade to Python 3?

PostPosted: Mon Mar 11, 2024 1:20 pm
by vtmikel
Correct, all in the media_player. I have a bunch of Sonos's and random devices I dont use in that section, which I didn't post.

Also, this is what it looks like when the device is on:

Code: Select all
        "receiver": {
            "attributes": {
                "audio_information": {
                    "format": "PCM",
                    "input_channels": "2.0 ch",
                    "input_frequency": "44.1 kHz",
                    "listening_mode": "All Ch Stereo",
                    "output_channels": "4.0 ch",
                    "output_frequency": ""
                },
                "friendly_name": "receiver",
                "is_volume_muted": false,
                "source": "cd_tv/cd",
                "source_list": [
                    "Playstation 3"
                ],
                "supported_features": 20364,
                "video_information": {
                    "input_color_depth": "24bit",
                    "input_color_schema": "",
                    "input_resolution": "Unknown",
                    "output_color_depth": "24bit",
                    "output_color_schema": "",
                    "output_resolution": "0 x 0p",
                    "picture_mode": ""
                },
                "video_out": "yes,out",
                "volume_level": 1.625
            },
            "context": {
                "id": "01HRQF5CZ30J9ZGBKYCKCTHJVR",
                "parent_id": null,
                "user_id": null
            },
            "entity_id": "media_player.receiver",
            "last_changed": "2024-03-11T19:17:09.358009+00:00",
            "last_updated": "2024-03-11T19:17:21.507038+00:00",
            "state": "on"
        },


Re: Upgrade to Python 3?

PostPosted: Mon Mar 11, 2024 1:24 pm
by vtmikel
FlyingDiver wrote:
That was all wrapped by the "media_player" section, right? Just those two entries in it? Bummer, apparently that integration doesn't include the "device_class" attribute, which is really useful.


I see what you mean, because here is an example of my Denon AVR:

Code: Select all
        "denon_avr_x3700h": {
            "attributes": {
                "device_class": "receiver",
                "friendly_name": "Basement AVR - Denon AVR-X3700",
                "sound_mode_list": [
                    "MUSIC",
                    "MOVIE",
                    "GAME",
                    "AUTO",
                    "STANDARD",
                    "VIRTUAL",
                    "MATRIX",
                    "ROCK ARENA",
                    "JAZZ CLUB",
                    "VIDEO GAME",
                    "MONO MOVIE",
                    "DIRECT",
                    "PURE DIRECT",
                    "DOLBY DIGITAL",
                    "DTS SURROUND",
                    "AURO3D",
                    "AURO2DSURR",
                    "MCH STEREO",
                    "STEREO",
                    "ALL ZONE STEREO"
                ],
                "source_list": [
                    "Basement AppleTV",
                    "Basement Roku",
                    "Bluetooth",
                    "HEOS Music",
                    "Sonos",
                    "TV Audio",
                    "ZIDOO"
                ],
                "supported_features": 69004
            },
            "context": {
                "id": "01HRQ9798K1P320BCEPJWPHQWF",
                "parent_id": null,
                "user_id": null
            },
            "entity_id": "media_player.denon_avr_x3700h",
            "last_changed": "2024-03-11T17:33:31.795389+00:00",
            "last_updated": "2024-03-11T17:33:31.795389+00:00",
            "state": "off"
        },



And with the device on:

Code: Select all
        "denon_avr_x3700h": {
            "attributes": {
                "device_class": "receiver",
                "friendly_name": "Basement AVR - Denon AVR-X3700",
                "is_volume_muted": false,
                "media_content_type": "channel",
                "media_title": "Sonos",
                "sound_mode": "DTS SURROUND",
                "sound_mode_list": [
                    "MUSIC",
                    "MOVIE",
                    "GAME",
                    "AUTO",
                    "STANDARD",
                    "VIRTUAL",
                    "MATRIX",
                    "ROCK ARENA",
                    "JAZZ CLUB",
                    "VIDEO GAME",
                    "MONO MOVIE",
                    "DIRECT",
                    "PURE DIRECT",
                    "DOLBY DIGITAL",
                    "DTS SURROUND",
                    "AURO3D",
                    "AURO2DSURR",
                    "MCH STEREO",
                    "STEREO",
                    "ALL ZONE STEREO"
                ],
                "sound_mode_raw": "DTS Neural:X",
                "source": "Sonos",
                "source_list": [
                    "Basement AppleTV",
                    "Basement Roku",
                    "Bluetooth",
                    "HEOS Music",
                    "Sonos",
                    "TV Audio",
                    "ZIDOO"
                ],
                "supported_features": 69004,
                "volume_level": 0.74
            },
            "context": {
                "id": "01HRQFKZB2V0RB26KZSR7HR0KG",
                "parent_id": null,
                "user_id": "920aed0d63a44b8e8049fcfcc9c17115"
            },
            "entity_id": "media_player.denon_avr_x3700h",
            "last_changed": "2024-03-11T19:25:19.085451+00:00",
            "last_updated": "2024-03-11T19:25:19.085451+00:00",
            "state": "on"
        },

Re: Upgrade to Python 3?

PostPosted: Mon Mar 11, 2024 1:29 pm
by vtmikel

Re: Upgrade to Python 3?

PostPosted: Mon Mar 11, 2024 1:55 pm
by FlyingDiver
vtmikel wrote:


Yeah, but I already knew how to find the defs for that field. :D