Amazon Alexa speaker input control of Denon receiver

I have an Input source for my AV receiver linked to channel. To make it work properly with the Alexa plugin, I think I need to put a map transformation profile in place (maybe something else). To transform the values from the receiver into valid Alexa input values and vise versa. For example the receiver uses {“MPLAY”, “BD”, “SAT/CBL”, “TUNER”} but Alexa expects {“MEDIA PLAYER”, “BLURAY”, “CABLE”, “TUNER”}

This is the receiver channel “denonmarantz:avr:0005cdac8736:mainZone#input (String)”

The values that alexa will produce are Alexa.InputController Interface | Alexa Skills Kit

I don’t think you can do that with map transformation (but I could be wrong about that).

You have two distinct items, so use a rule that triggers on the Alexa item changing, and then has an if (or case) statement to send the appropriate command to your Denon based on the value. You can then do the same in the opposite direction.

OK I can see how I can create another point that is not tied to any thing and create rules. Seems like I would need to create 8 rules for the 4 values in each direction

  - id: "1"
      itemName: MovieSpeakers_MainZone_Input
      state: MPLAY
    type: core.ItemStateChangeTrigger
conditions: []
  - inputs: {}
    id: "2"
      itemName: MovieSpeakers_MainZone_AlexaInput
      state: MEDIA PLAYER
    type: core.ItemStateUpdateAction

Yep, that’s it. I refer to these as proxy items. You’ll also see them mentioned as “unbound” or “virtual”.

If you’re sticking with UI rules (which I don’t use) then yeah, you have to have one for each transformation. You could combine them using script, but there’s really no difference. You either have eight rules that trigger on “item changes to specific value” or two “item changes” rules with scripted if conditions.

I forgot to mention that you should be aware of the loop in this logic. If the receiver changes to MPLAY, then one rule will be triggered to send MEDIA PLAYER to the Alexa proxy item. That will change the item, which will trigger another rule to send MPLAY to the receiver.

In theory this shouldn’t be a problem since the loop will end there. The receiver is already on MPLAY and should just stay on that setting. However, there’s a chance it will resend the command and interrupt what’s already playing on the receiver. If this happens, add an IF statement to only send the MPLAY command if the receiver isn’t already on MPLAY.

I tried Map - Transformation Services | openHAB in the profile but it only works for status and not for command. If I changed the state to mplay on denon the status would be reported to alex as “media player”, but if alex set “media player” it would not get translated in the action to denon and denon would ignore it.

Yeah, that’s what I thought would be the case. This does mean that you can get rid of half of the rules though, and rely on MAP to provide correct status info.

No sure if you were able to achieve what you wanted in the first place. In your case, I would recommend using the ModeController interface to achieve what you need.

That way you can set the mapping directly in the Alexa configuration. The InputController interface is basically a pre-defined ModeController interface.

I was following the stereo example in Amazon Alexa Smart Home Skill | openHAB

Can I add a ModeController in a Endpoint.Speaker group?

Group Stereo    "Stereo"            {alexa="Endpoint.Speaker"}
Number Volume   "Volume"  (Stereo)  {alexa="Speaker.volume"}
Switch Mute     "Mute"    (Stereo)  {alexa="Speaker.muted"}
Switch Power    "Power"   (Stereo)  {alexa="PowerController.powerState"}
String Input    "Input"   (Stereo)  {alexa="InputController.input" [supportedInputs="HDMI1,TV"]}
String Channel  "Channel" (Stereo)  {alexa=""}
Player Player   "Player"  (Stereo)  {alexa="PlaybackController.playback"}
Number Bass     "Bass"    (Stereo)  {alexa="EqualizerController.bands:bass" [range="-10:10"]}
Number Midrange "Mid"     (Stereo)  {alexa="EqualizerController.bands:midrange" [range="-10:10"]}
Number Treble   "Treble"  (Stereo)  {alexa="EqualizerController.bands:treble" [range="-10:10"]}
String Mode     "Mode"    (Stereo)  {alexa="EqualizerController.mode" [supportedModes="MOVIE,MUSIC,TV"]}

Generic controllers can be used in any group endpoint and are meant to be used to further customized the integration to your requirements.

So you have the option to either setup a proxy item with the necessary rule triggers in-between your binding linked item and the skill to match the input value requirements, as @rpwong mentioned, or you can use the ModeController interface to set the mapping directly on the linked item. For the latter, just make sure to name the capability as “input”.

As a side note, a new metadata syntax for the skill will be released shortly. feel free to join the beta test.

@Lee_Ballard Based on your usage and other beta testers of the input capability, I decided to add custom mappings support in the upcoming changes, bascially replacing the rigid native InputController interface with a custom ModeController in the background. The former will still be used as backward compatibility when using the old metadata syntax.

thank you :smile: