Denon/Marantz AVR widget

Denon_avr

Description

This widget controls Denon/Marantz AVR devices and works in light mode as well as in dark mode.

Prerequisites:

  • Denon/Marantz binding installed
  • Denon/Marantz device (Thing, Channels, Items) fully set up according to binding instructions
  • The widget is designed for Telnet mode to be configured in the Denon/Marantz Thing

Recommendation for best use of widget:

Add respective options to item’s metadata (e.g. Input source, surround program):

That’s it.
Have fun with the widget.

maxmaximax

Changelog

Version 0.1

  • initial release

Resources

uid: Denon AVR v01
tags: []
props:
  parameters:
    - description: Device name
      label: Title
      name: title
      required: false
      type: TEXT
    - context: item
      description: Item for Power Channel
      label: Power
      name: itemPower
      required: false
      type: TEXT
    - context: item
      description: Item for Input Source
      label: Input Source
      name: itemInputSource
      required: false
      type: TEXT
    - context: item
      description: Item for Mute
      label: Mute
      name: itemMute
      required: false
      type: TEXT
    - context: item
      description: Item for selected Surround Mode
      label: Get Surround Mode
      name: itemSurroundMode
      required: false
      type: TEXT
    - context: item
      description: Item for Volume (dB)
      label: Volume (dB)
      name: itemVolumedb
      required: false
      type: TEXT
    - description: Set minimum Volume (default = 0)
      label: Minimum Volume
      name: MinimumVolume
      required: false
      type: INTEGER
    - description: Set maximum Volume (default = 100)
      label: Maximum Volume
      name: MaximumVolume
      required: false
      type: INTEGER
    - description: Set Volume Stepsize (default = 1)
      label: Volume Stepsize
      name: VolumeStepsize
      required: false
      type: DECIMAL
    - context: item
      description: Item for sending a command for Quick Select options 1,2,3
      label: Send Quick Select Command
      name: itemSendQuickSelectCommand
      required: false
      type: TEXT
    - context: item
      description: Item for sending a command for Surround Program
      label: Send Surround Program Command
      name: itemSendSurroundProgramCommand
      required: false
      type: TEXT
    - context: item
      description: Item for sending a command for Tuner Preset Number
      label: Send Tuner Preset Number Command
      name: itemSendTunerPresetNumberCommand
      required: false
      type: TEXT
    - context: item
      description: Item for sending a command for Tuner Preset Up/Down
      label: Send Tuner Preset Up/Down Command
      name: itemSendTunerPresetUpDownCommand
      required: false
      type: TEXT
  parameterGroups: []
timestamp: Jan 15, 2023, 11:08:14 AM
component: f7-card
config:
  title: =props.title
  outline: true
  class:
    - no-padding
  style:
    noShadow: false
    border-radius: var(--f7-card-expandable-border-radius)
    box-shadow: 5px 5px 10px 1px rgba(0,0,0,0.3)
