scaarup / aula

Fetches information from Aula about your children
GNU General Public License v3.0
57 stars 15 forks source link

Error adding entities for domain sensor with platform aula #43

Closed jydemagt closed 1 year ago

jydemagt commented 1 year ago

Under opstart kommer nedenstående fejl:

Jeg bruger branch "missing-entities" Jeg har 2 børn, en i børnehave og en i skole, (Kommet/Til stede i børnehave, Tabulex & Meebook i skole)

Jeg har fravælgt både ugeplaner og skoleskemaer. Jeg får samme fejl om de valgt/fra valgt

Den opretter en entitet for Sabrina S. som går i Børnehave

-------------------------FEJL--------------------- Logger: homeassistant.components.sensor Source: custom_components/aula/sensor.py:163 Integration: Sensor (documentation, issues) First occurred: 12.58.08 (2 occurrences) Last logged: 12.58.08

Error adding entities for domain sensor with platform aula Error while setting up aula platform for sensor Traceback (most recent call last): File "/config/custom_components/aula/sensor.py", line 161, in unique_id _LOGGER.debug("Unique ID for "+name+": "+"aula"+str(uid)) UnboundLocalError: local variable 'name' referenced before assignment

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 428, in async_add_entities await asyncio.gather(*tasks) File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 503, in _async_add_entity if entity.unique_id is not None: File "/config/custom_components/aula/sensor.py", line 163, in unique_id _LOGGER.debug("Unique ID for child with id "+str(self._child["id"])+": "+"aula"+str(uid)) UnboundLocalError: local variable 'uid' referenced before assignment

-------------------------HELE AULA LOG---------------------------------------------------------------------------------- 2022-11-30 12:58:04.139 INFO (MainThread) [homeassistant.setup] Setting up aula 2022-11-30 12:58:04.140 INFO (MainThread) [homeassistant.setup] Setup of domain aula took 0.0 seconds 2022-11-30 12:58:04.149 INFO (MainThread) [custom_components.aula] Aula integration, version: 0.1.21 https://github.com/scaarup/aula/issues 2022-11-30 12:58:04.155 INFO (MainThread) [homeassistant.components.sensor] Setting up sensor.aula 2022-11-30 12:58:04.332 DEBUG (SyncWorker_6) [custom_components.aula.client] self._schoolschedule False 2022-11-30 12:58:04.332 DEBUG (SyncWorker_6) [custom_components.aula.client] self._ugeplan False 2022-11-30 12:58:04.332 DEBUG (SyncWorker_6) [custom_components.aula.client] is_logged_in? False 2022-11-30 12:58:04.332 DEBUG (SyncWorker_6) [custom_components.aula.client] Logging in 2022-11-30 12:58:05.920 INFO (MainThread) [homeassistant.components.calendar] Setting up calendar.aula 2022-11-30 12:58:07.502 DEBUG (SyncWorker_6) [custom_components.aula.client] LOGIN: True 2022-11-30 12:58:07.829 WARNING (SyncWorker_6) [custom_components.aula.client] Unable to retrieve presence data from Aula from child with id 3318xxx Some data will be missing from sensor entities. 2022-11-30 12:58:07.832 DEBUG (MainThread) [custom_components.aula.sensor] Finished fetching sensor data in 3.501 seconds (success: True) 2022-11-30 12:58:07.832 DEBUG (SyncWorker_7) [custom_components.aula.client] self._schoolschedule False 2022-11-30 12:58:07.832 DEBUG (SyncWorker_7) [custom_components.aula.client] self._ugeplan False 2022-11-30 12:58:07.936 DEBUG (SyncWorker_7) [custom_components.aula.client] is_logged_in? True 2022-11-30 12:58:08.201 WARNING (SyncWorker_7) [custom_components.aula.client] Unable to retrieve presence data from Aula from child with id 3318xxx Some data will be missing from sensor entities. 2022-11-30 12:58:08.203 DEBUG (MainThread) [custom_components.aula.sensor] Presence data for child 2663xxx : 1 2022-11-30 12:58:08.203 DEBUG (MainThread) [custom_components.aula.sensor] Found presence data for childid 2663xxx adding sensor entity. 2022-11-30 12:58:08.203 DEBUG (MainThread) [custom_components.aula.sensor] Presence data for child 3318936 : 0 2022-11-30 12:58:08.203 DEBUG (MainThread) [custom_components.aula.sensor] Unique ID for Sabrina S.: aula2663xxx 2022-11-30 12:58:08.203 DEBUG (MainThread) [custom_components.aula.sensor] Unique ID for Sabrina S.: aula2663xxx 2022-11-30 12:58:08.203 DEBUG (MainThread) [custom_components.aula.sensor] 2663xxx institution: Institutionen Skovbørnehuset 2022-11-30 12:58:08.203 DEBUG (MainThread) [custom_components.aula.sensor] Unique ID for Sabrina S.: aula2663xxx 2022-11-30 12:58:08.203 DEBUG (MainThread) [custom_components.aula.sensor] 2663xxx institution: Institutionen Skovbørnehuset 2022-11-30 12:58:08.203 DEBUG (MainThread) [custom_components.aula.sensor] Dump of ugep_attr: {} 2022-11-30 12:58:08.203 DEBUG (MainThread) [custom_components.aula.sensor] Dump of ugepnext_attr: {} 2022-11-30 12:58:08.203 DEBUG (MainThread) [custom_components.aula.sensor] Could not get ugeplan for next week for child Sabrina. Perhaps not available yet or you have not enabled ugeplan 2022-11-30 12:58:08.204 DEBUG (MainThread) [custom_components.aula.sensor] 2663xxx institution: Institutionen Skovbørnehuset 2022-11-30 12:58:08.205 ERROR (MainThread) [homeassistant.components.sensor] Error adding entities for domain sensor with platform aula File "/config/custom_components/aula/sensor.py", line 161, in unique_id _LOGGER.debug("Unique ID for "+name+": "+"aula"+str(uid)) File "/config/custom_components/aula/sensor.py", line 163, in unique_id _LOGGER.debug("Unique ID for child with id "+str(self._child["id"])+": "+"aula"+str(uid)) 2022-11-30 12:58:08.205 ERROR (MainThread) [homeassistant.components.sensor] Error while setting up aula platform for sensor File "/config/custom_components/aula/sensor.py", line 161, in unique_id _LOGGER.debug("Unique ID for "+name+": "+"aula"+str(uid)) File "/config/custom_components/aula/sensor.py", line 163, in unique_id _LOGGER.debug("Unique ID for child with id "+str(self._child["id"])+": "+"aula"+str(uid)) 2022-11-30 12:58:17.833 DEBUG (SyncWorker_5) [custom_components.aula.client] self._schoolschedule False 2022-11-30 12:58:17.833 DEBUG (SyncWorker_5) [custom_components.aula.client] self._ugeplan False 2022-11-30 12:58:17.958 DEBUG (SyncWorker_5) [custom_components.aula.client] is_logged_in? True 2022-11-30 12:58:18.153 WARNING (SyncWorker_5) [custom_components.aula.client] Unable to retrieve presence data from Aula from child with id 3318xxxSome data will be missing from sensor entities. 2022-11-30 12:58:18.155 DEBUG (MainThread) [custom_components.aula.sensor] Finished fetching sensor data in 0.321 seconds (success: True) 2022-11-30 12:58:18.155 DEBUG (MainThread) [custom_components.aula.sensor] Dump of ugep_attr: {} 2022-11-30 12:58:18.155 DEBUG (MainThread) [custom_components.aula.sensor] Dump of ugepnext_attr: {} 2022-11-30 12:58:18.155 DEBUG (MainThread) [custom_components.aula.sensor] Could not get ugeplan for next week for child Sabrina. Perhaps not available yet or you have not enabled ugeplan 2022-11-30 12:58:18.155 DEBUG (MainThread) [custom_components.aula.sensor] 2663xxx institution: Institutionen Skovbørnehuset

scaarup commented 1 year ago

@jydemagt prøv lige at hiv de seneste ændringer ned og paste din log.

jydemagt commented 1 year ago

2022-11-30 13:31:59.806 INFO (MainThread) [homeassistant.setup] Setting up aula 2022-11-30 13:31:59.806 INFO (MainThread) [homeassistant.setup] Setup of domain aula took 0.0 seconds 2022-11-30 13:31:59.821 INFO (MainThread) [custom_components.aula] Aula integration, version: 0.1.21 https://github.com/scaarup/aula/issues 2022-11-30 13:31:59.831 INFO (MainThread) [homeassistant.components.sensor] Setting up sensor.aula 2022-11-30 13:32:00.178 DEBUG (SyncWorker_0) [custom_components.aula.client] self._schoolschedule False 2022-11-30 13:32:00.178 DEBUG (SyncWorker_0) [custom_components.aula.client] self._ugeplan False 2022-11-30 13:32:00.178 DEBUG (SyncWorker_0) [custom_components.aula.client] is_logged_in? False 2022-11-30 13:32:00.178 DEBUG (SyncWorker_0) [custom_components.aula.client] Logging in 2022-11-30 13:32:01.712 INFO (MainThread) [homeassistant.components.calendar] Setting up calendar.aula 2022-11-30 13:32:02.517 DEBUG (SyncWorker_0) [custom_components.aula.client] LOGIN: True 2022-11-30 13:32:02.727 WARNING (SyncWorker_0) [custom_components.aula.client] Unable to retrieve presence data from Aula from child with id 3318xxx. Some data will be missing from sensor entities. 2022-11-30 13:32:02.729 DEBUG (SyncWorker_0) [custom_components.aula.client] self.presence: {'2663xxx': 1, '3318xxx': 0} 2022-11-30 13:32:02.730 DEBUG (MainThread) [custom_components.aula.sensor] Finished fetching sensor data in 2.553 seconds (success: True) 2022-11-30 13:32:02.732 DEBUG (SyncWorker_1) [custom_components.aula.client] self._schoolschedule False 2022-11-30 13:32:02.732 DEBUG (SyncWorker_1) [custom_components.aula.client] self._ugeplan False 2022-11-30 13:32:02.824 DEBUG (SyncWorker_1) [custom_components.aula.client] is_logged_in? True 2022-11-30 13:32:03.100 WARNING (SyncWorker_1) [custom_components.aula.client] Unable to retrieve presence data from Aula from child with id 3318xxx. Some data will be missing from sensor entities. 2022-11-30 13:32:03.101 DEBUG (SyncWorker_1) [custom_components.aula.client] self.presence: {'2663xxx': 1, '3318xxx': 0} 2022-11-30 13:32:03.104 DEBUG (MainThread) [custom_components.aula.sensor] Presence data for child 2663xxx : 1 2022-11-30 13:32:03.104 DEBUG (MainThread) [custom_components.aula.sensor] Found presence data for childid 2663xxx adding sensor entity. 2022-11-30 13:32:03.104 DEBUG (MainThread) [custom_components.aula.sensor] Presence data for child 3318xxx : 0 2022-11-30 13:32:03.106 DEBUG (MainThread) [custom_components.aula.sensor] client._profilecontext [{'id': 2663xxx, 'profileId': 2080800, 'uniPersonId': 2691000, 'firstName': 'Sabrina', 'lastName': 'S', 'fullName': 'Sabrina S', 'shortName': 'SS', 'role': 'child', 'mailBoxId': 4169339, 'institution': {'institutionCode': 'G18643', 'institutionName': 'Institutionen Skovbørnehuset', 'municipalityCode': '330', 'municipalityName': 'Slagelse', 'type': 'Daycare', 'administrativeAuthority': {'id': 3231, 'name': 'Institutionen Skovbørnehuset', 'institutionCodes': []}}, 'gender': 'F', 'profilePicture': {'id': 950682, 'key': '1620656474/513/317f5bde.jpg', 'bucket': 'aula-prod-media', 'isImageScalingPending': False, 'url': 'https://media-prod.aula.dk/1620656474/513/317f5bde_400x400.jpg?response-content-disposition=attachment%3Bfilename%3D%22317f5bde_400x400.jpg%22&Expires=1669813200&Signature=UQRM7FoiW8sTVj7H7kjFNvaGuRvSjCPxodWX7C8rSoIfyFAl6eJY43PKYcXF3XmhZofwy7IIkz02fDE6yM9AK-izxwcEJEvk2qzXyG3KWOHyaOd0pk-1PXRNYHzlPRYBZv4edZaZH~FmQvmRg3-j-7pwIzodA87AXA~maSGwynVR5ATaJikZI1Wjy8D3ms9TJOFRZila-0uRNVcfapdQtPZG9WyTadZrWeToriXL1QCYk8tIB07tj-mOWDFA8Q8VOATr0jss0XdeZGnMk1znxkkEySibiAgFTtqZaItC~VieOXpO-VVfz9kikVc9PJS6q~m48W~BRf6tkOdE93lXnA__&Key-Pair-Id=APKAILBPECUQMHIxxxxx'}, 'mainGroupName': 'Rumpenisserne', 'metadata': 'Rumpenisserne'}] 2022-11-30 13:32:03.106 DEBUG (MainThread) [custom_components.aula.sensor] Got presence data for childid 2663xxx .Trying to set unique id. 2022-11-30 13:32:03.106 DEBUG (MainThread) [custom_components.aula.sensor] client._profilecontext [{'id': 2663xxx, 'profileId': 2080800, 'uniPersonId': 2691000, 'firstName': 'Sabrina', 'lastName': 'S', 'fullName': 'Sabrina S', 'shortName': 'SS', 'role': 'child', 'mailBoxId': 4169339, 'institution': {'institutionCode': 'G18643', 'institutionName': 'Institutionen Skovbørnehuset', 'municipalityCode': '330', 'municipalityName': 'Slagelse', 'type': 'Daycare', 'administrativeAuthority': {'id': 3231, 'name': 'Institutionen Skovbørnehuset', 'institutionCodes': []}}, 'gender': 'F', 'profilePicture': {'id': 950682, 'key': '1620656474/513/317f5bde.jpg', 'bucket': 'aula-prod-media', 'isImageScalingPending': False, 'url': 'https://media-prod.aula.dk/1620656474/513/317f5bde_400x400.jpg?response-content-disposition=attachment%3Bfilename%3D%22317f5bde_400x400.jpg%22&Expires=1669813200&Signature=UQRM7FoiW8sTVj7H7kjFNvaGuRvSjCPxodWX7C8rSoIfyFAl6eJY43PKYcXF3XmhZofwy7IIkz02fDE6yM9AK-izxwcEJEvk2qzXyG3KWOHyaOd0pk-1PXRNYHzlPRYBZv4edZaZH~FmQvmRg3-j-7pwIzodA87AXA~maSGwynVR5ATaJikZI1Wjy8D3ms9TJOFRZila-0uRNVcfapdQtPZG9WyTadZrWeToriXL1QCYk8tIB07tj-mOWDFA8Q8VOATr0jss0XdeZGnMk1znxkkEySibiAgFTtqZaItC~VieOXpO-VVfz9kikVc9PJS6q~m48W~BRf6tkOdE93lXnA__&Key-Pair-Id=APKAILBPECUQMHIxxxxx'}, 'mainGroupName': 'Rumpenisserne', 'metadata': 'Rumpenisserne'}] 2022-11-30 13:32:03.106 DEBUG (MainThread) [custom_components.aula.sensor] Got presence data for childid 2663xxx .Trying to set unique id. 2022-11-30 13:32:03.106 DEBUG (MainThread) [custom_components.aula.sensor] 2663xxx institution: Institutionen Skovbørnehuset 2022-11-30 13:32:03.106 DEBUG (MainThread) [custom_components.aula.sensor] client._profilecontext [{'id': 2663xxx, 'profileId': 2080800, 'uniPersonId': 2691000, 'firstName': 'Sabrina', 'lastName': 'S', 'fullName': 'Sabrina S', 'shortName': 'SS', 'role': 'child', 'mailBoxId': 4169339, 'institution': {'institutionCode': 'G18643', 'institutionName': 'Institutionen Skovbørnehuset', 'municipalityCode': '330', 'municipalityName': 'Slagelse', 'type': 'Daycare', 'administrativeAuthority': {'id': 3231, 'name': 'Institutionen Skovbørnehuset', 'institutionCodes': []}}, 'gender': 'F', 'profilePicture': {'id': 950682, 'key': '1620656474/513/317f5bde.jpg', 'bucket': 'aula-prod-media', 'isImageScalingPending': False, 'url': 'https://media-prod.aula.dk/1620656474/513/317f5bde_400x400.jpg?response-content-disposition=attachment%3Bfilename%3D%22317f5bde_400x400.jpg%22&Expires=1669813200&Signature=UQRM7FoiW8sTVj7H7kjFNvaGuRvSjCPxodWX7C8rSoIfyFAl6eJY43PKYcXF3XmhZofwy7IIkz02fDE6yM9AK-izxwcEJEvk2qzXyG3KWOHyaOd0pk-1PXRNYHzlPRYBZv4edZaZH~FmQvmRg3-j-7pwIzodA87AXA~maSGwynVR5ATaJikZI1Wjy8D3ms9TJOFRZila-0uRNVcfapdQtPZG9WyTadZrWeToriXL1QCYk8tIB07tj-mOWDFA8Q8VOATr0jss0XdeZGnMk1znxkkEySibiAgFTtqZaItC~VieOXpO-VVfz9kikVc9PJS6q~m48W~BRf6tkOdE93lXnA__&Key-Pair-Id=APKAILBPECUQMHIxxxxx'}, 'mainGroupName': 'Rumpenisserne', 'metadata': 'Rumpenisserne'}] 2022-11-30 13:32:03.106 DEBUG (MainThread) [custom_components.aula.sensor] Got presence data for childid 2663xxx .Trying to set unique id. 2022-11-30 13:32:03.106 DEBUG (MainThread) [custom_components.aula.sensor] 2663xxx institution: Institutionen Skovbørnehuset 2022-11-30 13:32:03.106 DEBUG (MainThread) [custom_components.aula.sensor] Dump of ugep_attr: {} 2022-11-30 13:32:03.106 DEBUG (MainThread) [custom_components.aula.sensor] Dump of ugepnext_attr: {} 2022-11-30 13:32:03.106 DEBUG (MainThread) [custom_components.aula.sensor] Could not get ugeplan for next week for child Sabrina. Perhaps not available yet or you have not enabled ugeplan 2022-11-30 13:32:03.107 DEBUG (MainThread) [custom_components.aula.sensor] 2663xxx institution: Institutionen Skovbørnehuset 2022-11-30 13:32:03.107 DEBUG (MainThread) [custom_components.aula.sensor] client._profilecontext [{'id': 2663xxx, 'profileId': 2080800, 'uniPersonId': 2691000, 'firstName': 'Sabrina', 'lastName': 'S', 'fullName': 'Sabrina S', 'shortName': 'SS', 'role': 'child', 'mailBoxId': 4169339, 'institution': {'institutionCode': 'G18643', 'institutionName': 'Institutionen Skovbørnehuset', 'municipalityCode': '330', 'municipalityName': 'Slagelse', 'type': 'Daycare', 'administrativeAuthority': {'id': 3231, 'name': 'Institutionen Skovbørnehuset', 'institutionCodes': []}}, 'gender': 'F', 'profilePicture': {'id': 950682, 'key': '1620656474/513/317f5bde.jpg', 'bucket': 'aula-prod-media', 'isImageScalingPending': False, 'url': 'https://media-prod.aula.dk/1620656474/513/317f5bde_400x400.jpg?response-content-disposition=attachment%3Bfilename%3D%22317f5bde_400x400.jpg%22&Expires=1669813200&Signature=UQRM7FoiW8sTVj7H7kjFNvaGuRvSjCPxodWX7C8rSoIfyFAl6eJY43PKYcXF3XmhZofwy7IIkz02fDE6yM9AK-izxwcEJEvk2qzXyG3KWOHyaOd0pk-1PXRNYHzlPRYBZv4edZaZH~FmQvmRg3-j-7pwIzodA87AXA~maSGwynVR5ATaJikZI1Wjy8D3ms9TJOFRZila-0uRNVcfapdQtPZG9WyTadZrWeToriXL1QCYk8tIB07tj-mOWDFA8Q8VOATr0jss0XdeZGnMk1znxkkEySibiAgFTtqZaItC~VieOXpO-VVfz9kikVc9PJS6q~m48W~BRf6tkOdE93lXnA__&Key-Pair-Id=APKAILBPECUQMHIxxxxx'}, 'mainGroupName': 'Rumpenisserne', 'metadata': 'Rumpenisserne'}] 2022-11-30 13:32:03.107 DEBUG (MainThread) [custom_components.aula.sensor] No presence data for childid 3318xxx .Trying to set unique id. 2022-11-30 13:32:03.111 ERROR (MainThread) [homeassistant.components.sensor] Error adding entities for domain sensor with platform aula File "/config/custom_components/aula/sensor.py", line 167, in unique_id return "aula"+str(uid) 2022-11-30 13:32:03.113 ERROR (MainThread) [homeassistant.components.sensor] Error while setting up aula platform for sensor File "/config/custom_components/aula/sensor.py", line 167, in unique_id return "aula"+str(uid) 2022-11-30 13:32:12.834 DEBUG (SyncWorker_6) [custom_components.aula.client] self._schoolschedule False 2022-11-30 13:32:12.834 DEBUG (SyncWorker_6) [custom_components.aula.client] self._ugeplan False 2022-11-30 13:32:12.953 DEBUG (SyncWorker_6) [custom_components.aula.client] is_logged_in? True 2022-11-30 13:32:13.153 WARNING (SyncWorker_6) [custom_components.aula.client] Unable to retrieve presence data from Aula from child with id 3318xxx. Some data will be missing from sensor entities. 2022-11-30 13:32:13.156 DEBUG (SyncWorker_6) [custom_components.aula.client] self.presence: {'2663xxx': 1, '3318xxx': 0} 2022-11-30 13:32:14.074 DEBUG (MainThread) [custom_components.aula.sensor] Finished fetching sensor data in 1.245 seconds (success: True) 2022-11-30 13:32:14.074 DEBUG (MainThread) [custom_components.aula.sensor] Dump of ugep_attr: {} 2022-11-30 13:32:14.074 DEBUG (MainThread) [custom_components.aula.sensor] Dump of ugepnext_attr: {} 2022-11-30 13:32:14.074 DEBUG (MainThread) [custom_components.aula.sensor] Could not get ugeplan for next week for child Sabrina. Perhaps not available yet or you have not enabled ugeplan 2022-11-30 13:32:14.074 DEBUG (MainThread) [custom_components.aula.sensor] 2663xxx institution: Institutionen Skovbørnehuset

scaarup commented 1 year ago

Tak @jydemagt. Prøv lige at opdatér og test igen.

jydemagt commented 1 year ago

2022-11-30 14:51:30.021 INFO (MainThread) [homeassistant.setup] Setting up aula 2022-11-30 14:51:30.021 INFO (MainThread) [homeassistant.setup] Setup of domain aula took 0.0 seconds 2022-11-30 14:51:30.037 INFO (MainThread) [custom_components.aula] Aula integration, version: 0.1.21 https://github.com/scaarup/aula/issues 2022-11-30 14:51:30.044 INFO (MainThread) [homeassistant.components.sensor] Setting up sensor.aula 2022-11-30 14:51:30.168 DEBUG (SyncWorker_0) [custom_components.aula.client] self._schoolschedule False 2022-11-30 14:51:30.168 DEBUG (SyncWorker_0) [custom_components.aula.client] self._ugeplan False 2022-11-30 14:51:30.168 DEBUG (SyncWorker_0) [custom_components.aula.client] is_logged_in? False 2022-11-30 14:51:30.168 DEBUG (SyncWorker_0) [custom_components.aula.client] Logging in 2022-11-30 14:51:30.254 INFO (MainThread) [homeassistant.components.calendar] Setting up calendar.aula 2022-11-30 14:51:32.335 DEBUG (SyncWorker_0) [custom_components.aula.client] LOGIN: True 2022-11-30 14:51:32.528 WARNING (SyncWorker_0) [custom_components.aula.client] Unable to retrieve presence data from Aula from child with id 3318xxx. Some data will be missing from sensor entities. 2022-11-30 14:51:32.530 DEBUG (SyncWorker_0) [custom_components.aula.client] self.presence: {'2663xxx': 1, '3318xxx': 0} 2022-11-30 14:51:32.531 DEBUG (MainThread) [custom_components.aula.sensor] Finished fetching sensor data in 2.364 seconds (success: True) 2022-11-30 14:51:32.532 DEBUG (SyncWorker_8) [custom_components.aula.client] self._schoolschedule False 2022-11-30 14:51:32.532 DEBUG (SyncWorker_8) [custom_components.aula.client] self._ugeplan False 2022-11-30 14:51:32.614 DEBUG (SyncWorker_8) [custom_components.aula.client] is_logged_in? True 2022-11-30 14:51:32.851 WARNING (SyncWorker_8) [custom_components.aula.client] Unable to retrieve presence data from Aula from child with id 3318xxx. Some data will be missing from sensor entities. 2022-11-30 14:51:32.851 DEBUG (SyncWorker_8) [custom_components.aula.client] self.presence: {'2663xxx': 1, '3318xxx': 0} 2022-11-30 14:51:32.852 DEBUG (MainThread) [custom_components.aula.sensor] Presence data for child 2663xxx : 1 2022-11-30 14:51:32.852 DEBUG (MainThread) [custom_components.aula.sensor] Found presence data for childid 2663xxx adding sensor entity. 2022-11-30 14:51:32.852 DEBUG (MainThread) [custom_components.aula.sensor] Presence data for child 3318xxx : 0 2022-11-30 14:51:32.852 DEBUG (MainThread) [custom_components.aula.sensor] client._profilecontext [{'id': 2663xxx, 'profileId': 2080800, 'uniPersonId': 2691000, 'firstName': 'Sabrina', 'lastName': 'S', 'fullName': 'Sabrina S', 'shortName': 'SS', 'role': 'child', 'mailBoxId': 4169339, 'institution': {'institutionCode': 'G18643', 'institutionName': 'Institutionen Skovbørnehuset', 'municipalityCode': '330', 'municipalityName': 'Slagelse', 'type': 'Daycare', 'administrativeAuthority': {'id': 3231, 'name': 'Institutionen Skovbørnehuset', 'institutionCodes': []}}, 'gender': 'F', 'profilePicture': {'id': 950682, 'key': '1620656474/513/317f5bde.jpg', 'bucket': 'aula-prod-media', 'isImageScalingPending': False, 'url': 'https://media-prod.aula.dk/1620656474/513/317f5bde_400x400.jpg?response-content-disposition=attachment%3Bfilename%3D%22317f5bde_400x400.jpg%22&Expires=1669816800&Signature=OwRvHTccvDjBexAzqJZVnwbYxX682oCUDDhc0gyW9gK4Zf8sot2fVyRmdW59DZnR3J8k4HiCraUOxoaiXulntiN6u6g6N9erB~KeAIT5s-EL4l1gNf4IvdTESZ0SLHN0oGwvtrCCf-6~vyR8wAnHjPdIIGuB9Rtbi6hsQTWR-lBUnCC5OUH0Y-n7SNXGpFyNB1AVvv6YYHyFpXLjxsfysR3XK0WkUgdkEM6GyvaXerNx3awameI5cmA2JfUsia7BB-~Of-Gbw0-~L-T1MjXimLAoeVGAK8ukSsi9Q-hWzi6UB-esXzdWkWPEBVsj2wXCWlnDS0KfeC1VWQQ33OZM2g__&Key-Pair-Id=APKAILBPECUQMHIxxxxx'}, 'mainGroupName': 'Rumpenisserne', 'metadata': 'Rumpenisserne'}] 2022-11-30 14:51:32.852 DEBUG (MainThread) [custom_components.aula.sensor] Got presence data for childid 2663xxx .Trying to set unique id. 2022-11-30 14:51:32.852 DEBUG (MainThread) [custom_components.aula.sensor] client._profilecontext [{'id': 2663xxx, 'profileId': 2080800, 'uniPersonId': 2691000, 'firstName': 'Sabrina', 'lastName': 'S', 'fullName': 'Sabrina S', 'shortName': 'SS', 'role': 'child', 'mailBoxId': 4169339, 'institution': {'institutionCode': 'G18643', 'institutionName': 'Institutionen Skovbørnehuset', 'municipalityCode': '330', 'municipalityName': 'Slagelse', 'type': 'Daycare', 'administrativeAuthority': {'id': 3231, 'name': 'Institutionen Skovbørnehuset', 'institutionCodes': []}}, 'gender': 'F', 'profilePicture': {'id': 950682, 'key': '1620656474/513/317f5bde.jpg', 'bucket': 'aula-prod-media', 'isImageScalingPending': False, 'url': 'https://media-prod.aula.dk/1620656474/513/317f5bde_400x400.jpg?response-content-disposition=attachment%3Bfilename%3D%22317f5bde_400x400.jpg%22&Expires=1669816800&Signature=OwRvHTccvDjBexAzqJZVnwbYxX682oCUDDhc0gyW9gK4Zf8sot2fVyRmdW59DZnR3J8k4HiCraUOxoaiXulntiN6u6g6N9erB~KeAIT5s-EL4l1gNf4IvdTESZ0SLHN0oGwvtrCCf-6~vyR8wAnHjPdIIGuB9Rtbi6hsQTWR-lBUnCC5OUH0Y-n7SNXGpFyNB1AVvv6YYHyFpXLjxsfysR3XK0WkUgdkEM6GyvaXerNx3awameI5cmA2JfUsia7BB-~Of-Gbw0-~L-T1MjXimLAoeVGAK8ukSsi9Q-hWzi6UB-esXzdWkWPEBVsj2wXCWlnDS0KfeC1VWQQ33OZM2g__&Key-Pair-Id=APKAILBPECUQMHIxxxxx'}, 'mainGroupName': 'Rumpenisserne', 'metadata': 'Rumpenisserne'}] 2022-11-30 14:51:32.852 DEBUG (MainThread) [custom_components.aula.sensor] Got presence data for childid 2663xxx .Trying to set unique id. 2022-11-30 14:51:32.852 DEBUG (MainThread) [custom_components.aula.sensor] 2663xxx institution: Institutionen Skovbørnehuset 2022-11-30 14:51:32.852 DEBUG (MainThread) [custom_components.aula.sensor] client._profilecontext [{'id': 2663xxx, 'profileId': 2080800, 'uniPersonId': 2691000, 'firstName': 'Sabrina', 'lastName': 'S', 'fullName': 'Sabrina S', 'shortName': 'SS', 'role': 'child', 'mailBoxId': 4169339, 'institution': {'institutionCode': 'G18643', 'institutionName': 'Institutionen Skovbørnehuset', 'municipalityCode': '330', 'municipalityName': 'Slagelse', 'type': 'Daycare', 'administrativeAuthority': {'id': 3231, 'name': 'Institutionen Skovbørnehuset', 'institutionCodes': []}}, 'gender': 'F', 'profilePicture': {'id': 950682, 'key': '1620656474/513/317f5bde.jpg', 'bucket': 'aula-prod-media', 'isImageScalingPending': False, 'url': 'https://media-prod.aula.dk/1620656474/513/317f5bde_400x400.jpg?response-content-disposition=attachment%3Bfilename%3D%22317f5bde_400x400.jpg%22&Expires=1669816800&Signature=OwRvHTccvDjBexAzqJZVnwbYxX682oCUDDhc0gyW9gK4Zf8sot2fVyRmdW59DZnR3J8k4HiCraUOxoaiXulntiN6u6g6N9erB~KeAIT5s-EL4l1gNf4IvdTESZ0SLHN0oGwvtrCCf-6~vyR8wAnHjPdIIGuB9Rtbi6hsQTWR-lBUnCC5OUH0Y-n7SNXGpFyNB1AVvv6YYHyFpXLjxsfysR3XK0WkUgdkEM6GyvaXerNx3awameI5cmA2JfUsia7BB-~Of-Gbw0-~L-T1MjXimLAoeVGAK8ukSsi9Q-hWzi6UB-esXzdWkWPEBVsj2wXCWlnDS0KfeC1VWQQ33OZM2g__&Key-Pair-Id=APKAILBPECUQMHIxxxxx'}, 'mainGroupName': 'Rumpenisserne', 'metadata': 'Rumpenisserne'}] 2022-11-30 14:51:32.853 DEBUG (MainThread) [custom_components.aula.sensor] Got presence data for childid 2663xxx .Trying to set unique id. 2022-11-30 14:51:32.853 DEBUG (MainThread) [custom_components.aula.sensor] 2663xxx institution: Institutionen Skovbørnehuset 2022-11-30 14:51:32.853 DEBUG (MainThread) [custom_components.aula.sensor] Dump of ugep_attr: {} 2022-11-30 14:51:32.853 DEBUG (MainThread) [custom_components.aula.sensor] Dump of ugepnext_attr: {} 2022-11-30 14:51:32.853 DEBUG (MainThread) [custom_components.aula.sensor] Could not get ugeplan for next week for child Sabrina. Perhaps not available yet or you have not enabled ugeplan 2022-11-30 14:51:32.853 DEBUG (MainThread) [custom_components.aula.sensor] 2663xxx institution: Institutionen Skovbørnehuset 2022-11-30 14:51:32.853 DEBUG (MainThread) [custom_components.aula.sensor] client._profilecontext [{'id': 2663xxx, 'profileId': 2080800, 'uniPersonId': 2691000, 'firstName': 'Sabrina', 'lastName': 'S', 'fullName': 'Sabrina S', 'shortName': 'SS', 'role': 'child', 'mailBoxId': 4169339, 'institution': {'institutionCode': 'G18643', 'institutionName': 'Institutionen Skovbørnehuset', 'municipalityCode': '330', 'municipalityName': 'Slagelse', 'type': 'Daycare', 'administrativeAuthority': {'id': 3231, 'name': 'Institutionen Skovbørnehuset', 'institutionCodes': []}}, 'gender': 'F', 'profilePicture': {'id': 950682, 'key': '1620656474/513/317f5bde.jpg', 'bucket': 'aula-prod-media', 'isImageScalingPending': False, 'url': 'https://media-prod.aula.dk/1620656474/513/317f5bde_400x400.jpg?response-content-disposition=attachment%3Bfilename%3D%22317f5bde_400x400.jpg%22&Expires=1669816800&Signature=OwRvHTccvDjBexAzqJZVnwbYxX682oCUDDhc0gyW9gK4Zf8sot2fVyRmdW59DZnR3J8k4HiCraUOxoaiXulntiN6u6g6N9erB~KeAIT5s-EL4l1gNf4IvdTESZ0SLHN0oGwvtrCCf-6~vyR8wAnHjPdIIGuB9Rtbi6hsQTWR-lBUnCC5OUH0Y-n7SNXGpFyNB1AVvv6YYHyFpXLjxsfysR3XK0WkUgdkEM6GyvaXerNx3awameI5cmA2JfUsia7BB-~Of-Gbw0-~L-T1MjXimLAoeVGAK8ukSsi9Q-hWzi6UB-esXzdWkWPEBVsj2wXCWlnDS0KfeC1VWQQ33OZM2g__&Key-Pair-Id=APKAILBPECUQMHIxxxxx'}, 'mainGroupName': 'Rumpenisserne', 'metadata': 'Rumpenisserne'}] 2022-11-30 14:51:32.853 DEBUG (MainThread) [custom_components.aula.sensor] No presence data for childid 3318xxx .Trying to set unique id. 2022-11-30 14:51:32.853 DEBUG (MainThread) [custom_components.aula.sensor] client._profilecontext [{'id': 2663xxx, 'profileId': 2080800, 'uniPersonId': 2691000, 'firstName': 'Sabrina', 'lastName': 'S', 'fullName': 'Sabrina S', 'shortName': 'SS', 'role': 'child', 'mailBoxId': 4169339, 'institution': {'institutionCode': 'G18643', 'institutionName': 'Institutionen Skovbørnehuset', 'municipalityCode': '330', 'municipalityName': 'Slagelse', 'type': 'Daycare', 'administrativeAuthority': {'id': 3231, 'name': 'Institutionen Skovbørnehuset', 'institutionCodes': []}}, 'gender': 'F', 'profilePicture': {'id': 950682, 'key': '1620656474/513/317f5bde.jpg', 'bucket': 'aula-prod-media', 'isImageScalingPending': False, 'url': 'https://media-prod.aula.dk/1620656474/513/317f5bde_400x400.jpg?response-content-disposition=attachment%3Bfilename%3D%22317f5bde_400x400.jpg%22&Expires=1669816800&Signature=OwRvHTccvDjBexAzqJZVnwbYxX682oCUDDhc0gyW9gK4Zf8sot2fVyRmdW59DZnR3J8k4HiCraUOxoaiXulntiN6u6g6N9erB~KeAIT5s-EL4l1gNf4IvdTESZ0SLHN0oGwvtrCCf-6~vyR8wAnHjPdIIGuB9Rtbi6hsQTWR-lBUnCC5OUH0Y-n7SNXGpFyNB1AVvv6YYHyFpXLjxsfysR3XK0WkUgdkEM6GyvaXerNx3awameI5cmA2JfUsia7BB-~Of-Gbw0-~L-T1MjXimLAoeVGAK8ukSsi9Q-hWzi6UB-esXzdWkWPEBVsj2wXCWlnDS0KfeC1VWQQ33OZM2g__&Key-Pair-Id=APKAILBPECUQMHIxxxxx'}, 'mainGroupName': 'Rumpenisserne', 'metadata': 'Rumpenisserne'}] 2022-11-30 14:51:32.853 DEBUG (MainThread) [custom_components.aula.sensor] No presence data for childid 3318xxx .Trying to set unique id. 2022-11-30 14:51:32.854 ERROR (MainThread) [homeassistant.components.sensor] Error adding entities for domain sensor with platform aula File "/config/custom_components/aula/sensor.py", line 87, in name 2022-11-30 14:51:32.856 ERROR (MainThread) [homeassistant.components.sensor] Error while setting up aula platform for sensor File "/config/custom_components/aula/sensor.py", line 87, in name 2022-11-30 14:51:42.532 DEBUG (SyncWorker_7) [custom_components.aula.client] self._schoolschedule False 2022-11-30 14:51:42.532 DEBUG (SyncWorker_7) [custom_components.aula.client] self._ugeplan False 2022-11-30 14:51:42.636 DEBUG (SyncWorker_7) [custom_components.aula.client] is_logged_in? True 2022-11-30 14:51:42.858 WARNING (SyncWorker_7) [custom_components.aula.client] Unable to retrieve presence data from Aula from child with id 3318xxx. Some data will be missing from sensor entities. 2022-11-30 14:51:42.858 DEBUG (SyncWorker_7) [custom_components.aula.client] self.presence: {'2663xxx': 1, '3318xxx': 0} 2022-11-30 14:51:42.859 DEBUG (MainThread) [custom_components.aula.sensor] Finished fetching sensor data in 0.326 seconds (success: True) 2022-11-30 14:51:42.859 DEBUG (MainThread) [custom_components.aula.sensor] Dump of ugep_attr: {} 2022-11-30 14:51:42.859 DEBUG (MainThread) [custom_components.aula.sensor] Dump of ugepnext_attr: {} 2022-11-30 14:51:42.859 DEBUG (MainThread) [custom_components.aula.sensor] Could not get ugeplan for next week for child Sabrina. Perhaps not available yet or you have not enabled ugeplan 2022-11-30 14:51:42.859 DEBUG (MainThread) [custom_components.aula.sensor] 2663xxx institution: Institutionen Skovbørnehuset

scaarup commented 1 year ago

@jydemagt jeg har prøvet at lave et fix - du må gerne teste.

jydemagt commented 1 year ago

Nu virker det, takker

jydemagt commented 1 year ago

Et forbedringsønske, kunne være at få ugeplanen ud i en entitet pr. dag. Så man eks. kan vise hvad der er på programmet i morgen.

scaarup commented 1 year ago

Det er lidt svært da der åbenbart er mange "udbydere" af ugeplaner. Og sikkert også mange forskellige måder skolerne skriver ugeplaner på. Dvs. formatet er ikke konsistent og vi kan derfor ikke regne med, at dagene er listet op, ej heller i et dato format vi kan regne med osv osv. Men du kan sikkert lave det selv, hvis du er skrap til templating.

jydemagt commented 1 year ago

Helt fint.

Jeg har rodet lidt med det. Jeg har lavet følgende Markdown card, som viser dagens program, hvis klokken er før kl. 12.00 eller morgendagens program hvis klokken efter 12.00. Jeg har ikke taget højde for weekenden.


type: markdown title: null content: |- {% set value = state_attr('sensor.marievangsskolen_victoria', 'ugeplan')%} {% set time = now().hour %} {% set today = now().weekday()+2%} {%- if time >= 12 %} {% set today = now().weekday()+3 %} {%- endif %} {%- for item in value.split('<h3>') %} {%- if loop.index == today %} {% set dag = item.split('</h3>')[0] %} {{ '<h2>'}}{{ dag | title }}{{ '</h2>'}} {%- endif %} {%- endfor %} {%- for item in value.split('</h3>') %} {%- if loop.index == today %} {% set agenda = item.split('<h3>')[0] %} {{ agenda }} {%- endif %} {%- endfor %}