Media_player.template

Very nice!
How do you get the nintendo_switch_activity ?

1 Like

This way:

New Integration: Nintendo Switch - Feature Requests - Home Assistant Community (home-assistant.io)

Basically a docker container that monitors a friends’ online status (the friend being yourself in this case)

1 Like

Well I was searching for a better way to integrate my home assistant to snapcast.

If you don’t know snapcast is a multi room speaker system that can handle multiple sources.
I use spotify and a couple of mpd players. If i want to go to the next song it depends on the source used my the snapcast client.

made it my main music panels.

- platform: media_player_template
    media_players:
      speaker_huiskamer:
        friendly_name: Speaker Huiskamer
        device_class: media_player
        current_source_template: "{{ state_attr('media_player.kupo_snapcast_client','source') }}"
        value_template: >
            {% if  is_state('media_player.kupo_snapcast_client', 'playing')  -%}
            {% if state_attr('media_player.kupo_snapcast_client','is_volume_muted') -%}
              idle
            {%- else -%}
            {% if  state_attr('media_player.kupo_snapcast_client','source') == 'spotify' -%}
            {% if (state_attr('media_player.spotify_bram_diederik','source') == 'pWAP-HQ') and is_state('media_player.spotify_bram_diederik', 'playing')  -%}
              playing
            {%- else -%}
              idle
            {%- endif -%}
            {%- elif state_attr('media_player.kupo_snapcast_client','source') == 'musicha' -%}
            {% if  is_state('media_player.alfred', 'playing')  -%}
              playing
            {%- else -%}
              idle
            {%- endif -%}
            {%- elif state_attr('media_player.kupo_snapcast_client','source') == 'mpd' -%}
            {% if  is_state('media_player.player', 'playing')  -%}
              playing
            {%- else -%}
              idle
            {%- endif -%}
            {%- elif state_attr('media_player.kupo_snapcast_client','source') == 'mopidy' -%}
            {% if  is_state('media_player.piano_man', 'playing')  -%}
              playing
            {%- else -%}
              idle
            {%- endif -%}
            {%- else -%}
              on
            {%- endif -%}
            {%- endif -%}
            {%- else -%}
              idle
            {%- endif -%} 
        turn_on:
          service: script.turn_on
          data_template:
            entity_id: script.switch_snapclient_huiskamer_on
        play:
          service: script.turn_on
          data_template:
            entity_id: script.switch_snapclient_huiskamer_on
        turn_off:
          service: script.turn_on
          data_template:
            entity_id: script.mute_huiskamer
        volume_up:
          service: media_player.volume_up
          data_template:
            entity_id: media_player.kupo_snapcast_client
        volume_down:
          service: media_player.volume_down
          data_template:
            entity_id: media_player.kupo_snapcast_client
        pause:
          service: media_player.volume_mute
          data:
            entity_id: media_player.kupo_snapcast_client
            is_volume_muted: "{{is_muted}}"
        stop:
          service: media_player.volume_mute
          data:
            entity_id: media_player.kupo_snapcast_client
            is_volume_muted: "{{is_muted}}"
        mute:
          service: media_player.volume_mute
          data:
            entity_id: media_player.kupo_snapcast_client
            is_volume_muted: "{{is_muted}}"
        set_volume:
          service: media_player.volume_set
          data_template:
            entity_id: media_player.kupo_snapcast_client
            volume_level: "{{volume}}"
        current_volume_template: "{{  state_attr('media_player.kupo_snapcast_client','volume_level') }}"
        next:
          service: script.turn_on
          data_template:
            entity_id: script.next_snapclient_huiskamer
        previous:
          service: script.turn_on
          data_template:
            entity_id: script.prev_snapclient_huiskamer
        inputs:
          spotify:
            service: media_player.select_source
            data_template:
              entity_id: media_player.kupo_snapcast_client
              source: "spotify"
          mpd:
            service: media_player.select_source
            data_template:
              entity_id: media_player.kupo_snapcast_client
              source: "mpd"
          mpdha:
            service: media_player.select_source
            data_template:
              entity_id: media_player.kupo_snapcast_client
              source: "mpdha"
          musicha:
            service: media_player.select_source
            data_template:
              entity_id: media_player.kupo_snapcast_client
              source: "musicha"
          mopidy:
            service: media_player.select_source
            data_template:
              entity_id: media_player.kupo_snapcast_client
              source: "mopidy"
        current_is_muted_template: >
          {{ state_attr('media_player.kupo_snapcast_client','is_volume_muted') }}
        media_image_url_template: >
            {% if  state_attr('media_player.kupo_snapcast_client','source') == 'spotify' -%}
            {{ state_attr('media_player.spotify_bram_diederik','entity_picture') }}
            {%- elif state_attr('media_player.kupo_snapcast_client','source') == 'musicha' -%}
            {{ state_attr('media_player.alfred','entity_picture') }}
            {%- elif state_attr('media_player.kupo_snapcast_client','source') == 'mpd' -%}
           
            {% if state_attr('media_player.player', 'media_content_id') | regex_match('.*groovesalad-256-mp3$') %}
              /local/images/groovesalad120.png
            {% elif state_attr('media_player.player', 'media_content_id') | regex_match('.*seventies-320-mp3$') %}
              /local/images/seventies400.jpg
            {% elif state_attr('media_player.player', 'media_content_id') | regex_match('.*beatblender-128-mp3$') %}
              /local/images/beatblender-400.png
            {% elif state_attr('media_player.player', 'media_content_id') | regex_match('.*spacestation-128-mp3$') %}
              /local/images/spacestation-400.png
            {% elif state_attr('media_player.player', 'media_content_id') | regex_match('.*secretagent-128-mp3$') %}
              /local/images/secretagent-400.png
            {% elif state_attr('media_player.player', 'media_content_id') | regex_match('.*cliqhop-256-mp3$') %}
              /local/images/cliqhop-400.png
            {% elif state_attr('media_player.player', 'media_content_id') | regex_match('.*radio1-bb-mp3$') %}
              /local/images/npo_radio1_logo.svg
            {% elif state_attr('media_player.player', 'media_content_id') | regex_match('.*radio2-bb-mp3$') %}
              /local/images/npo_radio2_logo.svg
            {% elif state_attr('media_player.player', 'media_content_id') | regex_match('.*3fm-bb-mp3$') %}
              /local/images/npo_3fm_logo.svg
            {% elif state_attr('media_player.player', 'media_content_id') | regex_match('.*radio4-bb-mp3$') %}
              /local/images/npo-klassiek-logo.svg
            {% elif state_attr('media_player.player', 'media_content_id') | regex_match('.*radio6-bb-mp3$') %}
              /local/images/NPO_Soul_n_Jazz_logo.svg
            {% elif state_attr('media_player.player', 'media_content_id') | regex_match('.*dreadlockradio128$') %}
              /local/images/b5aae2067db80f694a980e596e7f49618c1206c9
            {% elif state_attr('media_player.player', 'media_content_id') | regex_match('.*RADIO538.mp3$') %}
              /local/images/Logo_538_Nederland.png
            {% elif state_attr('media_player.player', 'media_content_id') | regex_match('.*badbeatradio$') %}
              /local/images/c300.webp
            {% elif state_attr('media_player.player', 'media_content_id') | regex_match('.*arrow-classic-rock') %}
              /local/images/arrow.png
            {% else %}
            {{ state_attr('media_player.player', 'entity_picture') }}
            {%- endif -%}
                        
           
            {%- elif state_attr('media_player.kupo_snapcast_client','source') == 'mopidy' -%}
            {{ state_attr('media_player.piano_man', 'entity_picture') }}
            {%- else -%}
            True
            {%- endif -%}
        title_template: > 
            {% if  state_attr('media_player.kupo_snapcast_client','source') == 'spotify' -%}
            {{ state_attr('media_player.spotify_bram_diederik','media_title') }}
            {%- elif state_attr('media_player.kupo_snapcast_client','source') == 'musicha' -%}
            {{ state_attr('media_player.alfred','media_title') }}
            {%- elif state_attr('media_player.kupo_snapcast_client','source') == 'mpd' -%}
            {{ state_attr('media_player.player', 'media_title') }}
            {%- elif state_attr('media_player.kupo_snapcast_client','source') == 'mopidy' -%}
            {{ state_attr('media_player.piano_man', 'media_title') }}
            {%- else -%}
            True
            {%- endif -%}
        album_template: > 
            {% if  state_attr('media_player.kupo_snapcast_client','source') == 'spotify' -%}
            {{ state_attr('media_player.spotify_bram_diederik','media_album_name') }}
            {%- elif state_attr('media_player.kupo_snapcast_client','source') == 'musicha' -%}
            {{ state_attr('media_player.alfred','media_album_name') }}
            {%- elif state_attr('media_player.kupo_snapcast_client','source') == 'mpd' -%}
            {{ state_attr('media_player.player', 'media_album_name') }}
            {%- elif state_attr('media_player.kupo_snapcast_client','source') == 'mopidy' -%}
            {{ state_attr('media_player.piano_man', 'media_album_name') }}
            {%- else -%}
            True
            {%- endif -%}
        artist_template:  > 
            {% if  state_attr('media_player.kupo_snapcast_client','source') == 'spotify' -%}
            {{ state_attr('media_player.spotify_bram_diederik','media_artist') }}
            {%- elif state_attr('media_player.kupo_snapcast_client','source') == 'musicha' -%}
            {{ state_attr('media_player.alfred','media_artist') }}
            {%- elif state_attr('media_player.kupo_snapcast_client','source') == 'mpd' -%}
            {{ state_attr('media_player.player', 'media_artist') }}
            {%- elif state_attr('media_player.kupo_snapcast_client','source') == 'mopidy' -%}
            {{ state_attr('media_player.piano_man', 'media_artist') }}
            {%- else -%}
            True
            {%- endif -%}


