!include_dir_merge_named themes Je pige pas?

Mon problème

Bonjour à toutes et à tous,
J’ai réussi à intégrer les couleurs Tempo à mon module NRJ mais via mon configuration.yaml, j’aurais souhaité, afin de l’alléger, déplacer cette modification dans le dossier thèmes, mais cela ne fonctionne pas o_O

Mon configuration.yaml

#Load frontend themes from the themes folder
frontend:
#  themes: !include_dir_merge_named themes
  themes:
    theme_couleurs_tempo:
      #primary-color: "#264269"
      modes:
        light:
          energy-grid-consumption-color-5: "#8B0000"  # HP ROUGE
          energy-grid-consumption-color-4: "#FF0000"  # HC ROUGE
          energy-grid-consumption-color-3: "#fbfbfb"  # HP BLANC
          energy-grid-consumption-color-2: "#d7d7d7"  # HC BLANC
          energy-grid-consumption-color-1: "#9BE1FD"  # HP BLEU
          energy-grid-consumption-color-0: "#039DE0"  # HC BLEU
        dark:
          energy-grid-consumption-color-5: "#FF0000"  # HP ROUGE
          energy-grid-consumption-color-4: "#aa2424"  # HC ROUGE
          energy-grid-consumption-color-3: "#fbfbfb"  # HP BLANC
          energy-grid-consumption-color-2: "#d7d7d7"  # HC BLANC
          energy-grid-consumption-color-1: "#2a81eb"  # HP BLEU
          energy-grid-consumption-color-0: "#0c57b4"  # HC BLEU

Mon fichier thème dans le dossier themes


# themes/theme_couleurs_tempo.yaml
theme_couleurs_tempo:
  #primary-color: "#264269"
  modes:
    light:
      energy-grid-consumption-color-5: "#8B0000"  # HP ROUGE
      energy-grid-consumption-color-4: "#FF0000"  # HC ROUGE
      energy-grid-consumption-color-3: "#fbfbfb"  # HP BLANC
      energy-grid-consumption-color-2: "#d7d7d7"  # HC BLANC
      energy-grid-consumption-color-1: "#9BE1FD"  # HP BLEU
      energy-grid-consumption-color-0: "#039DE0"  # HC BLEU
    dark:
      energy-grid-consumption-color-5: "#FF0000"  # HP ROUGE
      energy-grid-consumption-color-4: "#aa2424"  # HC ROUGE
      energy-grid-consumption-color-3: "#fbfbfb"  # HP BLANC
      energy-grid-consumption-color-2: "#d7d7d7"  # HC BLANC
      energy-grid-consumption-color-1: "#2a81eb"  # HP BLEU
      energy-grid-consumption-color-0: "#0c57b4"  # HC BLEU

Merci de vos lumières !

Ma configuration


[center]## System Information

version core-2024.1.6
installation_type Home Assistant OS
dev false
hassio true
docker true
user root
virtualenv false
python_version 3.11.6
os_name Linux
os_version 6.1.71-haos
arch aarch64
timezone Europe/Paris
config_dir /config
Home Assistant Community Store
GitHub API ok
GitHub Content ok
GitHub Web ok
GitHub API Calls Remaining 5000
Installed Version 1.34.0
Stage running
Available Repositories 1456
Downloaded Repositories 21
HACS Data ok
Home Assistant Cloud
logged_in true
subscription_expiration 16 janvier 2025 à 01:00
relayer_connected true
relayer_region eu-central-1
remote_enabled true
remote_connected true
alexa_enabled true
google_enabled false
remote_server eu-central-1-2.ui.nabu.casa
certificate_status ready
instance_id 9b1354271d894ddab777f6bfe47bce87
can_reach_cert_server ok
can_reach_cloud_auth ok
can_reach_cloud ok
Home Assistant Supervisor
host_os Home Assistant OS 11.4
update_channel stable
supervisor_version supervisor-2023.12.1
agent_version 1.6.0
docker_version 24.0.7
disk_total 28.0 GB
disk_used 9.2 GB
healthy true
supported true
board green
supervisor_api ok
version_api ok
installed_addons Terminal & SSH (9.8.1), Linky (1.2.0), Home Assistant Google Drive Backup (0.112.1), Studio Code Server (5.15.0), Silicon Labs Multiprotocol (2.4.4), Mosquitto broker (6.4.0)
Dashboards
dashboards 2
resources 21
views 9
mode storage
Recorder
oldest_recorder_run 26 janvier 2024 à 05:46
current_recorder_run 4 février 2024 à 06:54
estimated_db_size 2211.20 MiB
database_engine sqlite
database_version 3.41.2
Spotify
api_endpoint_reachable ok
[/center]

Salut,
Est ce que tu as appelé ton thème dans ton profil ?

