Les graph de la mini-graph-card ne s'affiche plus

Ca serait balot que je doive tout remettre en place et que la 2024.12.2 corrige mon problème arghhhh

Tu sais si on peut juste restore la partie Core avec un backup complet ? on peut sauf erreur choisir de restore certains éléments mais je sais pas si le Core en fait partie

Je ne sais pas, j’ai restore que des backup complet et que deux fois en 3 ans.

La restauration du 7 est OK. J’attends de voir pour celle du 8 qui se fait en ce moment.

On dirait bien qu’on peut restore que le Core… Je reviens pour un point, ça pourra servir pour d’autres mes retours.

1 « J'aime »

Le mystères du digital…

Après avoir restore des backups en repartant à 7 jours, je suis finalement arrivé à restaurer celui de ce jour à 13:00 et devinez-quoi, tout est revenu à la normale !.

Voilà je n’ai strictement aucune explication mais le principal est que tout fonctionne bien.

Je tiens à tous vous remercier, car grâce à vous, j’ai appris énormément de choses qui me seront très utiles pour la suite aujourd’hui.

1 « J'aime »

J’ai parlé un peu trop vite, en me réveillant ce matin, à nouveau le même problème…

Tu n’as pas un message au démarrage, avec une info à propos de la base de données qui est abimée ?

1 « J'aime »

Non, aucun message. Je pense qu’elle fonctionne bien vu que la carte graph du core m’affiche la courbe.

Mini graph ne prends que les données classiques, apex sait accéder en plus aux statiques long termes. Donc pas forcement le même fonctionnement

Je viens de voir qu’il n’y a plus de maintenance sur la mini-graph-card :frowning: je n’arrive pas à avancer avec ce bug, surtout qu’avec un restore tout fonctionne, un temps du moins…

Il y a des alternatives à la mini/Apex et Plotly (que je vais supprimer pour clean un peut mon installation) ? Grafana + InfluxDB ?

C’est cohérent avec un souci de données en base. Avant le recalcul, ça fonctionne, au moment du recalcul tu intègres les données pourries et ça plante

Toute les cartes, tu as cité les principales. Et pareil si c’est un souci de données, peut importe la carte, ça sera pareil

Mouais… Le missile tactique pour se débarrasser d’une mouche, c’est un peu l’idée là, non ?

Je m’en sors vraiment pas avec ce souci mais ta remarque me parrais être une bonne piste :slight_smile:

Comment pourrai-je avancer avec ça ? il y a peut-être une commande que je pourrai exécuter dans SQLite web pour « réparer la base » ?

Ce qui me perturbe c’est que la carte history-graph ne pose pas de problème d’un jour à l’autre. La Apexchart, mini-graph etc utilisent les mêmes données j’imagine.

Tu as raison, je ne vais pas contourner en utilisant Grafana…

Est-ce que ça serait une idée de lancer une Action de repack (reconditionner) ? ça fait un nettoyage et une recompilation c’est ça ?

LA base corrompue, ça bloque quasi tout tant que ce n’est pas corrigé. Donc même faire un nettoyage ça n’aidera pas.
Refait un démarrage, regarde la log en détail (tout pas juste le résumé minimal) et cherche ce genre de message

[homeassistant.components.recorder.util] The system could not validate that the sqlite3 database at //config/home-assistant_v2.db was shutdown cleanly

J’ai bien fait ça mais je n’ai vu aucune erreur SQL dans les journaux (Paramètres → Système → Journaux)

Je vois juste à chaque seconde ceci mais ça ne sont pas des erreurs je pense.

2024-12-15 19:19:11.673 DEBUG (Recorder) [homeassistant.components.recorder.pool.RecorderPool] Connection <sqlite3.Connection object at 0x7f9d1bf010> being returned to pool
2024-12-15 19:19:11.673 DEBUG (Recorder) [homeassistant.components.recorder.pool.RecorderPool] Connection <sqlite3.Connection object at 0x7f9d1bf010> rollback-on-return
2024-12-15 19:19:12.896 DEBUG (Recorder) [homeassistant.components.recorder.pool.RecorderPool] Connection <sqlite3.Connection object at 0x7f9d1bf010> checked out from pool
2024-12-15 19:19:16.664 DEBUG (Recorder) [homeassistant.components.recorder.pool.RecorderPool] Connection <sqlite3.Connection object at 0x7f9d1bf010> being returned to pool
2024-12-15 19:19:16.664 DEBUG (Recorder) [homeassistant.components.recorder.pool.RecorderPool] Connection <sqlite3.Connection object at 0x7f9d1bf010> rollback-on-return
2024-12-15 19:19:16.808 DEBUG (Recorder) [homeassistant.components.recorder.pool.RecorderPool] Connection <sqlite3.Connection object at 0x7f9d1bf010> checked out from pool

Avec le recorder en mode debug, tu es certain que c’est pas noyé dans la masse ?

Alors non, j’ai même fait une recherche avec le mot SQL et rien trouvé. J’ai supprimé le debug du recorder et toujours rien, aucune erreur.

Partage un fichier de log complet après un redémarrage pour chercher d’autres pistes

Voilà celui du core après un reboot https://fromsmash.com/CPmK3jkaw.-dt en extérieur vu que je peux pas attacher autre chose que des images

Le debug est toujours là

2024-12-15 20:03:02.320 DEBUG (Recorder) [homeassistant.components.recorder.util] The last run ended at: 2024-12-15 19:02:28.777122+00:00 (now: 2024-12-15 19:03:02.319994+00:00)
2024-12-15 20:03:02.320 DEBUG (Recorder) [homeassistant.components.recorder.util] The system was restarted cleanly and passed the basic sanity check
2024-12-15 20:03:02.325 DEBUG (Recorder) [homeassistant.components.recorder.pool.RecorderPool] Created new connection <sqlite3.Connection object at 0x7f73f572e0>
2024-12-15 20:03:02.332 DEBUG (Recorder) [homeassistant.components.recorder.pool.RecorderPool] Connection <sqlite3.Connection object at 0x7f73f572e0> checked out from pool

Plusieurs échéances arrivent l’année prochaine

2024-12-15 20:03:41.464 WARNING (MainThread) [homeassistant.helpers.frame] Detected code that calls async_forward_entry_setups for integration thermal_comfort with title: Comfort intérieur and entry_id: c16ac283033e874eb75f5b8d2b166348, during setup without awaiting async_forward_entry_setups, which can cause the setup lock to be released before the setup is done. This will stop working in Home Assistant 2025.1, please report this issue
2024-12-15 20:03:55.824 WARNING (MainThread) [homeassistant.helpers.frame] Detected code that calls async_forward_entry_setup for integration ytube_music_player with title: YouTube Player and entry_id: 01J5K89VAPDC82W6GPDVS13FAM, during setup without awaiting async_forward_entry_setup, which can cause the setup lock to be released before the setup is done. This will stop working in Home Assistant 2025.1, please report this issue
2024-12-15 20:04:01.814 WARNING (MainThread) [homeassistant.helpers.frame] Detected code that calls async_forward_entry_setup for integration nuki_ng with title: SerrureNuki and entry_id: 3d6c34918a1a4bd3871b6313c2b74c57, during setup without awaiting async_forward_entry_setup, which can cause the setup lock to be released before the setup is done. This will stop working in Home Assistant 2025.1, please report this issue

Des erreurs sur xiaomi

2024-12-15 20:04:07.812 ERROR (MainThread) [homeassistant.components.sensor] Platform xiaomi_miot does not generate unique IDs. ID xiaomi_miot-mihome-message-1780819993 is already used by sensor.mi_1780819993_message - ignoring sensor.mi_1780819993_message
2024-12-15 20:04:08.334 WARNING (MainThread) [custom_components.xiaomi_miot.sensor] Get xiaomi scene history for 1780819993 983001001261 failed: {'code': 0, 'message': '成功', 'result': {'history': []}}
2024-12-15 20:04:09.588 ERROR (SyncWorker_8) [homeassistant] Error doing job: Task exception was never retrieved (None)
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/google_assistant/report_state.py", line 171, in initial_report
    entity_data = entity.query_serialize()
  File "/usr/src/homeassistant/homeassistant/components/google_assistant/helpers.py", line 698, in query_serialize
    deep_update(attrs, trt.query_attributes())
                       ~~~~~~~~~~~~~~~~~~~~^^
  File "/usr/src/homeassistant/homeassistant/components/google_assistant/trait.py", line 582, in query_attributes
    "value": brightness / 255,
             ~~~~~~~~~~~^~~~~
TypeError: unsupported operand type(s) for /: 'NoneType' and 'int'

Du scraping qui ne fonctionne pas