1 Like

Shame,
I don’t think it would work with a jailbroken switch having nintendo servers disabled, right?

Nope, it reads a friends online status, so that would require Nintendo online services.

@Sennevds
the orig. instructions states a ‘template’ directory and in the post linked below ‘media_player_template’ is written. Which one is it?

Noob-Question: How do I download the files from the GitHub components folder? :sweat_smile:

hi i just found this the other day and i am loving it thanks to everyone involved in making this. this should really be a core function of HASSIO imo.

one question though: is this integration still maintained? On Github it says discontinued?

reason i am asking is that i am missing one feature: “Browse Media” for the media player. it would be awesome to have this

The code owner is still active on GitHub, so the ‘not maintained’ label is a bit misleading.

There was a PR merged 2 weeks ago, but it appears not to have been versioned yet. I’m sure you know, but just in case, you’ll either need to download manually to get it, or make sure you install the ‘master’ version via HACS.

If you post your feature request as an issue on GitHub with the ‘enhancement’ label, it might get some attention - there are other coders who seem to be submitting PRs.

1 Like

I’m the original creator of the integration. I’m not actively maintaining the integration myself but if someone creates a PR I will review it and merge it.

2 Likes

is it somehow possible to increase the button size (play, pause, next, etc) ?

i suppose i would have to edit the code of the integration itself?