Capture d'écran 2024-02-04 071441

Dans mon fichier de thème :

   # Bleu nuit: HC Bleu
  energy-grid-consumption-color-0: '#0f056b'
  # Bleu -magenta : HP Bleu
  energy-grid-consumption-color-1: '#3737e9'
  # Gris: HC Blanc 
  energy-grid-consumption-color-2: '#cccccc'
  # Blanc : HP Blanc
  energy-grid-consumption-color-3: '#fff'
  # Rouge sang: HC Rouge
  energy-grid-consumption-color-4: '#850606'
  # Red : HP Rouge
  energy-grid-consumption-color-5: '#E60000'
  # Standard : Tarif Base
  energy-grid-consumption-color-6: '#9eb75c'

Configuration.yaml :

frontend:
  themes:
     !include_dir_merge_named themes

Oui en faisant la même chose que toi et en rechargeant tout le yaml, j’ai ça :

Pas de thème dispo

Tu as un répertoire theme avec ton fichier yaml dedans ?

Capture d'écran 2024-02-04 073622

Le mien est un mix du thème de caule mélangé avec les couleurs tempo

Oui, fichier couleurs_tempo dans dossier themes

image

Il n’y a pas l’extension .yaml ?

Ah quelle buse !!!
Alors oui pas d’extension :confused:
C’est corrigé, mais il me met ceci désormais :

Erreurs de configuration
Invalid config for 'frontend' at themes/couleurs_tempo.yaml, line 11: expected a dictionary for dictionary value 'frontend->themes->energy-grid-consumption-color-4', got '#850606'
Invalid config for 'frontend' at themes/couleurs_tempo.yaml, line 13: expected a dictionary for dictionary value 'frontend->themes->energy-grid-consumption-color-5', got '#E60000'
Invalid config for 'frontend' at themes/couleurs_tempo.yaml, line 15: expected a dictionary for dictionary value 'frontend->themes->energy-grid-consumption-color-6', got '#9eb75c'
Invalid config for 'frontend' at themes/couleurs_tempo.yaml, line 3: expected a dictionary for dictionary value 'frontend->themes->energy-grid-consumption-color-0', got '#0f056b'
Invalid config for 'frontend' at themes/couleurs_tempo.yaml, line 5: expected a dictionary for dictionary value 'frontend->themes->energy-grid-consumption-color-1', got '#3737e9'
Invalid config for 'frontend' at themes/couleurs_tempo.yaml, line 7: expected a dictionary for dictionary value 'frontend->themes->energy-grid-consumption-color-2', got '#cccccc'
Invalid config for 'frontend' at themes/couleurs_tempo.yaml, line 9: expected a dictionary for dictionary value 'frontend->themes->energy-grid-consumption-color-3', got '#fff'

Cela marche avec ce code pour le thème :

couleurs_tempo:
  # Bleu nuit: HC Bleu
  energy-grid-consumption-color-0: '#0f056b'
  # Bleu - magenta: HP Bleu
  energy-grid-consumption-color-1: '#3737e9'
  # Gris: HC Blanc 
  energy-grid-consumption-color-2: '#cccccc'
  # Blanc: HP Blanc
  energy-grid-consumption-color-3: '#fff'
  # Rouge sang: HC Rouge
  energy-grid-consumption-color-4: '#850606'
  # Red: HP Rouge
  energy-grid-consumption-color-5: '#E60000'
  # Standard: Tarif Base
  energy-grid-consumption-color-6: '#9eb75c'

Mais du coup en sélectionnant ce thème, je perds le dark mode :confused:

Edit :
Non c’est bon, j’ai enfin compris :

couleurs_tempo:
  #primary-color: "#264269"
  modes:
    light:
      energy-grid-consumption-color-5: "#8B0000"  # HP ROUGE
      energy-grid-consumption-color-4: "#FF0000"  # HC ROUGE
      energy-grid-consumption-color-3: "#fbfbfb"  # HP BLANC
      energy-grid-consumption-color-2: "#d7d7d7"  # HC BLANC
      energy-grid-consumption-color-1: "#9BE1FD"  # HP BLEU
      energy-grid-consumption-color-0: "#039DE0"  # HC BLEU
    dark:
      energy-grid-consumption-color-5: "#FF0000"  # HP ROUGE
      energy-grid-consumption-color-4: "#aa2424"  # HC ROUGE
      energy-grid-consumption-color-3: "#fbfbfb"  # HP BLANC
      energy-grid-consumption-color-2: "#d7d7d7"  # HC BLANC
      energy-grid-consumption-color-1: "#2a81eb"  # HP BLEU
      energy-grid-consumption-color-0: "#0c57b4"  # HC BLEU

Merci @Ludoc de ton aide :pray:

1 « J'aime »