Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Les capteurs restent à 'inconnu' #28

Closed
Parlendir opened this issue Dec 2, 2022 · 13 comments
Closed

Les capteurs restent à 'inconnu' #28

Parlendir opened this issue Dec 2, 2022 · 13 comments

Comments

@Parlendir
Copy link

Version installée : 0.4.0

Statut rte :

  • compte créé
  • abonnement à l'api ecowatt réalisé
  • abonnement web/ serveur et de type mobile testés

Statut home assistant

  • ha sous docker, version 2022.11.5
  • installation de hacs : ok
  • toutes les autres integrations sont fonctionnelles

Méthode de reproduction

  • Le dépôt à été ajouté à hacs
  • L'intégration ecowatt à été rajoutée
  • Lors de sa configuration, je copie-colle l'uuid id_client et l'uuid id_secret fourni dans l'écran de gestion de l'abonnement à l'api ecowatt
  • création d'un capteur supplémentaire pour les prévisions à j+3
  • creation d'un capteur supplémentaire pour les prévisions à j+2
  • tous les capteurs créés ont le statut 'inconnu'

Cette absence de statut est survenue dès la première installation de l'intégration, les statuts ne sont donc jamais remontés.

Aucune erreur a priori dans les logs HA, pas de domaine bloqué par le serveur dns.

@Derekcde
Copy link

Derekcde commented Dec 2, 2022

Salut,

Même problème ici

@kamaradclimber
Copy link
Owner

Le type de credentials attendu est bien "web / serveur".

Plusieurs questions:

  • est-ce que le problème se reproduit après un redémarrage de HA?
  • si le niveau de logging est augmenté, y a-t-il des infos interessantes?
  • est-ce que le comportement est différent dans le scenario suivant:
    ** Installation de l'intégration
    ** Rédemarrage de HA
    ** configuration de l'intégration
    ** (éventuellement redémarrage de HA)

Pour configurer le niveau de logging:

logger:
  default: info
  logs:
    custom_components.rte_ecowatt: debug

Pour le moment, je n'arrive pas à reproduire dans un environement de test (ni sur mon instance).

@gingerm0nkey
Copy link

Bonjour,

J'ai installé le module aujourd'hui et j'ai le même souci. Les entités restent à l'état "Unknown". Le mode debug n'affiche pas de logs supplémentaire. Un redémarrage de HA ne change rien, même après configuration de l'intégration.

HA 2022.11.5 avec Docker
RTE_ECOWATT 0.4.0
Application en mode WEB/SERVER

@gingerm0nkey
Copy link

gingerm0nkey commented Dec 2, 2022

Un reload de l'intégration a permis d'afficher les logs suivants:

J'ai remplacé l'ID par ***

2022-12-02 13:14:30.331 INFO (MainThread) [custom_components.rte_ecowatt.sensor] Called async setup entry
2022-12-02 13:14:30.331 INFO (MainThread) [custom_components.rte_ecowatt] Creating an ecowatt sensor, named Ecowatt level today
2022-12-02 13:14:30.331 INFO (MainThread) [custom_components.rte_ecowatt] Creating an ecowatt sensor, named Ecowatt level now
2022-12-02 13:14:30.331 INFO (MainThread) [custom_components.rte_ecowatt] Creating ecowatt sensor for next downgraded period
2022-12-02 13:14:30.331 INFO (MainThread) [custom_components.rte_ecowatt] Creating an ecowatt sensor, named Ecowatt level tomorrow and 0 hours
2022-12-02 13:14:30.332 INFO (MainThread) [custom_components.rte_ecowatt] Creating an ecowatt sensor, named Ecowatt level in 3 days
2022-12-02 13:14:30.332 DEBUG (MainThread) [custom_components.rte_ecowatt.sensor] Wait for all sensors to have been restored
2022-12-02 13:14:30.335 DEBUG (MainThread) [custom_components.rte_ecowatt] starting to restore sensor from previous data
2022-12-02 13:14:30.335 DEBUG (MainThread) [custom_components.rte_ecowatt] restored state: {'entity_id': 'sensor.ecowatt_level_today', 'state': 'unknown', 'attributes': {'friendly_name': 'Ecowatt level today'}, 'last_changed': '2022-12-02T12:01:50.011958+00:00', 'last_updated': '2022-12-02T12:01:50.011958+00:00', 'context': {'id': '***', 'parent_id': None, 'user_id': None}}
2022-12-02 13:14:30.335 DEBUG (MainThread) [custom_components.rte_ecowatt] starting to restore sensor from previous data
2022-12-02 13:14:30.336 DEBUG (MainThread) [custom_components.rte_ecowatt] restored state: {'entity_id': 'sensor.ecowatt_level_now', 'state': 'unknown', 'attributes': {'friendly_name': 'Ecowatt level now'}, 'last_changed': '2022-12-02T12:01:50.012201+00:00', 'last_updated': '2022-12-02T12:01:50.012201+00:00', 'context': {'id': '***', 'parent_id': None, 'user_id': None}}
2022-12-02 13:14:30.336 DEBUG (MainThread) [custom_components.rte_ecowatt] starting to restore sensor from previous data
2022-12-02 13:14:30.336 DEBUG (MainThread) [custom_components.rte_ecowatt] restored state: {'entity_id': 'sensor.next_downgraded_period', 'state': 'unknown', 'attributes': {'device_class': 'timestamp', 'friendly_name': 'Next downgraded period'}, 'last_changed': '2022-12-02T12:01:50.012412+00:00', 'last_updated': '2022-12-02T12:01:50.012412+00:00', 'context': {'id': '***', 'parent_id': None, 'user_id': None}}
2022-12-02 13:14:30.337 DEBUG (MainThread) [custom_components.rte_ecowatt] starting to restore sensor from previous data
2022-12-02 13:14:30.337 DEBUG (MainThread) [custom_components.rte_ecowatt] restored state: {'entity_id': 'sensor.ecowatt_level_tomorrow_and_0_hours', 'state': 'unknown', 'attributes': {'friendly_name': 'Ecowatt level tomorrow and 0 hours'}, 'last_changed': '2022-12-02T12:01:50.012579+00:00', 'last_updated': '2022-12-02T12:01:50.012579+00:00', 'context': {'id': '***', 'parent_id': None, 'user_id': None}}
2022-12-02 13:14:30.338 DEBUG (MainThread) [custom_components.rte_ecowatt] starting to restore sensor from previous data
2022-12-02 13:14:30.338 DEBUG (MainThread) [custom_components.rte_ecowatt] restored state: {'entity_id': 'sensor.ecowatt_level_in_3_days', 'state': 'unknown', 'attributes': {'friendly_name': 'Ecowatt level in 3 days'}, 'last_changed': '2022-12-02T12:01:50.012741+00:00', 'last_updated': '2022-12-02T12:01:50.012741+00:00', 'context': {'id': '***', 'parent_id': None, 'user_id': None}}
2022-12-02 13:14:30.533 DEBUG (MainThread) [custom_components.rte_ecowatt.sensor] All sensors have been restored properly
2022-12-02 13:14:30.533 INFO (MainThread) [custom_components.rte_ecowatt.sensor] All sensors have already a known state, we'll wait next refresh to avoid hitting API limit after a restart
2022-12-02 13:14:30.533 INFO (MainThread) [custom_components.rte_ecowatt.sensor] We finished the setup of ecowatt *entity*

Si cela peut aider

@kamaradclimber
Copy link
Owner

Ok merci.

16 minutes après le démarrage, on devrait voir dans les logs:

2022-12-02 12:30:39.000 DEBUG (MainThread) [custom_components.rte_ecowatt] Calling update method, 5 listeners subscribed
2022-12-02 12:30:39.000 DEBUG (MainThread) [custom_components.rte_ecowatt] Starting collecting data
2022-12-02 12:30:39.082 DEBUG (MainThread) [custom_components.rte_ecowatt] Fetched a token for RTE API
2022-12-02 12:30:39.165 INFO (MainThread) [custom_components.rte_ecowatt] data received, status code: 200

suivi d'un gros bloc json. Puis:

2022-12-02 12:30:39.165 INFO (MainThread) [custom_components.rte_ecowatt] Fetching ecowatt api data recovered
2022-12-02 12:30:39.165 DEBUG (MainThread) [custom_components.rte_ecowatt] Finished fetching ecowatt api data in 0.165 seconds (success: True)

@gingerm0nkey
Copy link

Ok

Je viens de supprimer l'intégration puis:

  • Redémarrage de HA
  • Ajout à nouveau de l'intégration
  • Saisi client_id et secret_id
  • Configuration de deux capteurs

Et voici le log dans HA en mode debug:

2022-12-02 13:36:45.019 DEBUG (MainThread) [custom_components.rte_ecowatt.config_flow] User input is {'api_client_id': '***', 'api_client_secret': '***'}
2022-12-02 13:36:45.019 DEBUG (MainThread) [custom_components.rte_ecowatt.config_flow] Testing connectivity to RTE api
2022-12-02 13:36:45.351 DEBUG (MainThread) [custom_components.rte_ecowatt] Fetched a token for RTE API
2022-12-02 13:36:45.352 ERROR (MainThread) [homeassistant] Error doing job: Unclosed client session
2022-12-02 13:36:45.360 ERROR (MainThread) [homeassistant] Error doing job: Unclosed connector
2022-12-02 13:36:45.364 DEBUG (MainThread) [custom_components.rte_ecowatt.config_flow] Connectivity to RTE api validated
2022-12-02 13:36:55.164 INFO (MainThread) [custom_components.rte_ecowatt.config_flow] Configuration from user is finished, input is {'api_client_id': '***', 'api_client_secret': '***', 'sensors': [{'unit': 'hours', 'shift': 24}, {'unit': 'days', 'shift': 3}]}
2022-12-02 13:36:55.166 INFO (MainThread) [homeassistant.setup] Setting up rte_ecowatt
2022-12-02 13:36:55.167 INFO (MainThread) [homeassistant.setup] Setup of domain rte_ecowatt took 0.0 seconds
2022-12-02 13:36:55.169 INFO (MainThread) [custom_components.rte_ecowatt] Called async setup entry from __init__.py
2022-12-02 13:36:55.178 INFO (MainThread) [homeassistant.components.sensor] Setting up sensor.rte_ecowatt
2022-12-02 13:36:55.180 INFO (MainThread) [custom_components.rte_ecowatt.sensor] Called async setup entry
2022-12-02 13:36:55.180 INFO (MainThread) [custom_components.rte_ecowatt] Creating an ecowatt sensor, named Ecowatt level today
2022-12-02 13:36:55.180 INFO (MainThread) [custom_components.rte_ecowatt] Creating an ecowatt sensor, named Ecowatt level now
2022-12-02 13:36:55.180 INFO (MainThread) [custom_components.rte_ecowatt] Creating ecowatt sensor for next downgraded period
2022-12-02 13:36:55.181 INFO (MainThread) [custom_components.rte_ecowatt] Creating an ecowatt sensor, named Ecowatt level tomorrow and 0 hours
2022-12-02 13:36:55.181 INFO (MainThread) [custom_components.rte_ecowatt] Creating an ecowatt sensor, named Ecowatt level in 3 days
2022-12-02 13:36:55.181 DEBUG (MainThread) [custom_components.rte_ecowatt.sensor] Wait for all sensors to have been restored
2022-12-02 13:36:55.190 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new sensor.rte_ecowatt entity: sensor.ecowatt_level_today
2022-12-02 13:36:55.192 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new sensor.rte_ecowatt entity: sensor.ecowatt_level_now
2022-12-02 13:36:55.193 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new sensor.rte_ecowatt entity: sensor.next_downgraded_period
2022-12-02 13:36:55.194 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new sensor.rte_ecowatt entity: sensor.ecowatt_level_tomorrow_and_0_hours
2022-12-02 13:36:55.195 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new sensor.rte_ecowatt entity: sensor.ecowatt_level_in_3_days
2022-12-02 13:36:55.206 DEBUG (MainThread) [custom_components.rte_ecowatt] starting to restore sensor from previous data
2022-12-02 13:36:55.206 DEBUG (MainThread) [custom_components.rte_ecowatt] restored state: {'entity_id': 'sensor.ecowatt_level_today', 'state': 'unknown', 'attributes': {'friendly_name': 'Ecowatt level today'}, 'last_changed': '2022-12-02T12:27:25.905235+00:00', 'last_updated': '2022-12-02T12:27:25.905235+00:00', 'context': {'id': '***', 'parent_id': None, 'user_id': None}}
2022-12-02 13:36:55.206 DEBUG (MainThread) [custom_components.rte_ecowatt] starting to restore sensor from previous data
2022-12-02 13:36:55.207 DEBUG (MainThread) [custom_components.rte_ecowatt] restored state: {'entity_id': 'sensor.ecowatt_level_now', 'state': 'unknown', 'attributes': {'friendly_name': 'Ecowatt level now'}, 'last_changed': '2022-12-02T12:27:25.905980+00:00', 'last_updated': '2022-12-02T12:27:25.905980+00:00', 'context': {'id': '***', 'parent_id': None, 'user_id': None}}
2022-12-02 13:36:55.207 DEBUG (MainThread) [custom_components.rte_ecowatt] starting to restore sensor from previous data
2022-12-02 13:36:55.207 DEBUG (MainThread) [custom_components.rte_ecowatt] restored state: {'entity_id': 'sensor.next_downgraded_period', 'state': 'unknown', 'attributes': {'device_class': 'timestamp', 'friendly_name': 'Next downgraded period'}, 'last_changed': '2022-12-02T12:27:25.906754+00:00', 'last_updated': '2022-12-02T12:27:25.906754+00:00', 'context': {'id': '***', 'parent_id': None, 'user_id': None}}
2022-12-02 13:36:55.208 DEBUG (MainThread) [custom_components.rte_ecowatt] starting to restore sensor from previous data
2022-12-02 13:36:55.208 DEBUG (MainThread) [custom_components.rte_ecowatt] restored state: {'entity_id': 'sensor.ecowatt_level_tomorrow_and_0_hours', 'state': 'unknown', 'attributes': {'friendly_name': 'Ecowatt level tomorrow and 0 hours'}, 'last_changed': '2022-12-02T12:27:25.907407+00:00', 'last_updated': '2022-12-02T12:27:25.907407+00:00', 'context': {'id': '***', 'parent_id': None, 'user_id': None}}
2022-12-02 13:36:55.208 DEBUG (MainThread) [custom_components.rte_ecowatt] starting to restore sensor from previous data
2022-12-02 13:36:55.209 DEBUG (MainThread) [custom_components.rte_ecowatt] restored state: {'entity_id': 'sensor.ecowatt_level_in_3_days', 'state': 'unknown', 'attributes': {'friendly_name': 'Ecowatt level in 3 days'}, 'last_changed': '2022-12-02T12:27:25.908052+00:00', 'last_updated': '2022-12-02T12:27:25.908052+00:00', 'context': {'id': '***', 'parent_id': None, 'user_id': None}}
2022-12-02 13:36:55.382 DEBUG (MainThread) [custom_components.rte_ecowatt.sensor] All sensors have been restored properly
2022-12-02 13:36:55.382 INFO (MainThread) [custom_components.rte_ecowatt.sensor] All sensors have already a known state, we'll wait next refresh to avoid hitting API limit after a restart
2022-12-02 13:36:55.382 INFO (MainThread) [custom_components.rte_ecowatt.sensor] We finished the setup of ecowatt *entity*

J'ai remplacé tout ce qui est ID et secret par des *** mais je voyais bien mon client_id et secret_id dans le log.

@kamaradclimber
Copy link
Owner

On voit que l'intégration restore l'état des sensors quand même. C'est un problème mineur que je peut corriger.
Cependant je serais quand même interessé par les logs à T+16min (donc autour de 13:52:55)

@gingerm0nkey
Copy link

gingerm0nkey commented Dec 2, 2022

Finalement, c'est une fausse alerte de mon côté, je n'ai pas été assez patient avant de faire une recherche sur le fait que l'état était à Unknown dès l'ajout de l'intégration. Après 16 minutes, l'état a bien été récupéré.

2022-12-02 13:54:01.529 INFO (MainThread) [custom_components.rte_ecowatt] updated 'Ecowatt level in 3 days' with level Situation normale
2022-12-02 13:54:01.528 DEBUG (MainThread) [custom_components.rte_ecowatt] Looking for 2022-12-03 13:54:01.528611+01:00
2022-12-02 13:54:01.529 INFO (MainThread) [custom_components.rte_ecowatt] updated 'Ecowatt level tomorrow and 0 hours' with level Situation normale
2022-12-02 13:54:01.528 INFO (MainThread) [custom_components.rte_ecowatt] updated 'Next downgraded period'
2022-12-02 13:54:01.522 INFO (MainThread) [custom_components.rte_ecowatt] updated 'Ecowatt level now' with level Situation normale
2022-12-02 13:54:01.522 DEBUG (MainThread) [custom_components.rte_ecowatt] Looking for 2022-12-02 13:54:01.521960+01:00
2022-12-02 13:54:01.521 INFO (MainThread) [custom_components.rte_ecowatt] updated 'Ecowatt level today' with level Situation normale
2022-12-02 13:54:01.520 DEBUG (MainThread) [custom_components.rte_ecowatt] Finished fetching ecowatt api data in 0.519 seconds (success: True)
2022-12-02 13:54:01.520 DEBUG (MainThread) [custom_components.rte_ecowatt] data parsed: [{'GenerationFichier': '2022-12-01T23:00:00+01:00', 'jour': '2022-12-02T00:00:00+01:00', 'dvalue': 1, 'message': 'Pas d’alerte.', 'values': [{'pas': 0, 'hvalue': 1}, {'pas': 1, 'hvalue': 1}, {'pas': 2, 'hvalue': 1}, {'pas': 3, 'hvalue': 1}, {'pas': 4, 'hvalue': 1}, {'pas': 5, 'hvalue': 1}, {'pas': 6, 'hvalue': 1}, {'pas': 7, 'hvalue': 1}, {'pas': 8, 'hvalue': 1}, {'pas': 9, 'hvalue': 1}, {'pas': 10, 'hvalue': 1}, {'pas': 11, 'hvalue': 1}, {'pas': 12, 'hvalue': 1}, {'pas': 13, 'hvalue': 1}, {'pas': 14, 'hvalue': 1}, {'pas': 15, 'hvalue': 1}, {'pas': 16, 'hvalue': 1}, {'pas': 17, 'hvalue': 1}, {'pas': 18, 'hvalue': 1}, {'pas': 19, 'hvalue': 1}, {'pas': 20, 'hvalue': 1}, {'pas': 21, 'hvalue': 1}, {'pas': 22, 'hvalue': 1}, {'pas': 23, 'hvalue': 1}], 'date': datetime.date(2022, 12, 2)}, {'GenerationFichier': '2022-12-01T23:00:00+01:00', 'jour': '2022-12-03T00:00:00+01:00', 'dvalue': 1, 'message': 'Pas d’alerte.', 'values': [{'pas': 0, 'hvalue': 1}, {'pas': 1, 'hvalue': 1}, {'pas': 2, 'hvalue': 1}, {'pas': 3, 'hvalue': 1}, {'pas': 4, 'hvalue': 1}, {'pas': 5, 'hvalue': 1}, {'pas': 6, 'hvalue': 1}, {'pas': 7, 'hvalue': 1}, {'pas': 8, 'hvalue': 1}, {'pas': 9, 'hvalue': 1}, {'pas': 10, 'hvalue': 1}, {'pas': 11, 'hvalue': 1}, {'pas': 12, 'hvalue': 1}, {'pas': 13, 'hvalue': 1}, {'pas': 14, 'hvalue': 1}, {'pas': 15, 'hvalue': 1}, {'pas': 16, 'hvalue': 1}, {'pas': 17, 'hvalue': 1}, {'pas': 18, 'hvalue': 1}, {'pas': 19, 'hvalue': 1}, {'pas': 20, 'hvalue': 1}, {'pas': 21, 'hvalue': 1}, {'pas': 22, 'hvalue': 1}, {'pas': 23, 'hvalue': 1}], 'date': datetime.date(2022, 12, 3)}, {'GenerationFichier': '2022-12-01T23:00:00+01:00', 'jour': '2022-12-04T00:00:00+01:00', 'dvalue': 1, 'message': 'Pas d’alerte.', 'values': [{'pas': 0, 'hvalue': 1}, {'pas': 1, 'hvalue': 1}, {'pas': 2, 'hvalue': 1}, {'pas': 3, 'hvalue': 1}, {'pas': 4, 'hvalue': 1}, {'pas': 5, 'hvalue': 1}, {'pas': 6, 'hvalue': 1}, {'pas': 7, 'hvalue': 1}, {'pas': 8, 'hvalue': 1}, {'pas': 9, 'hvalue': 1}, {'pas': 10, 'hvalue': 1}, {'pas': 11, 'hvalue': 1}, {'pas': 12, 'hvalue': 1}, {'pas': 13, 'hvalue': 1}, {'pas': 14, 'hvalue': 1}, {'pas': 15, 'hvalue': 1}, {'pas': 16, 'hvalue': 1}, {'pas': 17, 'hvalue': 1}, {'pas': 18, 'hvalue': 1}, {'pas': 19, 'hvalue': 1}, {'pas': 20, 'hvalue': 1}, {'pas': 21, 'hvalue': 1}, {'pas': 22, 'hvalue': 1}, {'pas': 23, 'hvalue': 1}], 'date': datetime.date(2022, 12, 4)}, {'GenerationFichier': '2022-12-01T23:00:00+01:00', 'jour': '2022-12-05T00:00:00+01:00', 'dvalue': 1, 'message': 'Pas d’alerte.', 'values': [{'pas': 0, 'hvalue': 1}, {'pas': 1, 'hvalue': 1}, {'pas': 2, 'hvalue': 1}, {'pas': 3, 'hvalue': 1}, {'pas': 4, 'hvalue': 1}, {'pas': 5, 'hvalue': 1}, {'pas': 6, 'hvalue': 1}, {'pas': 7, 'hvalue': 1}, {'pas': 8, 'hvalue': 1}, {'pas': 9, 'hvalue': 1}, {'pas': 10, 'hvalue': 1}, {'pas': 11, 'hvalue': 1}, {'pas': 12, 'hvalue': 1}, {'pas': 13, 'hvalue': 1}, {'pas': 14, 'hvalue': 1}, {'pas': 15, 'hvalue': 1}, {'pas': 16, 'hvalue': 1}, {'pas': 17, 'hvalue': 1}, {'pas': 18, 'hvalue': 1}, {'pas': 19, 'hvalue': 1}, {'pas': 20, 'hvalue': 1}, {'pas': 21, 'hvalue': 1}, {'pas': 22, 'hvalue': 1}, {'pas': 23, 'hvalue': 1}], 'date': datetime.date(2022, 12, 5)}]
22-12-02 13:54:01.506 DEBUG (MainThread) [custom_components.rte_ecowatt] api response body: {"signals":[{"GenerationFichier":"2022-12-01T23:00:00+01:00","jour":"2022-12-02T00:00:00+01:00","dvalue":1,"message":"Pas d\u2019alerte.","values":[{"pas":0,"hvalue":1},{"pas":1,"hvalue":1},{"pas":2,"hvalue":1},{"pas":3,"hvalue":1},{"pas":4,"hvalue":1},{"pas":5,"hvalue":1},{"pas":6,"hvalue":1},{"pas":7,"hvalue":1},{"pas":8,"hvalue":1},{"pas":9,"hvalue":1},{"pas":10,"hvalue":1},{"pas":11,"hvalue":1},{"pas":12,"hvalue":1},{"pas":13,"hvalue":1},{"pas":14,"hvalue":1},{"pas":15,"hvalue":1},{"pas":16,"hvalue":1},{"pas":17,"hvalue":1},{"pas":18,"hvalue":1},{"pas":19,"hvalue":1},{"pas":20,"hvalue":1},{"pas":21,"hvalue":1},{"pas":22,"hvalue":1},{"pas":23,"hvalue":1}]},{"GenerationFichier":"2022-12-01T23:00:00+01:00","jour":"2022-12-03T00:00:00+01:00","dvalue":1,"message":"Pas d\u2019alerte.","values":[{"pas":0,"hvalue":1},{"pas":1,"hvalue":1},{"pas":2,"hvalue":1},{"pas":3,"hvalue":1},{"pas":4,"hvalue":1},{"pas":5,"hvalue":1},{"pas":6,"hvalue":1},{"pas":7,"hvalue":1},{"pas":8,"hvalue":1},{"pas":9,"hvalue":1},{"pas":10,"hvalue":1},{"pas":11,"hvalue":1},{"pas":12,"hvalue":1},{"pas":13,"hvalue":1},{"pas":14,"hvalue":1},{"pas":15,"hvalue":1},{"pas":16,"hvalue":1},{"pas":17,"hvalue":1},{"pas":18,"hvalue":1},{"pas":19,"hvalue":1},{"pas":20,"hvalue":1},{"pas":21,"hvalue":1},{"pas":22,"hvalue":1},{"pas":23,"hvalue":1}]},{"GenerationFichier":"2022-12-01T23:00:00+01:00","jour":"2022-12-04T00:00:00+01:00","dvalue":1,"message":"Pas d\u2019alerte.","values":[{"pas":0,"hvalue":1},{"pas":1,"hvalue":1},{"pas":2,"hvalue":1},{"pas":3,"hvalue":1},{"pas":4,"hvalue":1},{"pas":5,"hvalue":1},{"pas":6,"hvalue":1},{"pas":7,"hvalue":1},{"pas":8,"hvalue":1},{"pas":9,"hvalue":1},{"pas":10,"hvalue":1},{"pas":11,"hvalue":1},{"pas":12,"hvalue":1},{"pas":13,"hvalue":1},{"pas":14,"hvalue":1},{"pas":15,"hvalue":1},{"pas":16,"hvalue":1},{"pas":17,"hvalue":1},{"pas":18,"hvalue":1},{"pas":19,"hvalue":1},{"pas":20,"hvalue":1},{"pas":21,"hvalue":1},{"pas":22,"hvalue":1},{"pas":23,"hvalue":1}]},{"GenerationFichier":"2022-12-01T23:00:00+01:00","jour":"2022-12-05T00:00:00+01:00","dvalue":1,"message":"Pas d\u2019alerte.","values":[{"pas":0,"hvalue":1},{"pas":1,"hvalue":1},{"pas":2,"hvalue":1},{"pas":3,"hvalue":1},{"pas":4,"hvalue":1},{"pas":5,"hvalue":1},{"pas":6,"hvalue":1},{"pas":7,"hvalue":1},{"pas":8,"hvalue":1},{"pas":9,"hvalue":1},{"pas":10,"hvalue":1},{"pas":11,"hvalue":1},{"pas":12,"hvalue":1},{"pas":13,"hvalue":1},{"pas":14,"hvalue":1},{"pas":15,"hvalue":1},{"pas":16,"hvalue":1},{"pas":17,"hvalue":1},{"pas":18,"hvalue":1},{"pas":19,"hvalue":1},{"pas":20,"hvalue":1},{"pas":21,"hvalue":1},{"pas":22,"hvalue":1},{"pas":23,"hvalue":1}]}]}
2022-12-02 13:54:01.504 INFO (MainThread) [custom_components.rte_ecowatt] data received, status code: 200
2022-12-02 13:54:01.003 DEBUG (MainThread) [custom_components.rte_ecowatt] Starting collecting data
2022-12-02 13:54:01.345 DEBUG (MainThread) [custom_components.rte_ecowatt] Fetched a token for RTE API
2022-12-02 13:54:01.002 DEBUG (MainThread) [custom_components.rte_ecowatt] Calling update method, 5 listeners subscribed