The integration does nothing with the UI it’s only the connection between home assistant and a external device

thanks for the clarification.

then i guess this won’t be possible

Did you ever get this working? I also have a TDAI and would love to get it working in some fashion in HA but am struggling to figure out how…

I did manage to get this to work. In summary, Lyngdorf has a tcp interface to receive commands. I set up media_template to interface with a Node-RED interface via MQTT commands.

That said, someone is in the works to create a full Lyngdorf integration - am eagerly waiting for that!


First, you’ll need to create some sensors using MQTT (to receive the tcp commands and volume control), and also a boolean status to detect power mode:

mqtt:
  sensor:
    - name: "TDAI-TCP"
     state_topic: "/tdai/tcp"
   - name: "TDAI-SetVol"
     state_topic: "/tdai/setvolume"

input_boolean:
  tdai_powerstatus:
    name: TDAI Power
    icon: mdi:receiver
    initial: off

This is the media template configuration. Not everything is working but it suffices for me.

media_player:
  - platform: media_player_template
    media_players:
      tdai_1120:
        friendly_name: TDAI-1120
        device_class: receiver
        current_source_template: "{{ states('sensor.tdai_1120_source') }}"
        current_volume_template: "{{ states('sensor.tdai_1120_volume') }}"
        value_template: >
          {% if is_state("input_boolean.tdai_powerstatus", "on") -%}
            on
          {%- else -%}
            off
          {%- endif %}
        turn_on:
          service: mqtt.publish
          data:
            topic: "tdai/tcp"
            payload: "!ON"
        turn_off:
          service: mqtt.publish
          data:
            topic: "tdai/tcp"
            payload: "!OFF"
        volume_up:
          service: mqtt.publish
          data:
            topic: "tdai/tcp"
            payload: "!VOLUP"
        volume_down:
          service: mqtt.publish
          data:
            topic: "tdai/tcp"
            payload: "!VOLDN"
        inputs:
          Computer:
           service: mqtt.publish
           data:
            topic: "tdai/tcp"
            payload: "!SRC(6)"
          Spotify:
           service: mqtt.publish
           data:
            topic: "tdai/tcp"
            payload: "!SRC(8)"
          Chromecast:
           service: mqtt.publish
           data:
            topic: "tdai/tcp"
            payload: "!SRC(7)"
        set_volume:
          service: input_text.set_value
          data:
            entity_id: input_text.selected_volume
            value: "{{volume}}"
        mute:
          service: mqtt.publish
          data:
            topic: "tdai/tcp"
            payload: "!MUTE"
