Media Player Integration/Alexa/Nabu Casa

First, I have a (slightly modified) version of the Xantech Media player scripts to support my Dayton Audio DAX88. This is likely not the issue but it should be mentioned. I am using Nabu Casa and Alexa to control many things, including this device. This device has 8 zones which results in 8 media players, one for each zone. They appear perfectly in the GUI and I can do things like turn each zone on/off, vol up/down and mute on/off. It the GUI I can also select the source as it has 8 sources.

What I cannot figure out is what to say to Alexa to change the input source. I can tell Alexa:

“Turn on DAX Deck” … it works
“Set volume on DAX Deck to 30%” … it works
“Set mute to off on Dax Deck” … it works

But anything I try to do something like:

“Change Dax Deck source to Wifi” … or “Change Dax Deck input to Wifi” or anything like it does not work.

Now, I can go to Developer Tools and call the service “Media player: Select source” with the entity “Dax Deck” and set the name to “Wifi” and it works.

So I am either confused as to what exactly to say to Alexa (to go through Nabu Casa) or possibly I cannot change the source? Anyone got any hints?

1 Like

I should note that in the Configuration screen for Nabu Casa/Alexa I see this:

image

Which to me says I should be able to control the Input. As I said, I can control POwer, Volume and Mute through Alexa, just not the input

As an update, I see this in logs now:

2022-04-17 12:35:32 ERROR (MainThread) [homeassistant.components.alexa.state_report] Error when sending ChangeReport for media_player.deck_alexa to Alexa: THROTTLING_EXCEPTION: Request could not be processed due to throttling.

2022-04-17 12:35:34 ERROR (MainThread) [homeassistant.components.alexa.state_report] Error when sending ChangeReport for media_player.deck_alexa to Alexa: THROTTLING_EXCEPTION: Request could not be processed due to throttling.

So Alexa is not selecting the right media_player … humm

Hey @kbrown01, do you mind share your Xantech Media player script modification? I finally got DAX88 and trying to reproduce your setup.

Wow. Taxing my brain here but I will try.

I have a include for media_player.yaml:

- platform: xantech
  type: dax88
  port: /dev/ttyUSB0
  zones:
    11:
      name: "Kitchen"
    12:
      name: "Living Room"
    13:
      name: "Deck"
    14:
      name: "Hot Tub"
    15:
      name: "Patio"
    16:
      name: "Foyer"
    17:
      name: "Master"
    18:
      name: "Unused"
  sources:
    1:
      name: "Alexa"
    2:
      name: "MintyFresh"
    3:
      name: "Volumio"
    4:
      name: "Input 4"
    5:
      name: "Input 5"
    6:
      name: "Input 6"
    7:
      name: "Input 7"
    8:
      name: "WiFi"

That said, I know the commands slightly differ so I modified pyxantech I am sure. I will need to look and get back to you. Obviously because type of “dax88” I must have wrote.

OK … at the very least I added these to pyxantech:

dayton.yaml in protocols:

- protocol: dayton
  name: "Dayton Audio 8-Zone Amp Protocol"

  connection:
    rs232:
      baud: 9600
      data: 8
      parity: N
      stop: 1

  limits:
    volume:
      min: 0
      max: 38
    treble:
      min: 0
      max: 14
    bass:
      min: 0
      max: 14
    balance:
      min: 0
      max: 20
    source: # technically limited by hardware series yaml, not protocol
      min: 1
      max: 8
    zone: # technically limited by hardware series yaml, not protocol
      min: 1
      max: 8
 
  command_eol: "\r"
  command_separator: ""

  commands:
    zone_status:   '?{zone}'

    set_power:     '<{zone}PR{power:02}' # power: 1 = on; 0 = off
    power_on:      '<{zone}PR01'
    power_off:     '<{zone}PR00'

    set_mute:      '<{zone}MU{mute:02}'  # mute: 1 = on; 0 = off
    mute_on:       '<{zone}MU01'
    mute_off:      '<{zone}MU00'

    set_volume:    '<{zone}VO{volume:02}'   # volume: 0-38
    set_treble:    '<{zone}TR{treble}:02}'  # treble: 0-14
    set_bass:      '<{zone}BS{bass:02}'     # bass: 0-14
    set_balance:   '<{zone}BL{balance:02}'  # balance: 0-20
    set_source:    '<{zone}CH{source:02}'   # source: 0-6

  response_eol: "\r"

  responses:
    zone_status: '>(?P<zone>\d\d)(?P<unknown>\d\d)(?P<power>[01]{2})(?P<mute>[01]{2})(?P<do_not_disturb>[01]{2})(?P<volume>\d\d)(?P<treble>\d\d)(?P<bass>\d\d)(?P<balance>\d\d)(?P<source>\d\d)(?P<keypad>\d\d)'

  extra:
    restore_zone:    [ 'set_power', 'set_source', 'set_volume', 'set_mute', 'set_bass', 'set_balance', 'set_treble' ]
    restore_success: "OK\r"