slots:
  default:
    - component: f7-row
      config:
        class:
          - margin-top-half
          - margin-left-half
          - margin-right-half
          - margin-bottom-half
      slots:
        default:
          - component: f7-col
            config:
              width: "25"
            slots:
              default:
                - component: f7-segmented
                  config:
                    class:
                      - segmented-strong
                    style:
                      --f7-segmented-strong-padding: 0px
                      --f7-segmented-strong-between-buttons: 5px
                      --f7-segmented-strong-button-font-weight: 300
                      --f7-segmented-strong-bg-color: transparent
                      --f7-segmented-strong-button-hover-bg-color: rgba(var(--f7-theme-color-rgb), 0.07)
                      --f7-button-fill-hover-bg-color: var(--f7-theme-color)
                      --f7-button-border-radius: 4px
                      --f7-button-padding-vertical: 0px
                      --f7-button-padding-horizontal: 0px
                  slots:
                    default:
                      - component: oh-button
                        config:
                          outline: true
                          class:
                            - padding-top-half
                            - display-flex
                            - flex-direction-column
                          text: ON/OFF
                          action: toggle
                          actionItem: =props.itemPower
                          actionCommand: ON
                          actionCommandAlt: OFF
                          icon-f7: power
                          iconSize: 15
                          fill: "=(items[props.itemPower].state === 'ON') ? true : false"
                          style:
                            --f7-button-border-width: 1px
                            --f7-button-border-color: var(--f7-card-outline-border-color)
                            height: auto
                            font-size: 8px
          - component: f7-col
            config:
              width: "50"
              large: "45"
            slots:
              default:
                - component: f7-row
                  config: {}
                  slots:
                    default:
                      - component: f7-col
                        config:
                          width: "25"
                        slots:
                          default:
                            - component: f7-icon
                              config:
                                class:
                                  - float-left
                                material: input
                                size: 15
                                style:
                                  color: "=(items[props.itemPower].state === 'ON') ? 'var(--f7-theme-color)' : 'var(--f7-card-outline-border-color)'"
                      - component: f7-col
                        config:
                          width: "75"
                        slots:
                          default:
                            - component: Label
                              config:
                                class:
                                  - float-right
                                text: =@props.itemInputSource
                                style:
                                  white-space: nowrap
                                  overflow: hidden
                                  text-overflow: elipsis
                                  font-size: 12px
                                  color: "=(items[props.itemPower].state === 'ON') ? '' : 'var(--f7-card-outline-border-color)'"
                - component: f7-row
                  config: {}
                  slots:
                    default:
                      - component: f7-col
                        config:
                          width: "25"
                        slots:
                          default:
                            - component: f7-icon
                              config:
                                class:
                                  - float-left
                                material: graphic_eq
                                size: 15
                                style:
                                  color: "=(items[props.itemPower].state === 'ON') ? 'var(--f7-theme-color)' : 'var(--f7-card-outline-border-color)'"
                      - component: f7-col
                        config:
                          width: "75"
                        slots:
                          default:
                            - component: Label
                              config:
                                class:
                                  - float-right
                                text: =@props.itemSurroundMode
                                style:
                                  white-space: nowrap
                                  overflow: hidden
                                  text-overflow: elipsis
                                  font-size: 12px
                                  color: "=(items[props.itemPower].state === 'ON') ? '' : 'var(--f7-card-outline-border-color)'"
                - component: f7-row
                  config: {}
                  slots:
                    default:
                      - component: f7-col
                        config:
                          width: "25"
                        slots:
                          default:
                            - component: f7-icon
                              config:
                                class:
                                  - float-left
                                f7: speaker_2
                                size: 15
                                style:
                                  color: "=(items[props.itemPower].state === 'ON') ? 'var(--f7-theme-color)' : 'var(--f7-card-outline-border-color)'"
                      - component: f7-col
                        config:
                          width: "75"
                        slots:
                          default:
                            - component: Label
                              config:
                                class:
                                  - float-right
                                text: =@props.itemVolumedb
                                style:
                                  white-space: nowrap
                                  overflow: hidden
                                  text-overflow: elipsis
                                  font-size: 12px
                                  color: "=(items[props.itemPower].state === 'ON') ? '' : 'var(--f7-card-outline-border-color)'"
          - component: f7-col
            config:
              width: "25"
            slots:
              default:
                - component: f7-segmented
                  config:
                    visible: "=(items[props.itemPower].state === 'ON') ? true : false"
                    class:
                      - segmented-strong
                    style:
                      --f7-segmented-strong-padding: 0px
                      --f7-segmented-strong-between-buttons: 5px
                      --f7-segmented-strong-button-font-weight: 300
                      --f7-segmented-strong-bg-color: transparent
                      --f7-segmented-strong-button-hover-bg-color: rgba(var(--f7-theme-color-rgb), 0.07)
                      --f7-button-fill-hover-bg-color: var(--f7-theme-color)
                      --f7-button-border-radius: 4px
                      --f7-button-padding-vertical: 0px
                      --f7-button-padding-horizontal: 0px
                  slots:
                    default:
                      - component: oh-button
                        config:
                          text: MUTE
                          action: toggle
                          actionItem: =props.itemMute
                          actionCommand: ON
                          actionCommandAlt: OFF
                          icon-f7: speaker_slash
                          iconSize: 15px
                          fill: "=(items[props.itemMute].state === 'ON') ? true : false"
                          outline: true
                          class:
                            - display-flex
                            - flex-direction-column
                            - padding-top-half
                          style:
                            --f7-button-border-width: 1px
                            --f7-button-border-color: var(--f7-card-outline-border-color)
                            font-size: 8px
                            height: auto
    - component: f7-card
      config:
        visible: "=items[props.itemInputSource].state === 'TUNER' && items[props.itemPower].state === 'ON' ? true : false"
        outline: true
    - component: f7-row
      config:
        visible: "=items[props.itemInputSource].state === 'TUNER' && items[props.itemPower].state === 'ON' ? true : false"
      slots:
        default:
          - component: f7-col
            config:
              width: "10"
            slots:
              default:
                - component: f7-card
                  config:
                    visible: true
                    noShadow: true
                    class:
                      - margin-left-half
                      - margin-right-half
                    style:
                      display: grid
                      grid-template-columns: repeat(1, 1fr)
                      gap: 5px
                      --f7-button-font-size: 8px
                      --f7-button-text-color: "=themeOptions.dark === 'light' ? 'black' : 'white'"
                      --f7-button-border-radius: 4px
                      --f7-button-outline-border-width: 1px
                      --f7-button-font-weight: 300
                      --f7-button-padding-vertical: 0px
                      --f7-button-padding-horizontal: 0px
                  slots:
                    default:
                      - component: oh-repeater
                        config:
                          sourceType: itemStateOptions
                          itemOptions: =props.itemSendTunerPresetUpDownCommand
                          for: option
                          fragment: true
                        slots:
                          default:
                            - component: oh-button
                              config:
                                icon-f7: "=loop.option.label === 'UP' ? 'chevron_up' : 'chevron_down'"
                                iconSize: 15px
                                action: command
                                actionItem: =props.itemSendTunerPresetUpDownCommand
                                actionCommand: =loop.option.value
                                outline: true
                                style:
                                  --f7-button-border-color: var(--f7-card-outline-border-color)
                                  height: auto
          - component: f7-col
            config:
              width: "80"
            slots:
              default:
                - component: f7-card
                  config:
                    visible: true
                    noShadow: true
                    class:
                      - margin-left-half
                      - margin-right-half
                    style:
                      display: grid
                      grid-template-columns: repeat(4, 1fr)
                      gap: 5px
                      --f7-button-font-size: 8px
                      --f7-button-text-color: "=themeOptions.dark === 'light' ? 'black' : 'white'"
                      --f7-button-border-radius: 4px
                      --f7-button-outline-border-width: 1px
                      --f7-button-font-weight: 300
                      --f7-button-padding-vertical: 0px
                      --f7-button-padding-horizontal: 0px
                  slots:
                    default:
                      - component: oh-repeater
                        config:
                          sourceType: itemStateOptions
                          itemOptions: =props.itemSendTunerPresetNumberCommand
                          for: option
                          fragment: true
                        slots:
                          default:
                            - component: oh-button
                              config:
                                text: =loop.option.label
                                action: command
                                actionItem: =props.itemSendTunerPresetNumberCommand
                                actionCommand: =loop.option.value
                                outline: true
                                style:
                                  --f7-button-border-color: var(--f7-card-outline-border-color)
                                  height: auto
    - component: f7-card
      config:
        visible: "=(items[props.itemPower].state === 'ON') ? true : false"
        outline: true
    - component: f7-row
      config:
        visible: "=(items[props.itemPower].state === 'ON') ? true : false"
      slots:
        default:
          - component: f7-col
            config:
              width: "50"
              large: "50"
            slots:
              default:
                - component: Label
                  config:
                    class:
                      - margin-left-half
                      - text-align-center
                    text: Source & Surround
                    style:
                      font-size: 12px
          - component: f7-col
            config:
              width: "50"
              large: "50"
            slots:
              default:
                - component: Label
                  config:
                    class:
                      - margin-right-half
                      - text-align-center
                    text: Quick Select
                    style:
                      font-size: 12px
    - component: f7-row
      config:
        visible: "=(items[props.itemPower].state === 'ON') ? true : false"
        class:
          - margin-bottom-half
      slots:
        default:
          - component: f7-col
            config:
              width: "50"
              large: "50"
            slots:
              default:
                - component: f7-segmented
                  config:
                    visible: true
                    class:
                      - margin-left-half
                    style:
                      --f7-button-font-size: 8px
                      --f7-button-text-color: var(--f7-theme-color)
                      --f7-button-border-radius: 4px
                      --f7-button-outline-border-width: 1px
                      --f7-button-font-weight: 300
                      --f7-button-padding-vertical: 5px
                      --f7-button-padding-horizontal: 0px
                  slots:
                    default:
                      - component: oh-repeater
                        config:
                          sourceType: array
                          for: SourceSurroundSetting
                          in:
                            - icon: input
                              option: source
                            - icon: graphic_eq
                              option: surround
                          fragment: true
                        slots:
                          default:
                            - component: oh-button
                              config:
                                icon-material: =loop.SourceSurroundSetting.icon
                                iconSize: 15px
                                fill: "=vars[loop.SourceSurroundSetting.option] || vars[loop.SourceSurroundSetting.option] === undefined ? false : true"
                                outline: true
                                class:
                                  - display-flex
                                  - flex-direction-column
                                style:
                                  --f7-button-border-color: var(--f7-card-outline-border-color)
                                  height: 27px
                                action: variable
                                actionVariable: =loop.SourceSurroundSetting.option
                                actionVariableValue: "=vars[loop.SourceSurroundSetting.option] || vars[loop.SourceSurroundSetting.option] === undefined ? false : true"
          - component: f7-col
            config:
              width: "50"
              large: "50"
            slots:
              default:
                - component: f7-segmented
                  config:
                    class:
                      - margin-right-half
                    style:
                      --f7-button-font-size: 12px
                      --f7-button-text-color: "=themeOptions.dark === 'light' ? 'black' : 'white'"
                      --f7-button-border-radius: 4px
                      --f7-button-outline-border-width: 1px
                      --f7-button-font-weight: 300
                      --f7-button-padding-vertical: 0px
                      --f7-button-padding-horizontal: 0px
                  slots:
                    default:
                      - component: oh-repeater
                        config:
                          sourceType: itemStateOptions
                          itemOptions: =props.itemSendQuickSelectCommand
                          for: option
                          fragment: true
                        slots:
                          default:
                            - component: oh-button
                              config:
                                text: =loop.option.label
                                action: command
                                actionItem: =props.itemSendQuickSelectCommand
                                actionCommand: =loop.option.value
                                outline: true
                                style:
                                  --f7-button-border-color: var(--f7-card-outline-border-color)
                                  height: 27px
    - component: f7-card
      config:
        visible: "=vars.source === false && items[props.itemPower].state === 'ON' ? true : false"
        outline: true
    - component: f7-card
      config:
        visible: "=vars.source === false && items[props.itemPower].state === 'ON' ? true : false"
        noShadow: true
        class:
          - margin-left-half
          - margin-right-half
        style:
          display: grid
          grid-template-columns: repeat(4, 1fr)
          gap: 5px
          --f7-button-font-size: 8px
          --f7-button-text-color: "=themeOptions.dark === 'light' ? 'black' : 'white'"
          --f7-button-text-transform: uppercase
          --f7-button-border-radius: 4px
          --f7-button-outline-border-width: 1px
          --f7-button-font-weight: 300
          --f7-button-padding-vertical: 0px
          --f7-button-padding-horizontal: 0px
      slots:
        default:
          - component: oh-repeater
            config:
              sourceType: itemStateOptions
              itemOptions: =props.itemInputSource
              for: option
              fragment: true
            slots:
              default:
                - component: oh-button
                  config:
                    text: =loop.option.label
                    action: command
                    actionItem: =props.itemInputSource
                    actionCommand: =loop.option.value
                    fill: "=(loop.option.value == items[props.itemInputSource].state) ? true : false"
                    outline: true
                    style:
                      --f7-button-border-color: var(--f7-card-outline-border-color)
                      height: auto
    - component: f7-card
      config:
        visible: "=vars.surround === false && items[props.itemPower].state === 'ON' ? true : false"
        outline: true
    - component: f7-card
      config:
        visible: "=vars.surround === false && items[props.itemPower].state === 'ON' ? true : false"
        noShadow: true
        class:
          - margin-left-half
          - margin-right-half
        style:
          display: grid
          grid-template-columns: repeat(4, 1fr)
          gap: 5px
          --f7-button-font-size: 8px
          --f7-button-text-color: "=themeOptions.dark === 'light' ? 'black' : 'white'"
          --f7-button-border-radius: 4px
          --f7-button-outline-border-width: 1px
          --f7-button-font-weight: 300
          --f7-button-padding-vertical: 0px
          --f7-button-padding-horizontal: 0px
      slots:
        default:
          - component: oh-repeater
            config:
              sourceType: itemStateOptions
              itemOptions: =props.itemSendSurroundProgramCommand
              for: option
              fragment: true
            slots:
              default:
                - component: oh-button
                  config:
                    text: =loop.option.label
                    action: command
                    actionItem: =props.itemSendSurroundProgramCommand
                    actionCommand: =loop.option.value
                    outline: true
                    style:
                      --f7-button-border-color: var(--f7-card-outline-border-color)
                      height: auto
    - component: f7-row
      config:
        visible: "=(items[props.itemPower].state === 'ON') ? true : false"
        class:
          - margin-left-half
          - margin-right-half
          - margin-top-half
          - margin-bottom-half
      slots:
        default:
          - component: f7-col
            slots:
              default:
                - component: oh-slider-card
                  config:
                    outline: true
                    item: =props.itemVolumedb
                    min: =props.MinimumVolume
                    max: =props.MaximumVolume
                    step: =props.VolumeStepsize
                    scaleSteps: 4
                    scale: true
                    unit: dB
                    label: true

5 Likes