#          service: input_number.set_value
#          data:
#            entity_id: input_number.selected_is_muted
#            value: "{{is_muted}}"
#        current_is_muted_template: >
#          {{ states('input_boolean.is_muted') }}
#        album_art_template: "{{ states('input_text.album_art') }}"
#        title_template: "{{ states('input_text.title') }}"
#        album_template: "{{ states('input_text.album') }}"
#        artist_template: "{{ states('input_text.artist') }}"    

Lastly, you need to install Node-RED, and import the code here. You will need to update all nodes indicated “TDAI TCP” with your TDAI’s IP address.

[{"id":"817bda0157563770","type":"tab","label":"TDAI","disabled":false,"info":"","env":[]},{"id":"1e25f439db7c41f2","type":"function","z":"817bda0157563770","name":"VOL","func":"msg.payload = \"!VOL?\\n\"\nreturn msg","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":870,"y":560,"wires":[["5adc54bbd5e1f1b4"]]},{"id":"21dc72af88200195","type":"inject","z":"817bda0157563770","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":620,"y":520,"wires":[[]]},{"id":"5adc54bbd5e1f1b4","type":"tcp request","z":"817bda0157563770","name":"TDAI TCP","server":"192.168.3.14","port":"84","out":"char","ret":"string","splitc":"\\n","newline":"","trim":false,"tls":"","x":1010,"y":560,"wires":[["a2481608fb510172"]]},{"id":"c19b2d05ba8ae091","type":"poll-state","z":"817bda0157563770","name":"TDAI Power","server":"8ceaa1a2.5a09f","version":3,"exposeAsEntityConfig":"","updateInterval":"10","updateIntervalType":"num","updateIntervalUnits":"seconds","outputInitially":true,"outputOnChanged":true,"entityId":"input_boolean.tdai_powerstatus","stateType":"str","ifState":"on","ifStateType":"str","ifStateOperator":"is","outputs":2,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"},{"property":"topic","propertyType":"msg","value":"","valueType":"triggerId"}],"x":610,"y":580,"wires":[["1e25f439db7c41f2","1fc49fb532090529"],[]]},{"id":"a2481608fb510172","type":"function","z":"817bda0157563770","name":"Parse VOL","func":"msg.payload = msg.payload.toString('utf8')\nlet trim = msg.payload.trim()\nlet text = trim.split('(')[1]\nlet output = text.slice(0,-1)\nmsg.payload = output / 10\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1170,"y":560,"wires":[["03895453be07f1c9"]]},{"id":"03895453be07f1c9","type":"ha-sensor","z":"817bda0157563770","name":"TDAI Volume","entityConfig":"0ffbecd6a8416847","version":0,"state":"payload","stateType":"msg","attributes":[],"inputOverride":"allow","outputProperties":[],"x":1330,"y":560,"wires":[[]]},{"id":"1fc49fb532090529","type":"function","z":"817bda0157563770","name":"SRCNAME","func":"msg.payload = \"!SRCNAME?\\n\"\nreturn msg","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":850,"y":500,"wires":[["ee2e4b89572a97f0"]]},{"id":"ee2e4b89572a97f0","type":"tcp request","z":"817bda0157563770","name":"TDAI TCP","server":"192.168.3.14","port":"84","out":"char","ret":"string","splitc":"\\n","newline":"","trim":false,"tls":"","x":1010,"y":500,"wires":[["e8c6b9573b656402"]]},{"id":"e8c6b9573b656402","type":"function","z":"817bda0157563770","name":"Parse SRC","func":"msg.payload = msg.payload.toString('utf8')\nlet trim = msg.payload.trim()\nlet text = trim.split('\"')[1]\nmsg.payload = text\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1170,"y":500,"wires":[["51eb191e94cb82ea"]]},{"id":"51eb191e94cb82ea","type":"ha-sensor","z":"817bda0157563770","name":"TDAI Source","entityConfig":"b0f71ceab7f4a062","version":0,"state":"payload","stateType":"msg","attributes":[],"inputOverride":"allow","outputProperties":[],"x":1330,"y":500,"wires":[[]]},{"id":"0998489497d46ce2","type":"mqtt in","z":"817bda0157563770","name":"TDAI-TCP","topic":"tdai/tcp","qos":"0","datatype":"auto-detect","broker":"de32d2e0f0f9525e","nl":false,"rap":true,"rh":0,"inputs":0,"x":300,"y":360,"wires":[["729487b213e153ab"]]},{"id":"e679d3429217cac4","type":"tcp request","z":"817bda0157563770","name":"TDAI TCP","server":"192.168.3.14","port":"84","out":"char","ret":"string","splitc":"\\n","newline":"","trim":false,"tls":"","x":610,"y":360,"wires":[[]]},{"id":"729487b213e153ab","type":"function","z":"817bda0157563770","name":"TCP Input","func":"msg.payload = msg.payload + '\\n'\nreturn msg","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":440,"y":360,"wires":[["e679d3429217cac4","4b8f6b9e6a0faee1"]]},{"id":"910f7fc789cc5cda","type":"function","z":"817bda0157563770","name":"PWR","func":"msg.payload = \"!PWR?\\n\"\nreturn msg","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":870,"y":700,"wires":[["15a103e255b62575"]]},{"id":"15a103e255b62575","type":"tcp request","z":"817bda0157563770","name":"TDAI TCP","server":"192.168.3.14","port":"84","out":"char","ret":"buffer","splitc":"\\n","newline":"","trim":false,"tls":"","x":1010,"y":700,"wires":[["bdf1e35213934646"]]},{"id":"bdf1e35213934646","type":"function","z":"817bda0157563770","name":"Parse PWR","func":"msg.payload = msg.payload.toString('utf8')\nlet trim = msg.payload.trim()\nlet text = trim.split('(')[1]\nlet output = text.slice(0,-1)\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1170,"y":700,"wires":[["87f83d4f9fef106c"]]},{"id":"1a614b9dff49fbc8","type":"poll-state","z":"817bda0157563770","name":"Powered on?","server":"8ceaa1a2.5a09f","version":3,"exposeAsEntityConfig":"","updateInterval":"60","updateIntervalType":"num","updateIntervalUnits":"seconds","outputInitially":true,"outputOnChanged":true,"entityId":"media_player.room","stateType":"str","ifState":"unavailable","ifStateType":"str","ifStateOperator":"is_not","outputs":2,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"},{"property":"topic","propertyType":"msg","value":"","valueType":"triggerId"}],"x":610,"y":700,"wires":[["910f7fc789cc5cda"],[]]},{"id":"64e5674550ee4c62","type":"api-call-service","z":"817bda0157563770","name":"TDAI is on","server":"8ceaa1a2.5a09f","version":5,"debugenabled":true,"domain":"input_boolean","service":"turn_on","areaId":[],"deviceId":[],"entityId":["input_boolean.tdai_powerstatus"],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1510,"y":680,"wires":[[]]},{"id":"87f83d4f9fef106c","type":"switch","z":"817bda0157563770","name":"PWR status","property":"payload","propertyType":"msg","rules":[{"t":"cont","v":"!PWR(ON)","vt":"str"},{"t":"cont","v":"!PWR(OFF)","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":1330,"y":700,"wires":[["64e5674550ee4c62"],["8cf2286bc9be0ab8"]]},{"id":"8cf2286bc9be0ab8","type":"api-call-service","z":"817bda0157563770","name":"TDAI is off","server":"8ceaa1a2.5a09f","version":5,"debugenabled":true,"domain":"input_boolean","service":"turn_off","areaId":[],"deviceId":[],"entityId":["input_boolean.tdai_powerstatus"],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1510,"y":740,"wires":[[]]},{"id":"29b65025d6def908","type":"api-call-service","z":"817bda0157563770","name":"TDAI is on","server":"8ceaa1a2.5a09f","version":5,"debugenabled":true,"domain":"input_boolean","service":"turn_on","areaId":[],"deviceId":[],"entityId":["input_boolean.tdai_powerstatus"],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":850,"y":380,"wires":[[]]},{"id":"4b8f6b9e6a0faee1","type":"switch","z":"817bda0157563770","name":"Parse input trigger","property":"payload","propertyType":"msg","rules":[{"t":"cont","v":"!ON","vt":"str"},{"t":"cont","v":"!OFF","vt":"str"},{"t":"cont","v":"SRC","vt":"str"},{"t":"cont","v":"!VOL","vt":"str"}],"checkall":"true","repair":false,"outputs":4,"x":630,"y":420,"wires":[["29b65025d6def908"],["911ee78b2a565feb"],["1fc49fb532090529"],["1e25f439db7c41f2"]]},{"id":"911ee78b2a565feb","type":"api-call-service","z":"817bda0157563770","name":"TDAI is off","server":"8ceaa1a2.5a09f","version":5,"debugenabled":true,"domain":"input_boolean","service":"turn_off","areaId":[],"deviceId":[],"entityId":["input_boolean.tdai_powerstatus"],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":850,"y":420,"wires":[[]]},{"id":"8ceaa1a2.5a09f","type":"server","name":"HomeAssistant","version":5,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"","connectionDelay":false,"cacheJson":false,"heartbeat":false,"heartbeatInterval":"","areaSelector":"friendlyName","deviceSelector":"friendlyName","entitySelector":"friendlyName","statusSeparator":"at: ","statusYear":"hidden","statusMonth":"short","statusDay":"numeric","statusHourCycle":"h23","statusTimeFormat":"h:m","enableGlobalContextStore":true},{"id":"0ffbecd6a8416847","type":"ha-entity-config","server":"8ceaa1a2.5a09f","deviceConfig":"30f7e9dc29c13dea","name":"tdai.volume","version":"6","entityType":"sensor","haConfig":[{"property":"name","value":"TDAI-1120 Volume"},{"property":"icon","value":""},{"property":"entity_category","value":""},{"property":"device_class","value":""},{"property":"unit_of_measurement","value":"dB"},{"property":"state_class","value":""}],"resend":false,"debugEnabled":false},{"id":"b0f71ceab7f4a062","type":"ha-entity-config","server":"8ceaa1a2.5a09f","deviceConfig":"30f7e9dc29c13dea","name":"tdai.source","version":"6","entityType":"sensor","haConfig":[{"property":"name","value":"TDAI-1120 Source"},{"property":"icon","value":""},{"property":"entity_category","value":""},{"property":"device_class","value":""},{"property":"unit_of_measurement","value":""},{"property":"state_class","value":""}],"resend":false,"debugEnabled":false},{"id":"de32d2e0f0f9525e","type":"mqtt-broker","name":"HA-MQTT","broker":"localhost","port":"1883","clientid":"core-mosquitto","autoConnect":true,"usetls":false,"protocolVersion":"4","keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","birthMsg":{},"closeTopic":"","closeQos":"0","closePayload":"","closeMsg":{},"willTopic":"","willQos":"0","willPayload":"","willMsg":{},"userProps":"","sessionExpiry":""},{"id":"30f7e9dc29c13dea","type":"ha-device-config","name":"TDAI-1120","hwVersion":"","manufacturer":"Lyngdorf","model":"","swVersion":""}]

I got my current Netflix activity in a mediaplayer template card with this

image

Now I’m going to try and supply some sort of epsiode image to it and find a way to trigger the node-red flow to fill it.This will be a bigger challenge

1 Like

does anybody have any idea how to set this up with a denon pma 900 hne? it uses heos integration, i am trying to get speaker a, b, and a+b buttons.

i was able to telnet into the amp and see these commands when i press the speaker button on the actual amp.

  • PSSPK A

  • PSSPK B

  • PSSPK AB

  • PSSPK OFF

there is no button on the remote for speaker(s) and the heos app does not show back a command when switching the toggle

thank you!

Hello,
with the entity “number.omnilink_zone_2_volume” I can adjust my media player volume but with this configuration the volume selection doesn’t work:

media_player:
  platform: media_player_template
  media_players:
    2bagno:
      value_template: >
        {% if is_state("switch.omnilink_zone_2", "on") -%}
          on
        {%- else -%}
          off
        {%- endif %}
      turn_on:
        service: switch.turn_on
        data_template:
          entity_id: switch.omnilink_zone_2
      turn_off:
        service: switch.turn_off
        data_template:
          entity_id: switch.omnilink_zone_2
      set_volume:
        service: number.set_value
        data:
          entity_id: number.omnilink_zone_2_volume
          value: "{{volume}}"

what am I doing wrong?

Looks like you are trying to set up with omnilink now that it has support for audio. Please let me know how it goes for you, so far I’m not sure how to get this to work. I’ve installed Media_player.template but I’m not sure where to put the config you have above. I was hoping I would see a media entity that I could make a card for using the Mushroom Media Card.

Did you find a solution to this?

If you can telnet into your device, I’m thinking you should also be able to ssh into it as well, right? If yes, then you should be able to configure a shell_command integration in your configuration.yaml like the following.

shell_command:
  shutdown_macmini3: ssh -o UserKnownHostsFile=/config/.ssh/known_hosts -i /config/.ssh/id_rsa [email protected] sudo shutdown -h now

To get this to work, you need to first add the ssh login credentials of the device into a local UserKnownHostsFile, so it won’t ask for a password and simply would do a login-and-run-command action.

So in the above example, when I press a button, macmini shuts down.

Similar thing is also possible for JSON commands using a rest_command integration if your receiver supports them.
which would be something like the following.
This example selects source input of a bias led device in my case (usb_capture or led_device).

rest_command:
  hyperhdr_usb_capture:
    url: http://192.168.xx.xx:8090/json-rpc
    method: POST
    headers:
      accept: 'application/json, text/html'
      user-agent: 'Mozilla/5.0 {{ useragent }}'
    payload: '{ "command":"componentstate", "componentstate": { "component":"VIDEOGRABBER", "state": {{ state }} } }'
    content_type:  'application/json; charset=utf-8'
  hyperhdr_led_device:
    url: http://192.168.xx.xx:8090/json-rpc
    method: POST
    headers:
      accept: 'application/json, text/html'
      user-agent: 'Mozilla/5.0 {{ useragent }}'
    payload: '{ "command":"componentstate", "componentstate": { "component":"LEDDEVICE", "state": {{ state }} } }'
    content_type:  'application/json; charset=utf-8'

I hope this helps.