YandexStation

YandexStation Blockly module for YandexStation Binding

Blocks

Speech blocks:

  • Say text (with whisper)
  • Voice command

Music control blocks:

  • Start playing
  • Stop playing
  • Next Track
  • Previous Track

Volume control blocks:

  • volume up
  • volume down
  • set volume

Other blocks:

  • stopListening

Changelog

Version 0.1

  • initial release

Resources

uid: yandex_station
tags:
  - YandexStation
props:
  parameters: []
  parameterGroups: []
timestamp: Jan 11, 2024, 1:25:43 PM
component: BlockLibrary
config:
  name: Yandex Station
slots:
  blocks:
    - component: BlockType
      config:
        args0:
          - align: right
            name: MESSAGE
            type: input_value
          - align: right
            name: STATION
            type: input_value
          - align: right
            name: WHISPER
            type: field_checkbox
        colour: 0
        helpUrl: ""
        inputsInline: false
        lastDummyAlign0: right
        message0: Say text %1 on staton %2 with whisper %3
        nextStatement: ""
        previousStatement: ""
        tooltip: ""
        type: sayText
      slots:
        code:
          - component: BlockCodeTemplate
            config:
              template: >
                {{utility:thingsHelper}}.getActions('yandexstation', {{input:STATION}}).sayText({{input:MESSAGE}}, '{{field:WHISPER}}' === 'TRUE');
        toolbox:
          - component: PresetInput
            config:
              fields:
                TEXT: message
              name: MESSAGE
              shadow: true
              type: text
          - component: PresetInput
            config:
              name: STATION
              shadow: true
              type: oh_thing
    - component: BlockType
      config:
        args0:
          - align: right
            min: 0
            name: PAUSE
            type: field_number
          - align: right
            name: MESSAGE
            type: input_value
        colour: 0
        helpUrl: ""
        inputsInline: false
        lastDummyAlign0: right
        message0: pause %1 ms %2
        output: String
        tooltip: ""
        type: pauseForSay
      slots:
        code:
          - component: BlockCodeTemplate
            config:
              template: >
                {{utility:stringWithPause}}({{field:PAUSE}}, {{input:MESSAGE}})
        toolbox:
          - component: PresetInput
            config:
              fields:
                TEXT: pause
              name: PAUSE
              shadow: true
              type: text
          - component: PresetInput
            config:
              fields:
                TEXT: message
              name: MESSAGE
              shadow: true
              type: text
    - component: BlockType
      config:
        args0:
          - align: right
            name: MESSAGE
            type: input_value
          - align: right
            name: STATION
            type: input_value
        colour: 0
        helpUrl: ""
        inputsInline: false
        lastDummyAlign0: right
        message0: Send voice command %1 to staton %2
        nextStatement: ""
        previousStatement: ""
        tooltip: ""
        type: voiceCommand
      slots:
        code:
          - component: BlockCodeTemplate
            config:
              template: >
                {{utility:thingsHelper}}.getActions('yandexstation', {{input:STATION}}).voiceCommand({{input:MESSAGE}});
        toolbox:
          - component: PresetInput
            config:
              fields:
                TEXT: message
              name: MESSAGE
              shadow: true
              type: text
          - component: PresetInput
            config:
              name: STATION
              shadow: true
              type: oh_thing
    - component: BlockType
      config:
        args0:
          - align: right
            name: STATION
            type: input_value
        colour: 0
        helpUrl: ""
        inputsInline: false
        lastDummyAlign0: right
        message0: Start playing on staton %1
        nextStatement: ""
        previousStatement: ""
        tooltip: ""
        type: play
      slots:
        code:
          - component: BlockCodeTemplate
            config:
              template: >
                {{utility:thingsHelper}}.getActions('yandexstation', {{input:STATION}}).play();
        toolbox:
          - component: PresetInput
            config:
              name: STATION
              shadow: true
              type: oh_thing
    - component: BlockType
      config:
        args0:
          - align: right
            name: STATION
            type: input_value
        colour: 0
        helpUrl: ""
        inputsInline: false
        lastDummyAlign0: right
        message0: Stop playing on staton %1
        nextStatement: ""
        previousStatement: ""
        tooltip: ""
        type: stop
      slots:
        code:
          - component: BlockCodeTemplate
            config:
              template: >
                {{utility:thingsHelper}}.getActions('yandexstation', {{input:STATION}}).stop();
        toolbox:
          - component: PresetInput
            config:
              name: STATION
              shadow: true
              type: oh_thing
    - component: BlockType
      config:
        args0:
          - align: right
            name: STATION
            type: input_value
        colour: 0
        helpUrl: ""
        inputsInline: false
        lastDummyAlign0: right
        message0: Next Track command on staton %1
        nextStatement: ""
        previousStatement: ""
        tooltip: ""
        type: next
      slots:
        code:
          - component: BlockCodeTemplate
            config:
              template: >
                {{utility:thingsHelper}}.getActions('yandexstation', {{input:STATION}}).next();
        toolbox:
          - component: PresetInput
            config:
              name: STATION
              shadow: true
              type: oh_thing
    - component: BlockType
      config:
        args0:
          - align: right
            name: STATION
            type: input_value
        colour: 0
        helpUrl: ""
        inputsInline: false
        lastDummyAlign0: right
        message0: Prev Track on staton %1
        nextStatement: ""
        previousStatement: ""
        tooltip: ""
        type: prev
      slots:
        code:
          - component: BlockCodeTemplate
            config:
              template: >
                {{utility:thingsHelper}}.getActions('yandexstation', {{input:STATION}}).prev();
        toolbox:
          - component: PresetInput
            config:
              name: STATION
              shadow: true
              type: oh_thing
    - component: BlockType
      config:
        args0:
          - align: right
            name: STATION
            type: input_value
        colour: 0
        helpUrl: ""
        inputsInline: false
        lastDummyAlign0: right
        message0: VolumeUp on staton %1
        nextStatement: ""
        previousStatement: ""
        tooltip: ""
        type: VolumeUp
      slots:
        code:
          - component: BlockCodeTemplate
            config:
              template: >
                {{utility:thingsHelper}}.getActions('yandexstation', {{input:STATION}}).volumeUp();
        toolbox:
          - component: PresetInput
            config:
              name: STATION
              shadow: true
              type: oh_thing
    - component: BlockType
      config:
        args0:
          - align: right
            name: STATION
            type: input_value
        colour: 0
        helpUrl: ""
        inputsInline: false
        lastDummyAlign0: right
        message0: VolumeDown on staton %1
        nextStatement: ""
        previousStatement: ""
        tooltip: ""
        type: VolumeDown
      slots:
        code:
          - component: BlockCodeTemplate
            config:
              template: >
                {{utility:thingsHelper}}.getActions('yandexstation', {{input:STATION}}).volumeDown();
        toolbox:
          - component: PresetInput
            config:
              name: STATION
              shadow: true
              type: oh_thing
    - component: BlockType
      config:
        args0:
          - align: right
            check: Number
            name: VOLUME
            type: input_value
          - align: right
            name: STATION
            type: input_value
        colour: 0
        helpUrl: ""
        inputsInline: true
        lastDummyAlign0: right
        message0: Set volume %1 on staton %2
        nextStatement: ""
        previousStatement: ""
        tooltip: ""
        type: setVolume
      slots:
        code:
          - component: BlockCodeTemplate
            config:
              template: >
                {{utility:thingsHelper}}.getActions('yandexstation', {{input:STATION}}).setVolume({{input:VOLUME}});
        toolbox:
          - component: PresetInput
            config:
              name: STATION
              shadow: true
              type: oh_thing
    - component: BlockType
      config:
        args0:
          - align: right
            name: STATION
            type: input_value
          - align: right
            name: UNMUTE
            type: field_checkbox
        colour: 0
        helpUrl: ""
        inputsInline: false
        lastDummyAlign0: right
        message0: Mute volume on staton %1 with unmute %2
        nextStatement: ""
        previousStatement: ""
        tooltip: ""
        type: mute
      slots:
        code:
          - component: BlockCodeTemplate
            config:
              template: >
                {{utility:thingsHelper}}.getActions('yandexstation', {{input:STATION}}).mute('{{field:UNMUTE}}' === 'FALSE');
        toolbox:
          - component: PresetInput
            config:
              name: STATION
              shadow: true
              type: oh_thing
    - component: BlockType
      config:
        args0:
          - align: right
            name: STATION
            type: input_value
        colour: 0
        helpUrl: ""
        inputsInline: false
        lastDummyAlign0: right
        message0: Stop listening on staton %1
        nextStatement: ""
        previousStatement: ""
        tooltip: ""
        type: stopListening
      slots:
        code:
          - component: BlockCodeTemplate
            config:
              template: >
                {{utility:thingsHelper}}.getActions('yandexstation', {{input:STATION}}).stopListening();
        toolbox:
          - component: PresetInput
            config:
              name: STATION
              shadow: true
              type: oh_thing
  utilities:
    - component: UtilityJavaType
      config:
        javaClass: org.openhab.core.model.script.actions.Things
        name: thingsHelper
    - component: UtilityFunction
      config:
        code: >
          function {{name}} (pause, text) {
            return " sil <[" + pause + "]> " + text;
          }
        name: stringWithPause

2 Likes