Creation d'une telecommande pour la free POp

Bonsoir a tous,
Voila je partage ma première création une télécommande pour la free POP.
je ne reprends pas le post déjà crée car la pop est assez différentes.

Pardonnez moi le coté un peux lourd voir peut être inutile de certaines de mes cases mais je ne maitrise pas bien lovelace.
Si des pro on des suggestions d 'amélioration comme des grilles( je maitrise pas du tout le truc) plutôt que des vertical-stack… ou alors un cadre pour faire plus propre je suis preneurs.
Je reste assez dispo pour travaillez avec vous

c’est autant un post de partage que d 'ameliorations.
Pout le moment il ne s’agit que de la version graphique quand je serais assez satisfait du resultat j’ajouterais les actions des boutons.

Bon on commence l’original:

Voila ma creations

et le code qui va avec:

type: vertical-stack
cards:
  - type: horizontal-stack
    cards:
      - type: custom:button-card
        styles:
          card:
            - '--ha-card-background': rgba(0, 0, 0, 0.0)
            - box-shadow: none
      - type: custom:button-card
        styles:
          card:
            - '--ha-card-background': rgba(0, 0, 0, 0.0)
            - box-shadow: none
      - type: button
        tap_action:
          action: navigate
        navigation_path: overview
        entity: null
        show_icon: true
        show_name: false
        icon: mdi:power
  - type: horizontal-stack
    cards:
      - type: custom:button-card
        styles:
          icon:
            - color: blue
          entity: switch.sony_source
        icon: mdi:kodi
        show_name: false
        tap_action:
          action: toggle
        icon_height: 10px
      - type: custom:button-card
        styles:
          icon:
            - color: cyan
        tap_action:
          action: toggle
        entity: switch.sony_power
        icon: si:primevideo
        show_name: false
        icon_height: 10px
  - type: custom:button-card
    styles:
      icon:
        - color: red
    tap_action:
      action: navigate
    navigation_path: overview
    entity: null
    show_icon: true
    show_name: true
    name: Free
  - type: horizontal-stack
    cards:
      - type: button
        tap_action:
          action: navigate
        navigation_path: overview
        entity: null
        show_icon: true
        show_name: false
        icon: mdi:google-assistant
      - type: custom:button-card
        styles:
          card:
            - '--ha-card-background': rgba(0, 0, 0, 0.0)
            - box-shadow: none
      - type: button
        tap_action:
          action: navigate
        navigation_path: overview
        entity: null
        show_icon: true
        show_name: false
        icon: mdi:home
  - type: horizontal-stack
    cards:
      - type: custom:button-card
        styles:
          card:
            - '--ha-card-background': rgba(0, 0, 0, 0.0)
            - box-shadow: none
      - type: custom:button-card
        styles:
          icon:
            - color: white
        tap_action:
          action: toggle
        entity: switch.sony_up
        icon: mdi:arrow-up
        icon_height: 50px
        show_name: false
      - type: custom:button-card
        styles:
          card:
            - '--ha-card-background': rgba(0, 0, 0, 0.0)
            - box-shadow: none
  - type: horizontal-stack
    cards:
      - type: custom:button-card
        styles:
          icon:
            - color: white
        tap_action:
          action: toggle
        entity: switch.sony_left
        icon: mdi:arrow-left
        icon_height: 50px
        show_name: false
      - type: custom:button-card
        styles:
          icon:
            - color: white
        tap_action:
          action: toggle
        entity: switch.sony_select
        icon: mdi:arrow-all
        icon_height: 50px
        show_name: false
        hold_action:
          action: toggle
      - type: custom:button-card
        styles:
          icon:
            - color: white
        tap_action:
          action: toggle
        entity: switch.sony_right
        icon: mdi:arrow-right
        icon_height: 50px
        show_name: false
  - type: horizontal-stack
    cards:
      - type: custom:button-card
        styles:
          card:
            - '--ha-card-background': rgba(0, 0, 0, 0.0)
            - box-shadow: none
      - type: custom:button-card
        styles:
          icon:
            - color: white
        tap_action:
          action: toggle
        entity: switch.sony_down
        show_name: false
        icon: mdi:arrow-down
        icon_height: 50px
      - type: custom:button-card
        styles:
          card:
            - '--ha-card-background': rgba(0, 0, 0, 0.0)
            - box-shadow: none
  - type: horizontal-stack
    cards:
      - type: custom:button-card
        styles:
          card:
            - '--ha-card-background': rgba(0, 0, 0, 0.0)
            - box-shadow: none
      - show_name: false
        show_icon: true
        type: button
        tap_action:
          action: toggle
        icon: mdi:keyboard-return
      - type: custom:button-card
        styles:
          card:
            - '--ha-card-background': rgba(0, 0, 0, 0.0)
            - box-shadow: none
  - type: horizontal-stack
    cards:
      - type: custom:vertical-stack-in-card
        cards:
          - show_name: false
            show_icon: true
            type: custom:button-card
            tap_action:
              action: toggle
            icon: mdi:volume-plus
          - content: |
              #
            type: markdown
          - content: |
              #
            type: markdown
          - content: |
              #
            type: markdown
          - content: |
              #
            type: markdown
          - content: |
              #
            type: markdown
          - type: custom:button-card
            tap_action:
              action: toggle
            icon: mdi:volume-minus
            show_name: false
      - type: custom:vertical-stack-in-card
        cards:
          - content: |
              #
            type: markdown
          - content: |
              #
            type: markdown
          - content: |
              #
            type: markdown
          - show_name: false
            show_icon: true
            type: custom:button-card
            tap_action:
              action: toggle
            icon: mdi:volume-mute
          - content: |
              #
            type: markdown
          - content: |
              #
            type: markdown
          - content: |
              #
            type: markdown
      - type: custom:vertical-stack-in-card
        cards:
          - show_name: false
            show_icon: true
            type: custom:button-card
            tap_action:
              action: toggle
            icon: mdi:plus
          - content: |
              #
            type: markdown
          - content: |
              #
            type: markdown
          - content: |
              #
            type: markdown
          - content: |
              #
            type: markdown
          - content: |
              #
            type: markdown
          - type: custom:button-card
            tap_action:
              action: toggle
            icon: mdi:minus
            show_name: false
  - type: horizontal-stack
    cards:
      - show_name: true
        show_icon: false
        type: button
        tap_action:
          action: toggle
        name: '1'
      - show_name: true
        show_icon: false
        type: button
        tap_action:
          action: toggle
        name: '2'
      - show_name: true
        show_icon: false
        type: button
        tap_action:
          action: toggle
        name: '3'
        show_state: false
  - type: horizontal-stack
    cards:
      - show_name: true
        show_icon: false
        type: button
        tap_action:
          action: toggle
        name: '4'
      - show_name: true
        show_icon: false
        type: button
        tap_action:
          action: toggle
        name: '5'
      - show_name: true
        show_icon: false
        type: button
        tap_action:
          action: toggle
        name: '6'
  - type: horizontal-stack
    cards:
      - show_name: true
        show_icon: false
        type: button
        tap_action:
          action: toggle
        name: '7'
      - show_name: true
        show_icon: false
        type: button
        tap_action:
          action: toggle
        name: '8'
      - show_name: true
        show_icon: false
        type: button
        tap_action:
          action: toggle
        name: '9'
  - type: horizontal-stack
    cards:
      - type: custom:button-card
        styles:
          card:
            - '--ha-card-background': rgba(0, 0, 0, 0.0)
            - box-shadow: none
      - show_name: true
        show_icon: false
        type: button
        tap_action:
          action: toggle
        name: '0'
      - type: custom:button-card
        styles:
          card:
            - '--ha-card-background': rgba(0, 0, 0, 0.0)
            - box-shadow: none