2024-12-15 20:04:12.605 WARNING (MainThread) [homeassistant.components.sensor] Entity sensor.rendement_jour_scrape (<class 'homeassistant.components.scrape.sensor.ScrapeSensor'>) is using state class 'total_increasing' which is impossible considering device class ('power') it is using; expected None or one of 'measurement'; Please update your configuration if your entity is manually configured, otherwise create a bug report at https://github.com/home-assistant/core/issues?q=is%3Aopen+is%3Aissue+label%3A%22integration%3A+scrape%22
2024-12-15 20:04:12.605 WARNING (MainThread) [homeassistant.components.sensor] Entity sensor.rendement_jour_scrape (<class 'homeassistant.components.scrape.sensor.ScrapeSensor'>) is using native unit of measurement 'kWh' which is not a valid unit for the device class ('power') it is using; expected one of ['kW', 'GW', 'TW', 'W', 'MW']; Please update your configuration if your entity is manually configured, otherwise create a bug report at https://github.com/home-assistant/core/issues?q=is%3Aopen+is%3Aissue+label%3A%22integration%3A+scrape%22
2024-12-15 20:04:12.993 ERROR (MainThread) [homeassistant.components.esphome.entry_data] Error while calling subscription
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/esphome/entry_data.py", line 402, in async_update_state
    subscription()
    ~~~~~~~~~~~~^^
  File "/usr/src/homeassistant/homeassistant/components/esphome/entity.py", line 295, in _on_state_update
    self.async_write_ha_state()
    ~~~~~~~~~~~~~~~~~~~~~~~~~^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1023, in async_write_ha_state
    self._async_write_ha_state()
    ~~~~~~~~~~~~~~~~~~~~~~~~~~^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1148, in _async_write_ha_state
    self.__async_calculate_state()
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1085, in __async_calculate_state
    state = self._stringify_state(available)
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1029, in _stringify_state
    if (state := self.state) is None:
                 ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/text/__init__.py", line 157, in state
    raise ValueError(
    ...<2 lines>...
    )

des templates mal écrit

2024-12-15 20:04:42.341 ERROR (MainThread) [homeassistant.helpers.event] Error while processing template: Template<template=({% set result = namespace(sensors=[]) %}
{% for state in states.sensor | rejectattr('attributes.device_class', 'undefined') | selectattr('attributes.device_class', '==', 'timestamp') %}
    {% if 'last_seen' in state.entity_id and (states(state.entity_id) == 'unavailable' or ((as_timestamp(now()) - as_timestamp(states(state.entity_id))) > ((24 | int) * 60 * 60))) %}
        {% set result.sensors = result.sensors + [state.name | regex_replace(find=' last seen', replace='') ~ ' (' ~ relative_time(strptime(states(state.entity_id), '%Y-%m-%dT%H:%M:%S%z', 'unavailable')) ~ ')'] %}
    {% endif %}
{% endfor %}
{{ result.sensors | join(', ') }}) renders=2>
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 2115, in forgiving_as_timestamp
    return dt_util.as_timestamp(value)
           ~~~~~~~~~~~~~~~~~~~~^^^^^^^
  File "/usr/src/homeassistant/homeassistant/util/dt.py", line 153, in as_timestamp
    raise ValueError("not a valid date/time.")
ValueError: not a valid date/time.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 631, in async_render
    render_result = _render_with_context(self.template, compiled, **kwargs)
  File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 2733, in _render_with_context
    return template.render(**kwargs)
           ~~~~~~~~~~~~~~~^^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/jinja2/environment.py", line 1304, in render
    self.environment.handle_exception()
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
  File "/usr/local/lib/python3.13/site-packages/jinja2/environment.py", line 939, in handle_exception
    raise rewrite_traceback_stack(source=source)
  File "<template>", line 3, in top-level template code
  File "/usr/local/lib/python3.13/site-packages/jinja2/sandbox.py", line 394, in call
    return __context.call(__obj, *args, **kwargs)
           ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 2118, in forgiving_as_timestamp
    raise_no_default("as_timestamp", value)
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 1909, in raise_no_default
    raise ValueError(
    ...<2 lines>...
    )
ValueError: Template error: as_timestamp got invalid input 'unknown' when rendering template '{% set result = namespace(sensors=[]) %}
{% for state in states.sensor | rejectattr('attributes.device_class', 'undefined') | selectattr('attributes.device_class', '==', 'timestamp') %}
    {% if 'last_seen' in state.entity_id and (states(state.entity_id) == 'unavailable' or ((as_timestamp(now()) - as_timestamp(states(state.entity_id))) > ((24 | int) * 60 * 60))) %}
        {% set result.sensors = result.sensors + [state.name | regex_replace(find=' last seen', replace='') ~ ' (' ~ relative_time(strptime(states(state.entity_id), '%Y-%m-%dT%H:%M:%S%z', 'unavailable')) ~ ')'] %}
    {% endif %}
{% endfor %}
{{ result.sensors | join(', ') }}' but no default was specified

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 748, in async_render_to_info
    render_info._result = self.async_render(  # noqa: SLF001
                          ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
        variables, strict=strict, log_fn=log_fn, **kwargs
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 633, in async_render
    raise TemplateError(err) from err
homeassistant.exceptions.TemplateError: ValueError: Template error: as_timestamp got invalid input 'unknown' when rendering template '{% set result = namespace(sensors=[]) %}
{% for state in states.sensor | rejectattr('attributes.device_class', 'undefined') | selectattr('attributes.device_class', '==', 'timestamp') %}
    {% if 'last_seen' in state.entity_id and (states(state.entity_id) == 'unavailable' or ((as_timestamp(now()) - as_timestamp(states(state.entity_id))) > ((24 | int) * 60 * 60))) %}
        {% set result.sensors = result.sensors + [state.name | regex_replace(find=' last seen', replace='') ~ ' (' ~ relative_time(strptime(states(state.entity_id), '%Y-%m-%dT%H:%M:%S%z', 'unavailable')) ~ ')'] %}
    {% endif %}
{% endfor %}
{{ result.sensors | join(', ') }}' but no default was specified
2024-12-15 20:04:42.375 ERROR (MainThread) [homeassistant.components.template.template_entity] TemplateError('ValueError: Template error: as_timestamp got invalid input 'unknown' when rendering template '{% set result = namespace(sensors=[]) %}
{% for state in states.sensor | rejectattr('attributes.device_class', 'undefined') | selectattr('attributes.device_class', '==', 'timestamp') %}
    {% if 'last_seen' in state.entity_id and (states(state.entity_id) == 'unavailable' or ((as_timestamp(now()) - as_timestamp(states(state.entity_id))) > ((24 | int) * 60 * 60))) %}
        {% set result.sensors = result.sensors + [state.name | regex_replace(find=' last seen', replace='') ~ ' (' ~ relative_time(strptime(states(state.entity_id), '%Y-%m-%dT%H:%M:%S%z', 'unavailable')) ~ ')'] %}
    {% endif %}
{% endfor %}
{{ result.sensors | join(', ') }}' but no default was specified') while processing template 'Template<template=({% set result = namespace(sensors=[]) %}
{% for state in states.sensor | rejectattr('attributes.device_class', 'undefined') | selectattr('attributes.device_class', '==', 'timestamp') %}
    {% if 'last_seen' in state.entity_id and (states(state.entity_id) == 'unavailable' or ((as_timestamp(now()) - as_timestamp(states(state.entity_id))) > ((24 | int) * 60 * 60))) %}
        {% set result.sensors = result.sensors + [state.name | regex_replace(find=' last seen', replace='') ~ ' (' ~ relative_time(strptime(states(state.entity_id), '%Y-%m-%dT%H:%M:%S%z', 'unavailable')) ~ ')'] %}
    {% endif %}
{% endfor %}
{{ result.sensors | join(', ') }}) renders=4>' for attribute '_attr_native_value' in entity 'sensor.appareil_zigbee_offline'
2024-12-15 20:04:42.399 ERROR (MainThread) [homeassistant.helpers.event] Error while processing template: Template<template=({% set p_debut_machine = states('input_number.puissance_machine_debut')  | round(2) %} {% set p_fin_machine = states('sensor.prise_linge_energy') | round(2) %} {% set p_cycle_machine = p_fin_machine - p_debut_machine %} {{ (p_cycle_machine) | round(2) }} kWh) renders=2>
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 1928, in forgiving_round
    value = round(float(value), precision)
                  ~~~~~^^^^^^^
ValueError: could not convert string to float: 'unknown'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 631, in async_render
    render_result = _render_with_context(self.template, compiled, **kwargs)
  File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 2733, in _render_with_context
    return template.render(**kwargs)
           ~~~~~~~~~~~~~~~^^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/jinja2/environment.py", line 1304, in render
    self.environment.handle_exception()
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
  File "/usr/local/lib/python3.13/site-packages/jinja2/environment.py", line 939, in handle_exception
    raise rewrite_traceback_stack(source=source)
  File "<template>", line 1, in top-level template code
  File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 1933, in forgiving_round
    raise_no_default("round", value)
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 1909, in raise_no_default
    raise ValueError(
    ...<2 lines>...
    )
