Aller au contenu
Voir dans l’app

Une meilleure façon de naviguer. Voir plus.

Forum Domotique

Une application en plein écran, avec notifications, badges et accès direct depuis l’accueil.

Pour installer cette application sur iOS et iPadOS
  1. Touchez l’icône de partage dans Safari.
  2. Faites défiler le menu et touchez Ajouter à l’écran d’accueil.
  3. Touchez Ajouter en haut à droite.
Pour installer cette application sur Android
  1. Appuyez sur le menu ⋮ en haut à droite du navigateur.
  2. Appuyez sur Ajouter à l'écran d'accueil ou Installer l'application
  3. Confirmez en appuyant sur Installer.

Cartes d'affichage de l'heure et de la date

Featured Replies

Posté(e)

Voici des cartes permettant d'afficher l'heure un peu différemment que proposé nativement.

Prérequis:

Cartes:

Vous pouvez bien entendu mettre cette carte dans le cadre de titre en haut de votre tableau de bord.
Pour ce faire il suffit de cliquer sur le bouton permettant d'ajouter un titre, et de remplacer le YAML de la carte par celle que je propose.

image.png

type: custom:button-card
layout: icon_name_state2nd
entity: sensor.date
size: 24px
show_icon: false
show_name: false
show_state: false
styles:
  card:
    - padding: 0
    - padding-top: 26px
  grid:
    - grid-template-areas: '''date s'''
    - grid-template-columns: auto min-content
    - grid-template-rows: auto min-content
  custom_fields:
    date:
      - align-self: end
      - justify-self: right
      - margin-right: 15px
      - margin-bottom: 9px
      - font-size: 16px
      - text-align: right
custom_fields:
  date: |-
    [[[
      let now = new Date();
      let month = ["Janvier", "Février", "Mars", "Avril", "Mai", "Juin", "Juillet", "Août", "Septembre", "Octobre", "Novembre", "Décembre"];
      return now.getDate() + ' ' + month[now.getMonth()] + ' ' + now.getFullYear();
    ]]]
card_mod:
  style: |
    ha-card {
      backdrop-filter: none !important;
      background-color: transparent;
      box-shadow: none;
      border: none;
    }
grid_options:
  columns: 6
  rows: 1

image.png

type: clock
clock_size: medium
show_seconds: true
grid_options:
  columns: 6
  rows: 1
card_mod:
  style:
    .: |
      ha-card {
        backdrop-filter: none !important;
        background: transparent;
        box-shadow: none;
        border: none;
      }

      ha-card > .time-wrapper.size-medium {
        height: auto;
        padding: 0;
        row-gap: 12px;
      }

      ha-card > .time-wrapper.size-medium .time-parts {
        font-size: 4rem;
      }

      ha-card > .time-wrapper.size-medium .time-parts .time-part.am-pm,
      ha-card > .time-wrapper.size-medium .time-parts .time-part.second {
        font-size: 24px;
        margin-left: 8px;
      }


image.png

type: horizontal-stack
cards:
  - type: clock
    clock_size: medium
    show_seconds: true
    grid_options:
      columns: 6
      rows: 1
    card_mod:
      style:
        .: |
          ha-card {
            backdrop-filter: none !important;
            background: transparent;
            box-shadow: none;
            border: none;
            float: right;
            margin-right: -52px
          }

          ha-card > .time-wrapper.size-medium {
            height: auto;
            padding: 0;
          }

          ha-card > .time-wrapper.size-medium .time-parts {
            font-size: 4rem;
          }

          ha-card > .time-wrapper.size-medium .time-parts .time-part.am-pm,
          ha-card > .time-wrapper.size-medium .time-parts .time-part.second {
            font-size: 22px;
            margin-left: 8px;
          }
  - type: custom:button-card
    layout: icon_name_state2nd
    entity: sensor.date
    size: 24px
    show_icon: false
    show_name: false
    show_state: false
    styles:
      card:
        - padding: 0
      grid:
        - grid-template-areas: "'date'"
        - grid-template-columns: auto
        - grid-template-rows: auto
      custom_fields:
        date:
          - height: 20px
          - align-self: end
          - justify-self: start
          - margin-left: 20px
          - margin-right: 15px
          - margin-top: 22px
          - font-size: 20px
    custom_fields:
      date: |-
        [[[
          let now = new Date();
          let month = ["Janvier", "Février", "Mars", "Avril", "Mai", "Juin", "Juillet", "Août", "Septembre", "Octobre", "Novembre", "Décembre"];
          return now.getDate() + ' ' + month[now.getMonth()] + ' ' + now.getFullYear();
        ]]]
    card_mod:
      style: |
        ha-card {
          backdrop-filter: none !important;
          background-color: transparent;
          box-shadow: none;
          border: none;
        }
grid_options:
  columns: full

image.png

type: vertical-stack
cards:
  - type: clock
    clock_size: medium
    show_seconds: true
    grid_options:
      columns: 6
      rows: 1
    card_mod:
      style:
        .: |
          ha-card {
            backdrop-filter: none !important;
            background: transparent;
            box-shadow: none;
            border: none;
          }

          ha-card > .time-wrapper.size-medium {
            height: auto;
            padding: 0;
            row-gap: 12px;
          }

          ha-card > .time-wrapper.size-medium .time-parts {
            font-size: 4rem;
          }

          ha-card > .time-wrapper.size-medium .time-parts .time-part.am-pm,
          ha-card > .time-wrapper.size-medium .time-parts .time-part.second {
            font-size: 24px;
            margin-left: 8px;
          }
  - type: custom:button-card
    layout: icon_name_state2nd
    entity: sensor.date
    size: 24px
    show_icon: false
    show_name: false
    show_state: false
    styles:
      card:
        - padding: 0
      grid:
        - grid-template-areas: "'date s'"
        - grid-template-columns: auto min-content
        - grid-template-rows: auto min-content
      custom_fields:
        date:
          - align-self: end
          - justify-self: center
          - margin-right: 15px
          - margin-bottom: 9px
          - font-size: 16px
    custom_fields:
      date: |-
        [[[
          let now = new Date();
          let month = ["Janvier", "Février", "Mars", "Avril", "Mai", "Juin", "Juillet", "Août", "Septembre", "Octobre", "Novembre", "Décembre"];
          return now.getDate() + ' ' + month[now.getMonth()] + ' ' + now.getFullYear();
        ]]]
    card_mod:
      style: |
        ha-card {
          backdrop-filter: none !important;
          background-color: transparent;
          box-shadow: none;
          border: none;
        }

Rejoindre la conversation

Vous pouvez commenter maintenant et vous inscrire plus tard. Si vous possédez un compte, connectez-vous.

Invité
Répondre à ce sujet…

Compte

Navigation

Rechercher

Rechercher

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.