Désolé pour le dérangement !

kamaradclimber added a commit that referenced this issue Dec 2, 2022
This prevents to fetch data from the API as soon as possible.
The downside of this is that it will generate exceptions when restarting
HA because we might hit RTE API request limit. Especially for the "next
downgraded period" sensor.

This is related to #28

Change-Id: Ia616b17c1ecc292a63468e7b5f8277a68e87ae90
@kamaradclimber
Copy link
Owner

La version 0.4.2 devrait aider dans le cas où les capteurs sont à "unknown" juste avant le redémarrage (et donc corrigé au refresh suivant, 16min après le redémarrage). Il suffit simplement d'accélerer le refresh dans ce cas précis.

Mais je ne suis pas sûr que ca soit le problème remonté par @Parlendir et @Derekcde .

@Parlendir
Copy link
Author

Bonsoir.
Merci pour les retours.
Je confirme que après avoir rechargé l'intégration, la supprimer, la réactiver, je n'ai toujours pas de changement danses 16 minutes qui suivent l'activation.

Cependant, je suis actuellement dans une situation intermédiaire.

J'ai désactivé puis réactivé l'intégration.
en la réactivant, j'ai laissé les entités par défaut, soit 'aujourd'hui' et maintenant.
Et alors, l'intégration a pu récupérer les statuts y afférents : ces deux entités affichent actuellement 'situation normale'.