dax88.yaml in series:

- series: dax88
  name: "Dax 88 8-Zone Amp"

  supported:
    - manufacturer: "Dayton Audio"
      model: "DAX88"

  features:
    zones: 8
    sources: 8

  # FIXME: switch code to features
  num_zones: 8
  num_sources: 8
  max_amps: 3
  
  # FIXME: load these limits from protocol
  max_balance: 20
  max_bass: 14
  max_treble: 14
  max_volume: 38

  protocol: dayton
  min_time_between_commands: 0.4

  rs232:
    baudrate: 9600
    bytesize: 8
    parity: 'N'
    stopbits: 1
    timeout: 1.0
    write_timeout: 1.0
 
  hardware_volume_steps: 38
 
  sources:
    1: "Source 1"
    2: "Source 2"
    3: "Source 3"
    4: "Source 4"
    5: "Source 5"
    6: "Source 6"
    7: "Source 7"
    8: "Source 8"
 
  # technically zone = {amp_number}{zone_num_within_amp_1-6} (e.g. 11 = amp number 1, zone 1)
  zones:
    11: "Zone 1"          # main amp 1    (e.g. 15 = amp 1, zone 5)
    12: "Zone 2"
    13: "Zone 3"
    14: "Zone 4"
    15: "Zone 5"
    16: "Zone 6"
    17: "Zone 7"
    18: "Zone 8"

I think I made other changes to pyxantech because it would not compile. I will need to likely revisit all this for the change to python 3.10 and do a real Github fork.

1 Like

Got it, thanks. I can help you to clean it up for the release if you want. DM me.

@kbrown01 I have a DAX88 as well, and have recently started with Home Assistant. What’s the state of your HA integration with the DAX88? Is it available? I’d love to try it out. Thanks!

@mr_fixit made some changes. Mine is based on a older version of the Xantech integration. Possibly he can post to Github and we can both take a newer version. I do not feel comfortable giving mine although it works like a charm, I would feel better coming from a developer with experience.

I will say this, it is the best kick-ass multi-zone amp I have ever owned, far exceeding the power of Monoprice and other alternatives (have owned both Russound and Monoprice). I have 7 zones set up, I left open. On 6 zones there are 4 wired speakers mostly Bose outdoor and in-wall, in-ceiling, Zone 7 is passthrough to another Amp (as 7 and 8 are pre-amp on the Dax88). So right now 28 speakers total and cranked up to 50% you can hear my music 1/2 mile away. Although I do live on 42 acres so not many neighbors to complain.

Last night we had a football watch party. One of my inputs is stereo piped from DirecTV box wireless to a receiver into the Amp. You could feel the tackles!

I sent my changes to the Xantech developer and he just emailed me that he merged them. So I assume this will become part of the regular release.

I just looked at the custom repository and I see the developer must have put my changes into the release. Using HACS, go to integrations and search Xantech or here: rsnodgrass/hass-xantech: Xantech Multi-Zone Matrix Audio for Home Assistant (github.com)

It does support all 8 Zones (of course 7 and 8 are pre-amp on the Dax 88). My configuration looks like this:

- platform: xantech
  type: dax88
  port: /dev/ttyUSB0
  zones:
    11:
      name: "Kitchen"
    12:
      name: "Living Room"
    13:
      name: "Deck"
    14:
      name: "Hot Tub"
    15:
      name: "Patio"
    16:
      name: "Foyer"
    17:
      name: "Master"
    18:
      name: "Unused"
  sources:
    1:
      name: "Alexa"
    2:
      name: "MintyFresh"
    3:
      name: "Volumio"
    4:
      name: "PatioVizio"
    5:
      name: "Input 5"
    6:
      name: "Input 6"
    7:
      name: "Input 7"
    8:
      name: "WiFi"

One Dax88, one unused zone for now, still 3 inputs open.

I am sure that this component will cause this to be updated (which is where my changes were):

rsnodgrass/pyxantech: Python RS232 API for multi-zone amps (Monoprice/Soundavo/Xantech/Dayton Audio) (github.com)

1 Like

Great, thanks!