Closed JesperThorup closed 1 year ago
Jeg bliver nødt til at se noget debug log.
Den er vedhæftet.. Kan se den har tilføjet linket bare: https://github.com/scaarup/aula/files/12432242/home-assistant_aula_2023-08-24T18-05-19.130Z.log
Ligger du inde med filen /config/skoleskema.json - og hvad indeholder den evt.?
Prøv at debug det output vi prøver at hente som skoleskema ved at indsætte dette over linje 233 i client.py:
_LOGGER.debug(res)
Genstart og kig i loggen.
@scaarup Indholdet af skoleskema.json: https://pastebin.com/hvJS2441
Forsøger lige med debug delen i aften...
Syntes ikke der kommer mere i loggen ved at tilføje linjen i client.py...
Der kommer dog denne, men den var der også før:
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 388, in async_setup
result = await component.async_setup_entry(hass, self)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/calendar/__init__.py", line 313, in async_setup_entry
return await component.async_setup_entry(entry)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 187, in async_setup_entry
raise ValueError("Config entry has already been setup!")
ValueError: Config entry has already been setup!
Bare lige for at se - kan du prøve at sætte integrationen op uden hverken skoleskema og ugeplaner? Bare for at se om alle fejl er væk.
@scaarup Kommer også uden nogen flueben:
Error setting up entry Aula for binary_sensor
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 388, in async_setup
result = await component.async_setup_entry(hass, self)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/binary_sensor/__init__.py", line 169, in async_setup_entry
return await component.async_setup_entry(entry)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 187, in async_setup_entry
raise ValueError("Config entry has already been setup!")
ValueError: Config entry has already been setup!
Okay det er interessant.
Prøv at fjern/kommenter linje 73-75 i sensor.py
hass.async_create_task(
hass.config_entries.async_forward_entry_setup(config_entry, "binary_sensor")
)
Og genstart.
Så er fejlen der ikke, men sensorne "svare ikke" rigtigt.
Har forsøgt at slette integrationen og tilføje den igen..
Så nu har du sat den op med både ugeplaner og skoleskema igen?
Vi skal nok se en ny debug.log
Okay.. Linie 73-75 er udkommenteret. Hele HA er genstartet. Har tilføjet Aula uden at markere nogen af fluebenene. Der er nu 2 sensorer, som viser om de er der (N/A for hende som går i skole.
Ny Log her:
2023-08-28 14:47:14.525 INFO (MainThread) [custom_components.aula] _ /\ | | / \ _ _| | __ _ / /\ \| | | | |/ _
|
/ _ \ || | | (| |
// _\,||_,|2023-08-28 14:47:14.534 DEBUG (SyncWorker_6) [custom_components.aula.client] is_logged_in? False 2023-08-28 14:47:14.534 DEBUG (SyncWorker_6) [custom_components.aula.client] Logging in 2023-08-28 14:47:16.413 DEBUG (SyncWorker_6) [custom_components.aula.client] Trying API at https://www.aula.dk/api/v15 2023-08-28 14:47:16.460 WARNING (SyncWorker_6) [custom_components.aula.client] API was expected at https://www.aula.dk/api/v15 but responded with HTTP 410. The integration will automatically try a newer version and everything may work fine. 2023-08-28 14:47:16.460 DEBUG (SyncWorker_6) [custom_components.aula.client] Trying API at https://www.aula.dk/api/v16 2023-08-28 14:47:16.666 DEBUG (SyncWorker_6) [custom_components.aula.client] Found API on https://www.aula.dk/api/v16 2023-08-28 14:47:16.910 DEBUG (SyncWorker_6) [custom_components.aula.client] LOGIN: True 2023-08-28 14:47:16.910 DEBUG (SyncWorker_6) [custom_components.aula.client] Config - schoolschedule: False, config - ugeplaner: False 2023-08-28 14:47:16.910 DEBUG (SyncWorker_6) [custom_components.aula.client] Child ids and names: {1258167: 'Emilie Esther Thorup', 4151073: 'Elliot Ejgil Thorup'} 2023-08-28 14:47:16.910 DEBUG (SyncWorker_6) [custom_components.aula.client] Child ids and institution names: {1258167: 'Gandrup Skole', 4151073: 'Specialbørnehaven Stampe'} 2023-08-28 14:47:16.910 DEBUG (SyncWorker_6) [custom_components.aula.client] Institution codes: ['817001', 'G23494'] 2023-08-28 14:47:16.980 WARNING (SyncWorker_6) [custom_components.aula.client] Unable to retrieve presence data from Aula from child with id 1258167. Some data will be missing from sensor entities. 2023-08-28 14:47:17.060 DEBUG (SyncWorker_6) [custom_components.aula.client] Child ids and presence data status: {'1258167': 0, '4151073': 1} 2023-08-28 14:47:18.019 DEBUG (MainThread) [custom_components.aula.sensor] Finished fetching sensor data in 3.486 seconds (success: True) 2023-08-28 14:47:18.120 DEBUG (SyncWorker_2) [custom_components.aula.client] is_logged_in? True 2023-08-28 14:47:18.120 DEBUG (SyncWorker_2) [custom_components.aula.client] Child ids and names: {1258167: 'Emilie Esther Thorup', 4151073: 'Elliot Ejgil Thorup'} 2023-08-28 14:47:18.120 DEBUG (SyncWorker_2) [custom_components.aula.client] Child ids and institution names: {1258167: 'Gandrup Skole', 4151073: 'Specialbørnehaven Stampe'} 2023-08-28 14:47:18.120 DEBUG (SyncWorker_2) [custom_components.aula.client] Institution codes: ['817001', 'G23494'] 2023-08-28 14:47:18.198 WARNING (SyncWorker_2) [custom_components.aula.client] Unable to retrieve presence data from Aula from child with id 1258167. Some data will be missing from sensor entities. 2023-08-28 14:47:18.298 DEBUG (SyncWorker_2) [custom_components.aula.client] Child ids and presence data status: {'1258167': 0, '4151073': 1} 2023-08-28 14:47:19.258 DEBUG (MainThread) [custom_components.aula.sensor] Found presence data for childid 4151073 adding sensor entity. 2023-08-28 14:47:19.259 DEBUG (MainThread) [custom_components.aula.sensor] Unique ID for child 1258167 aula1258167 2023-08-28 14:47:19.259 DEBUG (MainThread) [custom_components.aula.sensor] Unique ID for child 1258167 aula1258167 2023-08-28 14:47:19.259 DEBUG (MainThread) [custom_components.aula.sensor] Unique ID for child 1258167 aula1258167 2023-08-28 14:47:19.260 DEBUG (MainThread) [custom_components.aula.sensor] Setting state to n/a for child 1258167 2023-08-28 14:47:19.260 DEBUG (MainThread) [custom_components.aula.sensor] Unique ID for child 4151073 aula4151073 2023-08-28 14:47:19.260 DEBUG (MainThread) [custom_components.aula.sensor] Unique ID for child 4151073 aula4151073 2023-08-28 14:47:19.260 DEBUG (MainThread) [custom_components.aula.sensor] Unique ID for child 4151073 aula4151073 2023-08-28 14:47:28.158 DEBUG (SyncWorker_4) [custom_components.aula.client] is_logged_in? True 2023-08-28 14:47:28.158 DEBUG (SyncWorker_4) [custom_components.aula.client] Child ids and names: {1258167: 'Emilie Esther Thorup', 4151073: 'Elliot Ejgil Thorup'} 2023-08-28 14:47:28.158 DEBUG (SyncWorker_4) [custom_components.aula.client] Child ids and institution names: {1258167: 'Gandrup Skole', 4151073: 'Specialbørnehaven Stampe'} 2023-08-28 14:47:28.158 DEBUG (SyncWorker_4) [custom_components.aula.client] Institution codes: ['817001', 'G23494'] 2023-08-28 14:47:28.388 WARNING (SyncWorker_4) [custom_components.aula.client] Unable to retrieve presence data from Aula from child with id 1258167. Some data will be missing from sensor entities. 2023-08-28 14:47:28.502 DEBUG (SyncWorker_4) [custom_components.aula.client] Child ids and presence data status: {'1258167': 0, '4151073': 1} 2023-08-28 14:47:29.215 DEBUG (MainThread) [custom_components.aula.sensor] Finished fetching sensor data in 1.194 seconds (success: True) 2023-08-28 14:47:29.215 DEBUG (MainThread) [custom_components.aula.sensor] Setting state to n/a for child 1258167
`
Okay, så prøv at enable ugeplan og se.
Så er ugeplan enabled og følgende i log:
_ /\ | | / \ _ _| | __ _ / /\ \| | | | |/ _
|
/ _ \ || | | (| |
// _\,||_,|2023-08-28 14:47:14.534 DEBUG (SyncWorker_6) [custom_components.aula.client] is_logged_in? False 2023-08-28 14:47:14.534 DEBUG (SyncWorker_6) [custom_components.aula.client] Logging in 2023-08-28 14:47:16.413 DEBUG (SyncWorker_6) [custom_components.aula.client] Trying API at https://www.aula.dk/api/v15 2023-08-28 14:47:16.460 WARNING (SyncWorker_6) [custom_components.aula.client] API was expected at https://www.aula.dk/api/v15 but responded with HTTP 410. The integration will automatically try a newer version and everything may work fine. 2023-08-28 14:47:16.460 DEBUG (SyncWorker_6) [custom_components.aula.client] Trying API at https://www.aula.dk/api/v16 2023-08-28 14:47:16.666 DEBUG (SyncWorker_6) [custom_components.aula.client] Found API on https://www.aula.dk/api/v16 2023-08-28 14:47:16.910 DEBUG (SyncWorker_6) [custom_components.aula.client] LOGIN: True 2023-08-28 14:47:16.910 DEBUG (SyncWorker_6) [custom_components.aula.client] Config - schoolschedule: False, config - ugeplaner: False 2023-08-28 14:47:16.910 DEBUG (SyncWorker_6) [custom_components.aula.client] Child ids and names: {1258167: 'Emilie Esther Thorup', 4151073: 'Elliot Ejgil Thorup'} 2023-08-28 14:47:16.910 DEBUG (SyncWorker_6) [custom_components.aula.client] Child ids and institution names: {1258167: 'Gandrup Skole', 4151073: 'Specialbørnehaven Stampe'} 2023-08-28 14:47:16.910 DEBUG (SyncWorker_6) [custom_components.aula.client] Institution codes: ['817001', 'G23494'] 2023-08-28 14:47:16.980 WARNING (SyncWorker_6) [custom_components.aula.client] Unable to retrieve presence data from Aula from child with id 1258167. Some data will be missing from sensor entities. 2023-08-28 14:47:17.060 DEBUG (SyncWorker_6) [custom_components.aula.client] Child ids and presence data status: {'1258167': 0, '4151073': 1} 2023-08-28 14:47:18.019 DEBUG (MainThread) [custom_components.aula.sensor] Finished fetching sensor data in 3.486 seconds (success: True) 2023-08-28 14:47:18.120 DEBUG (SyncWorker_2) [custom_components.aula.client] is_logged_in? True 2023-08-28 14:47:18.120 DEBUG (SyncWorker_2) [custom_components.aula.client] Child ids and names: {1258167: 'Emilie Esther Thorup', 4151073: 'Elliot Ejgil Thorup'} 2023-08-28 14:47:18.120 DEBUG (SyncWorker_2) [custom_components.aula.client] Child ids and institution names: {1258167: 'Gandrup Skole', 4151073: 'Specialbørnehaven Stampe'} 2023-08-28 14:47:18.120 DEBUG (SyncWorker_2) [custom_components.aula.client] Institution codes: ['817001', 'G23494'] 2023-08-28 14:47:18.198 WARNING (SyncWorker_2) [custom_components.aula.client] Unable to retrieve presence data from Aula from child with id 1258167. Some data will be missing from sensor entities. 2023-08-28 14:47:18.298 DEBUG (SyncWorker_2) [custom_components.aula.client] Child ids and presence data status: {'1258167': 0, '4151073': 1} 2023-08-28 14:47:19.258 DEBUG (MainThread) [custom_components.aula.sensor] Found presence data for childid 4151073 adding sensor entity. 2023-08-28 14:47:19.259 DEBUG (MainThread) [custom_components.aula.sensor] Unique ID for child 1258167 aula1258167 2023-08-28 14:47:19.259 DEBUG (MainThread) [custom_components.aula.sensor] Unique ID for child 1258167 aula1258167 2023-08-28 14:47:19.259 DEBUG (MainThread) [custom_components.aula.sensor] Unique ID for child 1258167 aula1258167 2023-08-28 14:47:19.260 DEBUG (MainThread) [custom_components.aula.sensor] Setting state to n/a for child 1258167 2023-08-28 14:47:19.260 DEBUG (MainThread) [custom_components.aula.sensor] Unique ID for child 4151073 aula4151073 2023-08-28 14:47:19.260 DEBUG (MainThread) [custom_components.aula.sensor] Unique ID for child 4151073 aula4151073 2023-08-28 14:47:19.260 DEBUG (MainThread) [custom_components.aula.sensor] Unique ID for child 4151073 aula4151073 2023-08-28 14:47:28.158 DEBUG (SyncWorker_4) [custom_components.aula.client] is_logged_in? True 2023-08-28 14:47:28.158 DEBUG (SyncWorker_4) [custom_components.aula.client] Child ids and names: {1258167: 'Emilie Esther Thorup', 4151073: 'Elliot Ejgil Thorup'} 2023-08-28 14:47:28.158 DEBUG (SyncWorker_4) [custom_components.aula.client] Child ids and institution names: {1258167: 'Gandrup Skole', 4151073: 'Specialbørnehaven Stampe'} 2023-08-28 14:47:28.158 DEBUG (SyncWorker_4) [custom_components.aula.client] Institution codes: ['817001', 'G23494'] 2023-08-28 14:47:28.388 WARNING (SyncWorker_4) [custom_components.aula.client] Unable to retrieve presence data from Aula from child with id 1258167. Some data will be missing from sensor entities. 2023-08-28 14:47:28.502 DEBUG (SyncWorker_4) [custom_components.aula.client] Child ids and presence data status: {'1258167': 0, '4151073': 1} 2023-08-28 14:47:29.215 DEBUG (MainThread) [custom_components.aula.sensor] Finished fetching sensor data in 1.194 seconds (success: True) 2023-08-28 14:47:29.215 DEBUG (MainThread) [custom_components.aula.sensor] Setting state to n/a for child 1258167 2023-08-28 14:52:29.720 WARNING (SyncWorker_5) [custom_components.aula.client] Unable to retrieve presence data from Aula from child with id 1258167. Some data will be missing from sensor entities. 2023-08-28 14:57:30.804 WARNING (SyncWorker_3) [custom_components.aula.client] Unable to retrieve presence data from Aula from child with id 1258167. Some data will be missing from sensor entities. 2023-08-28 15:02:50.650 WARNING (SyncWorker_3) [custom_components.aula.client] API was expected at https://www.aula.dk/api/v15 but responded with HTTP 410. The integration will automatically try a newer version and everything may work fine. 2023-08-28 15:02:51.309 WARNING (SyncWorker_3) [custom_components.aula.client] Unable to retrieve presence data from Aula from child with id 1258167. Some data will be missing from sensor entities. 2023-08-28 15:02:52.895 WARNING (SyncWorker_12) [custom_components.aula.client] Unable to retrieve presence data from Aula from child with id 1258167. Some data will be missing from sensor entities. 2023-08-28 15:03:02.932 WARNING (SyncWorker_4) [custom_components.aula.client] Unable to retrieve presence data from Aula from child with id 1258167. Some data will be missing from sensor entities. 2023-08-28 15:08:03.467 WARNING (SyncWorker_1) [custom_components.aula.client] Unable to retrieve presence data from Aula from child with id 1258167. Some data will be missing from sensor entities.`
Okay, forventer du at ugeplan skal være tilgængelig på dine entities nu - og er de?
Hov loggen siger jo noget andet:
Config - schoolschedule: False, config - ugeplaner: False
De burde vel være der, når fluebenet er sat?.. Men der er ikke noget... Hvor i Aula skal jeg kigge efter om der er noget? Hvilken liste er det den kigger i?
Ser ud til fluebenet var smuttet for mig.. Kommer lige med en ny log om 10 min..
Ny Log:
I den seneste log har du enabled både ugeplaner og skoleskema. Vi bliver nødt til at koncentrere os om en af tingene. Er ugeplaner tomme på dine entities? Det lader til, at du har ugeplaner fra Min Uddannelse. Kan du prøve at indkommentere linjerne 257+258 i client.py ? Så skulle svaret fra Min Uddannelse nemlig blive logget ud.
Jeg har kun sat flueben i ugeplaner..
okay, loggen siger noget andet.
Ny log.. Ved ikke om det kan gå for hurtigt med at oprette den lige efter hinanden...
Fik du indkommenteret linjerne?
73-75 er stadig udkommenteret i sensor.py
73-75 er stadig udkommenteret i sensor.py
Se lige min comment lidt længere oppe.
Ah.. Done...
Tænker det her er det der giver mening: 2023-08-29 12:21:56.299 DEBUG (SyncWorker_6) [custom_components.aula.client] Requesting token for widget 0029 2023-08-29 12:21:56.443 DEBUG (SyncWorker_6) [custom_components.aula.client] ugeplaner status_code 200 2023-08-29 12:21:56.443 DEBUG (SyncWorker_6) [custom_components.aula.client] ugeplaner response {"personer":[]} 2023-08-29 12:21:56.444 DEBUG (SyncWorker_6) [custom_components.aula.client] Requesting token for widget 0029 2023-08-29 12:21:56.582 DEBUG (SyncWorker_6) [custom_components.aula.client] ugeplaner status_code 200 2023-08-29 12:21:56.582 DEBUG (SyncWorker_6) [custom_components.aula.client] ugeplaner response {"personer":[]} 2023-08-29 12:21:56.584 DEBUG (MainThread) [custom_components.aula.sensor] Finished fetching sensor data in 2.007 seconds (success: True)
Ah :) Så der er faktisk svar, men det er tomt. Hvis du logger ind i Aula, er der da ugeplaner tilgængelige? De skal stå under "Min Uddannelse - Ugenoter".
Nej der står ikke noget når jeg går ind of kigger..
Men det var nu også mest kalenderen jeg var interesseret i....
okay - titlen på issue'et er måske lidt misvisende. Men prøv at få aktiveret skoleskema og lad lige din HA køre i min. 10 minutter, da det er tiden imellem vi henter kalender.
Så ser den sådan her ud loggen: https://pastebin.com/hZd45amc
Og skoleskema.json ser sådan her ud: https://pastebin.com/iRiaPV9B
Okay, hvordan ser entities ud i HA?
Indeholder ingenting...
Det du ser der, er helt normalt. Prøv at lav et calendar card i dit UI og se om der dukker noget op.
Så er der bid... Så data ligger et eller andet sted man ikke kan se? Tænker muligvis jeg har fået rodet rundt i ugeplaner og kalender... For havde tilføjet det yaml kode fra din side, men det var til ugeplaner..
Anyways, det ser ud til at virke.. :)
Det er fordi calendar entities er lidt specielle. Selve kalender-data er ikke hverken "state" eller "attributes" - derfor du ikke kan se det på states listen :)
Når jeg opsætter integrationen, så opretter den godt nok fem entities. to for hvert barn, og en der viser om der er ulæste beskeder.
Ved Elliot, som går i børnehave, viser den om han er der eller ej. Fint. Ved Emilie som går i skole viser den ingen ting. Her er det kalenderen jeg tænker, da de ikke bruger ind/ud tjekning.
Logger jeg ind på Aula er kalenderen fint fyldt ud.
Please answer the following
Please provide debug log from the integration
home-assistant_aula_2023-08-24T18-05-19.130Z.log