ValueError: Template error: round got invalid input 'unknown' when rendering template '{% set p_debut_machine = states('input_number.puissance_machine_debut')  | round(2) %} {% set p_fin_machine = states('sensor.prise_linge_energy') | round(2) %} {% set p_cycle_machine = p_fin_machine - p_debut_machine %} {{ (p_cycle_machine) | round(2) }} kWh' but no default was specified

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 748, in async_render_to_info
    render_info._result = self.async_render(  # noqa: SLF001
                          ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
        variables, strict=strict, log_fn=log_fn, **kwargs
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 633, in async_render
    raise TemplateError(err) from err
homeassistant.exceptions.TemplateError: ValueError: Template error: round got invalid input 'unknown' when rendering template '{% set p_debut_machine = states('input_number.puissance_machine_debut')  | round(2) %} {% set p_fin_machine = states('sensor.prise_linge_energy') | round(2) %} {% set p_cycle_machine = p_fin_machine - p_debut_machine %} {{ (p_cycle_machine) | round(2) }} kWh' but no default was specified
2024-12-15 20:04:42.407 ERROR (MainThread) [homeassistant.components.template.template_entity] TemplateError('ValueError: Template error: round got invalid input 'unknown' when rendering template '{% set p_debut_machine = states('input_number.puissance_machine_debut')  | round(2) %} {% set p_fin_machine = states('sensor.prise_linge_energy') | round(2) %} {% set p_cycle_machine = p_fin_machine - p_debut_machine %} {{ (p_cycle_machine) | round(2) }} kWh' but no default was specified') while processing template 'Template<template=({% set p_debut_machine = states('input_number.puissance_machine_debut')  | round(2) %} {% set p_fin_machine = states('sensor.prise_linge_energy') | round(2) %} {% set p_cycle_machine = p_fin_machine - p_debut_machine %} {{ (p_cycle_machine) | round(2) }} kWh) renders=4>' for attribute '_attr_native_value' in entity 'sensor.p_machine_a_laver'

Des anomalies et ça ressemble aux courbes de ton premier message : pas d’info => pas d’affichage

2024-12-15 20:04:47.321 WARNING (MainThread) [custom_components.versatile_thermostat.thermostat_climate] VersatileThermostat-Thermostat bureau - don't send regulated temperature cause VTherm target_temp (None) is None. This should be a temporary warning message.
2024-12-15 20:04:54.654 WARNING (MainThread) [custom_components.versatile_thermostat.thermostat_climate] VersatileThermostat-Thermostat chambre 2 - don't send regulated temperature cause VTherm target_temp (None) is None. This should be a temporary warning message.
2024-12-15 20:04:55.412 WARNING (MainThread) [custom_components.versatile_thermostat.thermostat_climate] VersatileThermostat-Thermostat salle à manger - don't send regulated temperature cause VTherm target_temp (None) is None. This should be a temporary warning message.

Encore des templates pourris (l’erreur est là depuis 2ans au moins)

2024-12-15 20:04:57.884 WARNING (MainThread) [homeassistant.components.template.trigger] Error initializing 'template' trigger for 'Download faible': ValueError: Template error: float got invalid input 'unknown' when rendering template '{{ states('sensor.speedtest_download')|float < 100 }}' but no default was specified
2024-12-15 20:04:57.886 ERROR (MainThread) [homeassistant.helpers.event] Error while processing template: Template<template=({{ states('sensor.speedtest_download')|float < 100 }}) renders=3>

Pour la suite j’abandonne, le debug du recorder c’est un enfer

Il y a du boulot en tout cas !!

1 « J'aime »

Merci pour ton retour,

Qu’est-ce qui concrètement pourrait empêcher l’affichage des courbes dans tout ce que tu m’as indiqué.

Il y a beaucoup de warning mais c’est pas bloquant ou si ? Il y a 2 ou 3 semaines, ces erreurs étaient déjà là et les graph s’affichaient.

J’ai enlevé le debug dans la config et reboot ensuite. Il existe ailleurs ?

#logger:
#  default: warning
#  logs:
#    custom_components.apexcharts_card: debug # Pour ApexCharts
#    custom_components.mini_graph_card: debug # Pour mini-graph-card
#    homeassistant.components.recorder: debug # Pour l'enregistreur de données

EDIT j’ai trouvé, je dois laisser les 2 lignes du début. Correct ?

logger:
default: warning