J’attends vos retours
Merci

5 « J'aime »

Merci pour le partage :+1:

Salut @orionis
Je suis débutant sur HA, pouvez m’indiquer où place ce code svp ? J’essaie de faire pareil pour créer une page sur le tableau de bord

Hello @Pitt13

Tu dois :

  1. installer HACS
  2. via HACS, tu installes la button-card dans Interface
  3. dans ton aperçu (tableau de bord principal), tu cliques en haut à droite pour passer en mode édition (modifier le tableau de bord)
  4. tu cliques en bas à droite pour ajouter une carte
  5. tu descends tout en bas pour manuel et tu colles ce code en l’adaptant à tes entités
1 « J'aime »

Hello @orionis
Je pense que tu as également dû voir passer cette carte sur le net; la tienne a l’avantage des chiffres en +

Bonjour,

Moi j’ai fait comme ça :


(c’est en pop-up)

Je vous mets le code, mais soyez indulgent, il n’est peut être pas très propre, je me suis basé sur des post traitant du sujet.

Code
  - type: custom:mushroom-media-player-card
    entity: media_player.freebox_player_pop
    name: Player Pop
    icon: mdi:television-classic
    fill_container: true
    secondary_info: state
    primary_info: name
    icon_type: icon
    use_media_info: true
    show_volume_level: true
    volume_controls:
      - volume_mute
      - volume_set
      - volume_buttons
    media_controls:
      - on_off
      - shuffle
      - previous
      - play_pause_stop
      - next
      - repeat
    collapsible_controls: true
    card_mod:
      style: |
        ha-card {
          height: 80px !important;
           }
        :host {
          --mush-icon-size: 55px;
          --mush-card-primary-font-size: 15px;
          --mush-card-secondary-font-size: 10px; 
         }
    tap_action:
      action: fire-dom-event
      browser_mod:
        service: browser_mod.popup
        deviceID:
          - this
        data:
          content:
            style: '--popup-max-width: 100px;'
            type: vertical-stack
            cards:
              - type: horizontal-stack
                cards:
                  - type: custom:button-card
                    styles:
                      card:
                        - '--ha-card-background': rgba(0, 0, 0, 0.0)
                        - box-shadow: none
                  - type: custom:button-card
                    styles:
                      card:
                        - '--ha-card-background': rgba(0, 0, 0, 0.0)
                        - box-shadow: none
                  - type: custom:button-card
                    styles:
                      icon:
                        - height: 20px
                    tap_action:
                      action: call-service
                      service: remote.send_command
                      service_data:
                        command: POWER
                        entity_id: remote.freebox_player_pop
                    show_icon: true
                    show_name: false
                    icon: mdi:power
              - type: horizontal-stack
                cards:
                  - type: custom:button-card
                    styles:
                      icon:
                        - color: red
                        - height: 40px
                    icon: mdi:netflix
                    show_name: false
                    tap_action:
                      action: call-service
                      service: remote.turn_on
                      service_data:
                        activity: https://www.netflix.com/title
                        entity_id: remote.freebox_player_pop
                  - type: custom:button-card
                    tap_action:
                      action: call-service
                      service: remote.turn_on
                      service_data:
                        activity: net.oqee.androidtv
                        entity_id: remote.freebox_player_pop
                    card_mod:
                      style:
                        .: |
                          ha-card {
                            height: 60px !important;
                            
                            background-image: url("https://oqee.tv/img/oqee-by-free1.svg");
                            background-repeat: no-repeat;
                            background-size: 40%;
                            background-position: center
                           }
                  - type: custom:button-card
                    styles:
                      icon:
                        - color: cyan
                        - height: 40px
                    icon: phu:prime-video
                    show_name: false
                    tap_action:
                      action: call-service
                      service: remote.turn_on
                      service_data:
                        activity: https://app.primevideo.com
                        entity_id: remote.freebox_player_pop
              - type: horizontal-stack
                cards:
                  - type: custom:button-card
                    styles:
                      icon:
                        - height: 40px
                    tap_action:
                      action: call-service
                      service: remote.turn_on
                      service_data:
                        activity: https://assistant.google.com
                        entity_id: remote.freebox_player_pop
                    show_icon: true
                    show_name: false
                    icon: mdi:google-assistant
                  - type: custom:button-card
                    styles:
                      card:
                        - '--ha-card-background': rgba(0, 0, 0, 0.0)
                        - box-shadow: none
                  - type: custom:button-card
                    styles:
                      icon:
                        - height: 40px
                    tap_action:
                      action: call-service
                      service: remote.send_command
                      service_data:
                        command: HOME
                        entity_id: remote.freebox_player_pop
                    show_icon: true
                    show_name: false
                    icon: mdi:home
              - type: horizontal-stack
                cards:
                  - type: custom:button-card
                    styles:
                      card:
                        - '--ha-card-background': rgba(0, 0, 0, 0.0)
                        - box-shadow: none
                  - type: custom:button-card
                    styles:
                      icon:
                        - color: white
                        - height: 40px
                    tap_action:
                      action: call-service
                      service: remote.send_command
                      service_data:
                        command: DPAD_UP
                        entity_id: remote.freebox_player_pop
                    icon: mdi:arrow-up
                    show_name: false
                  - type: custom:button-card
                    styles:
                      card:
                        - '--ha-card-background': rgba(0, 0, 0, 0.0)
                        - box-shadow: none
              - type: horizontal-stack
                cards:
                  - type: custom:button-card
                    styles:
                      icon:
                        - color: white
                        - height: 40px
                    tap_action:
                      action: call-service
                      service: remote.send_command
                      service_data:
                        command: DPAD_LEFT
                        entity_id: remote.freebox_player_pop
                    icon: mdi:arrow-left
                    show_name: false
                  - type: custom:button-card
                    styles:
                      icon:
                        - color: white
                        - height: 40px
                    tap_action:
                      action: call-service
                      service: remote.send_command
                      service_data:
                        command: DPAD_CENTER
                        entity_id: remote.freebox_player_pop
                    icon: mdi:arrow-all
                    show_name: false
                  - type: custom:button-card
                    styles:
                      icon:
                        - color: white
                        - height: 40px
                    tap_action:
                      action: call-service
                      service: remote.send_command
                      service_data:
                        command: DPAD_RIGHT
                        entity_id: remote.freebox_player_pop
                    icon: mdi:arrow-right
                    show_name: false
              - type: horizontal-stack
                cards:
                  - type: custom:button-card
                    styles:
                      card:
                        - '--ha-card-background': rgba(0, 0, 0, 0.0)
                        - box-shadow: none
                  - type: custom:button-card
                    styles:
                      icon:
                        - color: white
                        - height: 40px
                    tap_action:
                      action: call-service
                      service: remote.send_command
                      service_data:
                        command: DPAD_DOWN
                        entity_id: remote.freebox_player_pop
                    show_name: false
                    icon: mdi:arrow-down
                  - type: custom:button-card
                    styles:
                      card:
                        - '--ha-card-background': rgba(0, 0, 0, 0.0)
                        - box-shadow: none
              - type: horizontal-stack
                cards:
                  - type: custom:button-card
                    styles:
                      card:
                        - '--ha-card-background': rgba(0, 0, 0, 0.0)
                        - box-shadow: none
                  - type: custom:button-card
                    styles:
                      card:
                        - '--ha-card-background': rgba(0, 0, 0, 0.0)
                        - box-shadow: none
                        - height: 40px
                    show_name: false
                    show_icon: true
                    tap_action:
                      action: call-service
                      service: remote.send_command
                      service_data:
                        command: BACK
                        entity_id: remote.freebox_player_pop
                    icon: mdi:keyboard-return
                  - type: custom:button-card
                    styles:
                      card:
                        - '--ha-card-background': rgba(0, 0, 0, 0.0)
                        - box-shadow: none
              - type: horizontal-stack
                cards:
                  - type: vertical-stack
                    cards:
                      - show_name: false
                        show_icon: true
                        type: custom:button-card
                        styles:
                          card:
                            - height: 40px
                        tap_action:
                          action: call-service
                          service: remote.send_command
                          service_data:
                            command: VOLUME_UP
                            entity_id: remote.freebox_player_pop
                        icon: mdi:volume-plus
                      - content: |
                          #
                        type: markdown
                      - content: |
                          #
                        type: markdown
                      - type: custom:button-card
                        styles:
                          card:
                            - height: 40px
                        tap_action:
                          action: call-service
                          service: remote.send_command
                          service_data:
                            command: VOLUME_DOWN
                            entity_id: remote.freebox_player_pop
                        icon: mdi:volume-minus
                        show_name: false
                  - type: vertical-stack
                    cards:
                      - content: |
                          #
                        type: markdown
                      - content: |
                          #
                        type: markdown
                      - type: custom:button-card
                        styles:
                          card:
                            - height: 40px
                        show_name: false
                        show_icon: true
                        tap_action:
                          action: call-service
                          service: remote.send_command
                          service_data:
                            command: MUTE
                            entity_id: remote.freebox_player_pop
                        icon: mdi:volume-mute
                      - content: |
                          #
                        type: markdown
                      - content: |
                          #
                        type: markdown
                  - type: vertical-stack
                    cards:
                      - show_name: false
                        show_icon: true
                        type: custom:button-card
                        styles:
                          card:
                            - height: 40px
                        tap_action:
                          action: call-service
                          service: remote.send_command
                          service_data:
                            command: CHANNEL_UP
                            entity_id: remote.freebox_player_pop
                        icon: mdi:plus
                      - content: |
                          #
                        type: markdown
                      - content: |
                          #
                        type: markdown
                      - type: custom:button-card
                        styles:
                          card:
                            - height: 40px
                        tap_action:
                          action: call-service
                          service: remote.send_command
                          service_data:
                            command: CHANNEL_DOWN
                            entity_id: remote.freebox_player_pop
                        icon: mdi:minus
                        show_name: false
              - type: horizontal-stack
                cards:
                  - type: custom:button-card
                    show_name: true
                    show_icon: false
                    tap_action:
                      action: call-service
                      service: remote.send_command
                      service_data:
                        command: 1
                        entity_id: remote.freebox_player_pop
                    name: '1'
                  - type: custom:button-card
                    show_name: true
                    show_icon: false
                    tap_action:
                      action: call-service
                      service: remote.send_command
                      service_data:
                        command: 2
                        entity_id: remote.freebox_player_pop
                    name: '2'
                  - type: custom:button-card
                    show_name: true
                    show_icon: false
                    tap_action:
                      action: call-service
                      service: remote.send_command
                      service_data:
                        command: 3
                        entity_id: remote.freebox_player_pop
                    name: '3'
              - type: horizontal-stack
                cards:
                  - type: custom:button-card
                    show_name: true
                    show_icon: false
                    tap_action:
                      action: call-service
                      service: remote.send_command
                      service_data:
                        command: 4
                        entity_id: remote.freebox_player_pop
                    name: '4'
                  - type: custom:button-card
                    show_name: true
                    show_icon: false
                    tap_action:
                      action: call-service
                      service: remote.send_command
                      service_data:
                        command: 5
                        entity_id: remote.freebox_player_pop
                    name: '5'
                  - type: custom:button-card
                    show_name: true
                    show_icon: false
                    tap_action:
                      action: call-service
                      service: remote.send_command
                      service_data:
                        command: 6
                        entity_id: remote.freebox_player_pop
                    name: '6'
              - type: horizontal-stack
                cards:
                  - type: custom:button-card
                    show_name: true
                    show_icon: false
                    tap_action:
                      action: call-service
                      service: remote.send_command
                      service_data:
                        command: 7
                        entity_id: remote.freebox_player_pop
                    name: '7'
                  - type: custom:button-card
                    show_name: true
                    show_icon: false
                    tap_action:
                      action: call-service
                      service: remote.send_command
                      service_data:
                        command: 8
                        entity_id: remote.freebox_player_pop
                    name: '8'
                  - type: custom:button-card
                    show_name: true
                    show_icon: false
                    tap_action:
                      action: call-service
                      service: remote.send_command
                      service_data:
                        command: 9
                        entity_id: remote.freebox_player_pop
                    name: '9'
              - type: horizontal-stack
                cards:
                  - type: custom:button-card
                    styles:
                      card:
                        - '--ha-card-background': rgba(0, 0, 0, 0.0)
                        - box-shadow: none
                  - type: custom:button-card
                    show_name: true
                    show_icon: false
                    tap_action:
                      action: call-service
                      service: remote.send_command
                      service_data:
                        command: 0
                        entity_id: remote.freebox_player_pop
                    name: '0'
                  - type: custom:button-card
                    styles:
                      card:
                        - '--ha-card-background': rgba(0, 0, 0, 0.0)
                        - box-shadow: none
1 « J'aime »

Hello

A toute fin utile, il est aussi possible de lancer directement une chaine via un deep link

service: remote.turn_on
data:
  activity: https://oq.ee/channel/273/play
target:
  entity_id: remote.freebox_player_pop

( Attention à l’url appelée qui est oq.ee et non oqee.tv)

Pour obtenir le numéro d’un canal spécifique, se rendre sur OQEE by Free

Cliquez sur un chaine et récuperez le numéro affiché dans l’URL sous la forme https://oqee.tv/home/channels/270

@+