J'ai alors ajouté 3 entités supplémentaires : demain, j+2 et j+3.

Cest trois entités sont actuellement au statut ' inconnu' plusieurs heures puis tard et les entités 'aujourd'hui' et 'maintenant' sont restées à 'situation normale'.

Donc l'api m'a répondu, mais n'a pas répondu pour les entités supplémentaires.

Je ne sais pas si ces détails peuvent aider.

@kamaradclimber
Copy link
Owner

Merci pour ces infos supplémentaires. Pour le moment je suis toujours coincé sur la reproduction du problème.

Si on rajoute des entités après la configuration initiale, on a bien un état inconnu pendant les x premières minutes (l'intégration tente un refresh auquel l'api répond "429 Too many Requests", au refresh suivant tout rentre dans l'ordre).

Quelqu'un pourrait-il m'envoyer les logs complets de son scénario de test?

@luke7101
Copy link

luke7101 commented Dec 3, 2022

En ce qui me concerne je n'avais que now et today qui remontaient, rien d'autre et ça dans les logs

ERROR (MainThread) [homeassistant.components.sensor] Platform rte_ecowatt does not generate unique IDs. ID ecowatt-level-in-1-days already exists - ignoring sensor.ecowatt_level_tomorrow
WARNING (MainThread) [homeassistant.components.sensor] Setup of sensor platform rte_ecowatt is taking over 10 seconds.
ERROR (MainThread) [homeassistant.components.sensor] Setup of platform rte_ecowatt is taking longer than 60 seconds. Startup will proceed without waiting any longer.

Après lecture de ton post

est-ce que le comportement est différent dans le scenario suivant:
** Installation de l'intégration
** Rédemarrage de HA
** configuration de l'intégration
** (éventuellement redémarrage de HA)

j'ai :

  • supprimé l'intégration de HA
  • désinstallé l'intégration v4.0.2 de HACS
  • redémarré
  • reinstallé l'intégration sur HACS
  • redémarré
  • rajouté l'intégration dans HA avec ses capteurs par défaut (RAS dans les logs)
  • enfin rajouté un sensor J+1

et là ça a fonctionné !

Je vais essayer d'ajouter d'autres sensors pour voir

Repository owner deleted a comment from michelsup Dec 5, 2022
kamaradclimber added a commit that referenced this issue Dec 13, 2022
When disabling entities, restoration will not happen (because entities
are not *added* to home assistant anymore).
This patch will simply ignore those entities (even though they are still
defined)

This may have an impact for #28 (not sure since I can't reproduce any other conditions so far)

Change-Id: I51f8fba454d83920d370abb09272e63ae387e9e1
@Parlendir
Copy link
Author

Hello.
Since upgrade to v. 0.6.6, the issue is solved.
Thanks for the hard work!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants