Closed Milfeldt closed 5 months ago
Tak @Milfeldt Det første til youtube, giver ingen mening :).
Men der er et interessant kald til https://api.easyiqcloud.dk/api/aula/weekinfo.
Dog ser jeg ingen authentication tokens overhovedet. Har du redigeret noget som helst ud? Og læg mærke til "-X "OPTIONS"". Der er to kald mere til https://api.easyiqcloud.dk/api/aula/weekinfo:
En anden ting. Vi skal se din Home Assistant log fra opstart, hvor der skal være en linje med: "Widgets found:"
Tip: højreklik på et af kolonnenavnene og sørg for, at Domain er vinget til. Så kan du nemt se alle kald til domain "api.easyiqcloud.dk"
@scaarup Intet er fjernet, billederne er nøjagtig som jeg får det frem, jeg undrede mig også over youtube men fordi der stod widget, så kom den med. Jeg får set på det i morgen, hovedet vil ikke mere for i dag ...
@scaarup Intet er fjernet, billederne er nøjagtig som jeg får det frem, jeg undrede mig også over youtube men fordi der stod widget, så kom den med. Jeg får set på det i morgen, hovedet vil ikke mere for i dag ...
modtaget. Det var ikke billederne jeg snakkede om, men de curl kommandoer. Anyways, hvis du får fanget de andre kald til "weekinfo", så har vi noget at gå videre med.
Hej med jer, jeg er helt med på den ide omkring at få easyIQ ind i aula da jeg har børn hvor alt hvad de har for, kommer der ind og jeg mangler virkelig at kunne sætte notifications up afhængig af om de har noget for, hvis det kan lade sig gøre ville det være fedt 👍 @scaarup du må misbruge mig, og vi kan gøre det sammen om teams kald og alt muligt andet, men jeg håber lidt det her kan hjælpe:
@ethante fedt 🙂
Kan du "copy as curl cmd" og paste det her i code tags? (Det kald til weekinfo)
@scaarup
curl "https://api.easyiqcloud.dk/api/aula/weekplaninfo" ^ -H "authority: api.easyiqcloud.dk" ^ -H "accept: application/json, text/plain, */*" ^ -H "accept-language: en-US,en;q=0.9,da;q=0.8" ^ -H "authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImtpZCI6ImFlZTg0OTYwOTg3MDRkNjFlNWI4ZmYyNWJmZGQxNDJhZjkzZjE2YjAifQ.eyJpc3MiOiJBdWxhIiwiaWF0IjoxNzA3MDQwODM3Ljc3MjUxMSwiYXVkIjoiMDAwMSIsIkFzc3VyYW5jZUxldmVsIjoyLCJpc1BpbG90Ijpm2FuSBsgh1rmTbwiQKIboIBD9rLsF4YBkP_KD_ViXXPNkGdDpfzs80AUbpAJ16D3WFOeX6NE6bbhuGf2YM7CA9SC1xStvyshrXNJqa73eY9b_CRZ3cnDL07zp1jr36VVqdL09YbmjOfVf6KEc_wE756EJjXPHxpeY4HbEC7_YAscRAy1cfh1Z32Yjcm5VP6L6kyzbY0mPUVz0XDibkD4USML59NB3pIqAsz_pPXTom7ijcwBWChJ9egNJ2ZCWlTs943cc2-zY1VWY5D2UjQvq0Iwzj-CbJcv-1cbBJ4uKxfzBBb9ISgW2fF6hDkDD1tssy1BzCpiR2aXkBEGZgBlllUY7gQBx7Uh1Tq4-gi4tsSO32eeRiWxXLnUBC_MYU7ipL2JAGMaL1" ^ -H "content-type: application/json" ^ -H "csrfp-token: f9da1989160a8392fe550bcc35089ae6" ^ -H "origin: https://www.aula.dk" ^ -H "referer: https://www.aula.dk/" ^ -H "sec-ch-ua: ^\^"Not A(Brand^\^";v=^\^"99^\^", ^\^"Google Chrome^\^";v=^\^"121^\^", ^\^"Chromium^\^";v=^\^"121^\^"" ^ -H "sec-ch-ua-mobile: ?0" ^ -H "sec-ch-ua-platform: ^\^"Windows^\^"" ^ -H "sec-fetch-dest: empty" ^ -H "sec-fetch-mode: cors" ^ -H "sec-fetch-site: cross-site" ^ -H "user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36" ^ -H "x-aula-institutionfilter: 779006" ^ -H "x-aula-userprofile: guardian" ^ --data-raw "^{^\^"sessionId^\^":^\^"UNILOGINNAME^\^",^\^"currentWeekNr^\^":^\^"2024-W5^\^",^\^"userProfile^\^":^\^"guardian^\^",^\^"institutionFilter^\^":^[^\^"779006^\^"^],^\^"childFilter^\^":^[^\^"UNIBARN1^\^",^\^"UNIBARN2^\^"^]^}" ^ --compressed
Jeg har fjernet halvdelen af token ;) og fjernet mit unilogin under sessionid samt mine to børns uniloginnavne, men ellers ser den sådan ud
@scaarup
`curl "https://api.easyiqcloud.dk/api/aula/weekplaninfo" ^
-H "authority: api.easyiqcloud.dk" ^
-H "accept: application/json, text/plain, /" ^
-H "accept-language: en-US,en;q=0.9,da;q=0.8" ^
-H "authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImtpZCI6ImFlZTg0OTYwOTg3MDRkNjFlNWI4ZmYyNWJmZGQxNDJhZjkzZjE2YjAifQ.eyJpc3MiOiJBdWxhIiwiaWF0IjoxNzA3MDQwODM3Ljc3MjUxMSwiYXVkIjoiMDAwMSIsIkFzc3VyYW5jZUxldmVsIjoyLCJpc1BpbG90Ijpm2FuSBsgh1rmTbwiQKIboIBD9rLsF4YBkP_KD_ViXXPNkGdDpfzs80AUbpAJ16D3WFOeX6NE6bbhuGf2YM7CA9SC1xStvyshrXNJqa73eY9b_CRZ3cnDL07zp1jr36VVqdL09YbmjOfVf6KEc_wE756EJjXPHxpeY4HbEC7_YAscRAy1cfh1Z32Yjcm5VP6L6kyzbY0mPUVz0XDibkD4USML59NB3pIqAsz_pPXTom7ijcwBWChJ9egNJ2ZCWlTs943cc2-zY1VWY5D2UjQvq0Iwzj-CbJcv-1cbBJ4uKxfzBBb9ISgW2fF6hDkDD1tssy1BzCpiR2aXkBEGZgBlllUY7gQBx7Uh1Tq4-gi4tsSO32eeRiWxXLnUBC_MYU7ipL2JAGMaL1" ^
-H "content-type: application/json" ^
-H "csrfp-token: f9da1989160a8392fe550bcc35089ae6" ^
-H "origin: https://www.aula.dk" ^
-H "referer: https://www.aula.dk/" ^
-H "sec-ch-ua: ^\^"Not A(Brand^\^";v=^\^"99^\^", ^\^"Google Chrome^\^";v=^\^"121^\^", ^\^"Chromium^\^";v=^\^"121^\^"" ^
-H "sec-ch-ua-mobile: ?0" ^
-H "sec-ch-ua-platform: ^\^"Windows^\^"" ^
-H "sec-fetch-dest: empty" ^
-H "sec-fetch-mode: cors" ^
-H "sec-fetch-site: cross-site" ^
-H "user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36" ^
-H "x-aula-institutionfilter: 779006" ^
-H "x-aula-userprofile: guardian" ^
--data-raw "^{^\^"sessionId^\^":^\^"UNILOGINNAME^\^",^\^"currentWeekNr^\^":^\^"2024-W5^\^",^\^"userProfile^\^":^\^"guardian^\^",^\^"institutionFilter^\^":^[^\^"779006^\^"^],^\^"childFilter^\^":^[^\^"UNIBARN1^\^",^\^"UNIBARN2^\^"^]^}" ^
--compressed`
Jeg har fjernet halvdelen af token ;) og fjernet mit unilogin under sessionid samt mine to børns uniloginnavne, men ellers ser den sådan ud
Tak 🙂. Jeg vender retur
@ethante vil du lige paste log-linjen, der indeholder "Widgets found: "? Kommer ved opstart af HA og med debug log på integrationen.
@scaarup
Fedt @ethante.
Gider du teste denne her branch: https://github.com/scaarup/aula/tree/MU_Opgaver ?
Jeg vil gerne se loggen.
sry har lige pushet en lille ændring ud. Det er kun client.py og const.py, der er ændrede, så du kan bare kopiere dem fra branchen, hvis det er nemmere,
@scaarup
2024-02-04 19:46:57.271 ERROR (MainThread) [custom_components.aula.sensor] Unexpected error fetching sensor data: the JSON object must be str, bytes or bytearray, not dict Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 300, in _async_refresh self.data = await self._async_update_data() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 256, in _async_update_data return await self.update_method() ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/aula/sensor.py", line 60, in async_update_data await hass.async_add_executor_job(client.update_data) File "/usr/local/lib/python3.11/concurrent/futures/thread.py", line 58, in run result = self.fn(*self.args, **self.kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/aula/client.py", line 628, in update_data ugeplan(thisweek, "this") File "/config/custom_components/aula/client.py", line 461, in ugeplan json=json.loads(post_data), ^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/json/init.py", line 339, in loads raise TypeError(f'the JSON object must be str, bytes or bytearray, ' TypeError: the JSON object must be str, bytes or bytearray, not dict
Var der ingen loglinjer før det? Nogen med "EasyIQ"?
@scaarup
Nej intet, tror den helt fejlede efter som de står sådan her:
jeg kopirede kun de 2 filer ind fra den branch
Har du debug log på? Der skal være mere log. Der sker jo noget før den exception.
hop ind i en terminal og:
grep -i easyiq /config/home-assistant.log
@scaarup sry, den var disabled efter jeg havde ændret de 2 filer, men her kommer det:
2024-02-04 20:06:55.920 DEBUG (SyncWorker_5) [custom_components.aula.client] Widgets found: {'0047': 'Fravær - forældreindberetning', '0049': 'Karakterer - synlig for forældre', '0001': 'EasyIQ Ugeplan', '0018': 'EasyIQ Links', '0108': 'Meddelelsesbog', '0024': 'Forældreportalen'} 2024-02-04 20:06:55.920 DEBUG (SyncWorker_5) [custom_components.aula.client] In the EasyIQ flow flow 2024-02-04 20:06:55.921 DEBUG (SyncWorker_5) [custom_components.aula.client] Requesting token for widget 0001 2024-02-04 20:06:56.034 DEBUG (SyncWorker_5) [custom_components.aula.client] EasyIQ headers {'x-aula-institutionfilter': '1541338,4019136', 'x-aula-userprofile': 'guardian', 'Authorization': 'Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImtpZCI6ImFlZTg0OTYwOTg3MDRkNjFlNWI4ZmYyNWJmZGQxNDJhZjkzZjE2YjAifQ.eyJpc3MkIjoiMDAwMSIsIkFzc3VyYW5jZbaGSxD876hsZdbumjhIR7pUMXdnOi1fXh4uxbmEZ1_yu1KgYFksF6PNV-b_vHstnJhmr49MkQiDsHtEwAQeAH4zA916DXjCmt_qVFWmPM-heSgZGfRdiBdTZ0xlH1bHnBge9iwZ0vOunRJifEwIZ81MY42_UbvT5g2AQHUWvu9aC2xER-hK1yyTeFPuz3TzXFcADemWAoj1LvwmniIhTlkkWgCWWwPnIXiTGED4QgmyFtzOUB_9P-Z1QfLy6q_PIfIs9Fo7XOCiR8ZYqLEu1CYQ7pSILJOxrBLA7CSPtkySE6KRYvfilfK_WbVFVmd9jgqDk3vMwchTOlJumVWoA4lJlAFth_SpI163g0uVP3dzb', 'accept': 'application/json', 'csrfp-token': 'e97fb537a9e0d01558f9b8b51c49c1e8', 'origin': 'https://www.aula.dk', 'referer': 'https://www.aula.dk/', 'authority': 'api.easyiqcloud.dk'} 2024-02-04 20:06:56.034 DEBUG (SyncWorker_5) [custom_components.aula.client] EasyIQ post data {'sessionId': 'xxxxxx', 'currentWeekNr': '2024-W5', 'userProfile': 'guardian', 'institutionFilter': '1541338,4019136', 'childFilter': ['xxxxxx,xxxxx']} 2024-02-04 20:07:13.548 ERROR (MainThread) [custom_components.aula.sensor] Unexpected error fetching sensor data: the JSON object must be str, bytes or bytearray, not dict Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 300, in _async_refresh self.data = await self._async_update_data() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 256, in _async_update_data return await self.update_method() ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/aula/sensor.py", line 60, in async_update_data await hass.async_add_executor_job(client.update_data) File "/usr/local/lib/python3.11/concurrent/futures/thread.py", line 58, in run result = self.fn(*self.args, **self.kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/aula/client.py", line 628, in update_data ugeplan(thisweek, "this") File "/config/custom_components/aula/client.py", line 461, in ugeplan json=json.loads(post_data), ^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/json/init.py", line 339, in loads raise TypeError(f'the JSON object must be str, bytes or bytearray, ' TypeError: the JSON object must be str, bytes or bytearray, not dict 2024-02-04 20:07:13.579 DEBUG (MainThread) [custom_components.aula.sensor] Finished fetching sensor data in 24.011 seconds (success: False)
Takker. Der er en ny version af client.py - vil du lige prøve den? Og smid gerne loggen i code tags her, så er det meget nemmere at læse.
@scaarup efter den sidste nye fil
Fetching calendars... 2024-02-04 20:31:45.391 DEBUG (SyncWorker_4) [custom_components.aula.client] Widgets found: {'0047': 'Fravær - forældreindberetning', '0049': 'Karakterer - synlig for forældre', '0001': 'EasyIQ Ugeplan', '0018': 'EasyIQ Links', '0108': 'Meddelelsesbog', '0024': 'Forældreportalen'} 2024-02-04 20:31:45.392 DEBUG (SyncWorker_4) [custom_components.aula.client] In the EasyIQ flow flow 2024-02-04 20:31:45.392 DEBUG (SyncWorker_4) [custom_components.aula.client] Requesting token for widget 0001 2024-02-04 20:31:45.481 DEBUG (SyncWorker_4) [custom_components.aula.client] EasyIQ headers {'x-aula-institutionfilter': '779006', 'x-aula-userprofile': 'guardian', 'Authorization': 'Bearer eyJ0eXAiOiJKV1QiLCJhbGxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxYjBkMzFhOC45MjU5NDA3OSIsInN1YiI6ImFuZGUyOWY1In0.GOtbX6h2CWcv5K-vgm1r-UNa87g9SY0gl3ZmfI4yE8oFF-ySPTZafg7MKTcgLkiXYIV0GQsRVSjDKqsGkieICkKAPCHmHMW_lzFTl7oFquxrL87xONHK1GevvCMeIxSn9OJ4RWeDGVc_7GcwAg4jusFLyNcY_gFhKi29MsaiAJ26e2TOI0bNShcuXL1f-wbe3AUv-WpMyBDMN-LTaHZQ00NjrgWFR4x5iu08RQ_2aWSe7Ufd-wGhMQAZM4fnsqinbqq9Cqc7C4iTOwqTqBSgcyOin8D2oZDCRDb47ijLPAb6VMnH_trSM7zvuiaKwIvFQbglyXMcglo0jYHVQdHZqpgFK5mUJhFVBnCLPG1qiSl-7cDLzAmwRUCgNrz5_LxMt_Y1jkYmTxKDjk0rroGzrU6qtwJm0AnpOZaRfYkx4bfhYMUpOXG4Qyj8n4LmTGKSvCf9YJMO5duzQcL3w9IvDUqiDT5p6TM0QNizplbpHyhV2vZuqN6NXWyE5aXwEli3', 'accept': 'application/json', 'csrfp-token': '3ba37000bc3363e30ef1a955dcd700c7', 'origin': 'https://www.aula.dk', 'referer': 'https://www.aula.dk/', 'authority': 'api.easyiqcloud.dk'} 2024-02-04 20:31:45.481 DEBUG (SyncWorker_4) [custom_components.aula.client] EasyIQ post data {'sessionId': 'xxxxxxx', 'currentWeekNr': '2024-W05', 'userProfile': 'guardian', 'institutionFilter': "['779006']", 'childFilter': "['xxxxxx', 'xxxxxx']"} 2024-02-04 20:31:45.486 ERROR (MainThread) [custom_components.aula.sensor] Unexpected error fetching sensor data: the JSON object must be str, bytes or bytearray, not dict Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 300, in _async_refresh self.data = await self._async_update_data() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 256, in _async_update_data return await self.update_method() ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/aula/sensor.py", line 60, in async_update_data await hass.async_add_executor_job(client.update_data) File "/usr/local/lib/python3.11/concurrent/futures/thread.py", line 58, in run result = self.fn(*self.args, **self.kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/aula/client.py", line 630, in update_data ugeplan(thisweek, "this") File "/config/custom_components/aula/client.py", line 463, in ugeplan json=json.loads(post_data), ^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/json/__init__.py", line 339, in loads raise TypeError(f'the JSON object must be str, bytes or bytearray, ' TypeError: the JSON object must be str, bytes or bytearray, not dict 2024-02-04 20:31:45.517 DEBUG (MainThread) [custom_components.aula.sensor] Finished fetching sensor data in 6.811 seconds (success: False)
Okay, der er en ny version.
2024-02-04 20:49:03.415 DEBUG (SyncWorker_1) [custom_components.aula.client] Fetching calendars... 2024-02-04 20:49:04.382 DEBUG (SyncWorker_1) [custom_components.aula.client] Widgets found: {'0047': 'Fravær - forældreindberetning', '0049': 'Karakterer - synlig for forældre', '0001': 'EasyIQ Ugeplan', '0018': 'EasyIQ Links', '0108': 'Meddelelsesbog', '0024': 'Forældreportalen'} 2024-02-04 20:49:04.382 DEBUG (SyncWorker_1) [custom_components.aula.client] In the EasyIQ flow flow 2024-02-04 20:49:04.382 DEBUG (SyncWorker_1) [custom_components.aula.client] Requesting token for widget 0001 2024-02-04 20:49:04.492 DEBUG (SyncWorker_1) [custom_components.aula.client] EasyIQ headers {'x-aula-institutionfilter': '779006', 'x-aula-userprofile': 'guardian', 'Authorization': 'Bearer eyJ0eXAiOiJKVxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxyNWJmZGQxNDJhZjkzZjE2YjAifQ.eyJpc3MiOiJBdWxhIiwiaWF0IjoxNzA3MDc2MTQ0LjQ1OTM5LCJhdWQiOiIwMDAxIiwiQXNzdXJhbmNlTGV2ZWwiOjIsImlzUGlsb3QiOmZhbHNlLCJleHAiOjE3MDcwNzk3NDIsImp0aSI6IjY1YmZlYTJhNWU4MDA4LjgyMzQ5MTk3Iiwic3ViIjoiYW5kZTI5ZjUifQ.Rf3apE2lRMZFLLS0pwDb6APFupZ_U8NzEx6oRL8NJU71bqsxvRw5wuhljBUMFOk6sR3G9xC18-yzu9arfXwo3s6lG0VpQSKJG7JomAcQjnjBgTzZ23QQKq1N8KkjMvO0OwwXHYQOLoJha7Q0rLdYlgQrCRC6ClEznveHlevnbQWe4M2estrnLwI6jYbyxgvW5ijBtUii4OSY43HbjR-hbIup7BkHZH67hxgpu11PAa8SlHn0KUeceqD676UefJv9uX0RCJ0gk5zeqoNeD9vmGZ5--N2yKoNbkFC7v2dCCv__N49vnkGBqyQvJPgcEi6FwGXXPutnrIqQGDUB6uta9xOA6qkUyuN-78n1gQNVp8r3q0BsxMA54fp1O8e41xLyqNcM3wh614nTY0HD5p_tU2IC_bqjysXWplBWC0qRs-WMTE2yqJBB6TzzTW1iofS5S8lGfXfy8Ppf7R4TBJ2MwuVPf-SQYhJqLxgJ-HRZUZ5NW0EOjCNfrVNTWgV31X_6', 'accept': 'application/json', 'csrfp-token': '9b881640c570f2823029941259df9b27', 'origin': 'https://www.aula.dk', 'referer': 'https://www.aula.dk/', 'authority': 'api.easyiqcloud.dk'} 2024-02-04 20:49:04.493 DEBUG (SyncWorker_1) [custom_components.aula.client] EasyIQ post data {'sessionId': 'xxxxxxx', 'currentWeekNr': '2024-W05', 'userProfile': 'guardian', 'institutionFilter': "['779006']", 'childFilter': "['xxxxx', 'xxxxxx']"} 2024-02-04 20:49:04.854 DEBUG (SyncWorker_1) [custom_components.aula.client] EasyIQ Opgaver status_code 500 2024-02-04 20:49:04.854 DEBUG (SyncWorker_1) [custom_components.aula.client] EasyIQ Opgaver response {"Message":"An error has occurred."} 2024-02-04 20:49:04.866 DEBUG (SyncWorker_1) [custom_components.aula.client] In the EasyIQ flow flow
Der er et lille fix nu
ser meget ud til at være det samme
2024-02-04 21:11:28.460 DEBUG (SyncWorker_2) [custom_components.aula.client] Requesting token for widget 0001 2024-02-04 21:11:28.538 DEBUG (SyncWorker_2) [custom_components.aula.client] EasyIQ headers {'x-aula-institutionfilter': '779006', 'x-aula-userprofile': 'guardian', 'Authorization': 'Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImtpZCI6ImFlZTg0OTYwOTg3MDRkNjFlNWI4ZmYyNWJmZGQxNDJhZjkzZjE2YjAifQ.eyJpc3MiOiJBdWxhIiwiaWF0IjoxNzA3MDc3NDg4LjUxMTEzLCJhdWQiOiIwMDAxIiwiQXNzdXJhbmNlTGV2ZWwiOjIsImlzUGlsb3QiOmZhbHNlLCJleHAiOjE3MDcwODEwODMsImp0aSI6IjY1YmZlZjY3ODlhMWQ2LjE1MDk3NjkyIiwic3ViIjoiYW5kZTI5ZjUifQ.T1Iuutc5A8ptuqKvoRVGwc1WBZ4L1BiD4otSzLP2fYyRZtUgaI-923k3S7YJGtGf7u2oB3jUbwr7UCGtz7_CJN9dt8x1ECrk85sm4X9iTsByUV9mR1_3kn3FJ4clpJrAumnpFQW72PpZbwXBD6iL5Mdx-8KLSDNNe_hqr1xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx49RFsLY2S6ZFQ_OrCI9nG41dq3I7apcK6zvqpehg6hWpN78RnLW59L3DFzy64nKH9MLBGeoUTq7XkBt3IUOF2jiNFnxjxshr3__M61h8P-Q7z3O5EuTYB', 'accept': 'application/json', 'csrfp-token': '9542e054da219aed16f6af87a5f7c1fd', 'origin': 'https://www.aula.dk', 'referer': 'https://www.aula.dk/', 'authority': 'api.easyiqcloud.dk'} 2024-02-04 21:11:28.538 DEBUG (SyncWorker_2) [custom_components.aula.client] EasyIQ post data {'sessionId': 'xxxxxxx', 'currentWeekNr': '2024-W5', 'userProfile': 'guardian', 'institutionFilter': "['779006']", 'childFilter': "['xxxxxxxx', 'xxxxxxx']"} 2024-02-04 21:11:28.862 DEBUG (SyncWorker_2) [custom_components.aula.client] EasyIQ Opgaver status_code 500 2024-02-04 21:11:28.862 DEBUG (SyncWorker_2) [custom_components.aula.client] EasyIQ Opgaver response {"Message":"An error has occurred."}
Jeg fandt løsningen på det:
` # EasyIQ: if "0001" in self.widgets: _LOGGER.debug("In the EasyIQ flow") token = self.get_token("0001") csrf_token = self._session.cookies.get_dict()["Csrfp-Token"]
easyiq_headers = {
"x-aula-institutionfilter": str(self._institutionProfiles[0]),
"x-aula-userprofile": "guardian",
"Authorization": token,
"Content-Type": "application/json",
"accept": "application/json",
"csrfp-token": csrf_token,
"origin": "https://www.aula.dk",
"referer": "https://www.aula.dk/",
"authority": "api.easyiqcloud.dk",
}
_LOGGER.debug("EasyIQ headers " + str(easyiq_headers))
post_data = {
"sessionId": guardian,
"currentWeekNr": "2024-W6",
"userProfile": "guardian",
"institutionFilter": self._institutionProfiles,
"childFilter": self._childuserids,
}
_LOGGER.debug("EasyIQ post data " + str(post_data))
ugeplaner = requests.post(
EASYIQ_API + "/weekplaninfo",
json=post_data,
headers=easyiq_headers,
verify=True,
)
_LOGGER.debug(
"EasyIQ Opgaver status_code " + str(ugeplaner.status_code)
)
_LOGGER.debug("EasyIQ Opgaver response " + str(ugeplaner.text))`
jeg ændrede
"institutionFilter": self._institutionProfiles, "childFilter": self._childuserids,
til ikke at være str()
samt gav den "Content-Type": "application/json", i headers..
nu har jeg så alt det her:
{"fromDate":"2024-02-05T00:00:00","toDate":"2024-02-10T00:00:00","images":null,"WeekPlan":{"Id":399696,"ActivityId":1126108,"ActivityName":"4a","Year":2024,"WeekNo":6,"Text":"","RawHtml":"","Visible":true,"TextId":"182675bb-6063-452d-9ffb-cec763d7bfde"},"otherweekplans":[],"Events":[{"itemid":8578504,"IconId":null,"ownerunilogin":"xxxxxx","updatedbyunilogin":"xxxxxx","ownername":"NavnPåLære","updatedbyname":"NavnPåLære","ownerid":538615,"visibility":3,"start":"2024/02/06 08:00","end":"2024/02/06 08:45","isAllDay":false,"canEdit":false,"diffCount":0,"title":" ","chapterTitle":null,"color":"#43A6DF","darkerColor":null,"itemurl":"","icon":"~\\Images\\Plan\\svg\\open-book.svg","itemType":8,"description":"Drengene læser kapitel 13 og 14","RecurrencyTypeId":0,"RecurrencyStartDate":null,"RecurrencyEndDate":null,"recurringItemId":null,"IsSeries":false,"IsInstanceOfSeries":false,"ActivityIds":[1126108],"ActivityIdsCopy":null,"activities":"4a","CourseIds":[],"CourseIdsCopy":null,"courses":"","Private":false,"isFirstLineEmpty":false,"timeCreated":"2024-02-01T11:33:21.253","timeUpdated":"2024-02-04T20:18:48.717","updatedby":538615,"Action":null,"Controller":null,"ActionParameters":null,"HtmlObject":null,"objectId":"f1bc5167-747f-48d7-93ab-3b1debbaa731","extensiondata":null,"plans":null,"planIds":"","prId":null,"isClassroom":false},{"itemid":726181,"IconId":null,"ownerunilogin":null,"updatedbyunilogin":null,"ownername":null,"updatedbyname":null,"ownerid":381754,"visibility":0,"start":"2024-01-29T00:00:00.0000000","end":"2024-02-12T00:00:00.0000000","isAllDay":null,"canEdit":false,"diffCount":0,"title":"Skema, aktivitetskalender og Skolekalender","chapterTitle":null,"color":"#FF6666","darkerColor":null,"itemurl":"%7B%22route%22%3Anull%2C%22controller%22%3A%22Chapter%22%2C%22action%22%3A%22Index%22%2C%22params%22%3A%7B%22planId%22%3A%22726181%22%2C%22chapterId%22%3A%22-1%22%7D%2C%22child%22%3A%22lykk2941%22%7D","icon":"~/Images/Plan/svg/clock.svg","itemType":5,"description":null,"RecurrencyTypeId":0,"RecurrencyStartDate":null,"RecurrencyEndDate":null,"recurringItemId":null,"IsSeries":false,"IsInstanceOfSeries":false,"ActivityIds":[],"ActivityIdsCopy":null,"activities":null,"CourseIds":[],"CourseIdsCopy":null,"courses":null,"Private":false,"isFirstLineEmpty":false,"timeCreated":null,"timeUpdated":null,"updatedby":null,"Action":null,"Controller":null,"ActionParameters":null,"HtmlObject":null,"objectId":null,"extensiondata":null,"plans":null,"planIds":"","prId":null,"isClassroom":false},{"itemid":746491,"IconId":null,"ownerunilogin":null,"updatedbyunilogin":null,"ownername":null,"updatedbyname":null,"ownerid":381754,"visibility":0,"start":"2024-01-29T00:00:00.0000000","end":"2024-02-12T00:00:00.0000000","isAllDay":null,"canEdit":false,"diffCount":0,"title":"Møder mm.","chapterTitle":null,"color":"#B200FF","darkerColor":null,"itemurl":"%7B%22route%22%3Anull%2C%22controller%22%3A%22Chapter%22%2C%22action%22%3A%22Index%22%2C%22params%22%3A%7B%22planId%22%3A%22746491%22%2C%22chapterId%22%3A%22-1%22%7D%2C%22child%22%3A%22lykk2941%22%7D","icon":"~\\Images\\Plan\\svg\\child-safe-zone.svg","itemType":5,"description":null,"RecurrencyTypeId":0,"RecurrencyStartDate":null,"RecurrencyEndDate":null,"recurringItemId":null,"IsSeries":false,"IsInstanceOfSeries":false,"ActivityIds":[],"ActivityIdsCopy":null,"activities":null,"CourseIds":[],"CourseIdsCopy":null,"courses":null,"Private":false,"isFirstLineEmpty":false,"timeCreated":null,"timeUpdated":null,"updatedby":null,"Action":null,"Controller":null,"ActionParameters":null,"HtmlObject":null,"objectId":null,"extensiondata":null,"plans":null,"planIds":"","prId":null,"isClassroom":false}],"groups":[],"group":null,"weekinfo":{"currentweeknr":"Uge 6","prevweeknr":"2024-W05","nextweeknr":"2024-W07","weekstartdate":"2024-02-05T00:00:00","weekenddate":"2024-02-10T00:00:00","todaysweeknr":"2024-W06"},"notifications":{"latestview":"2024-01-29T07:05:54.88","notificationlist":[{"sender":{"fullname":"NavnPåLære","familyname":"NavnPåLære","givenname":"NavnPåLære","unilogin":"xxxxxx","loginid":381732,"logintypeid":2},"reciever":{"fullname":"NavnPåLære","familyname":"NavnPåLære","givenname":"NavnPåLære","unilogin":"xxxx","loginid":381732,"logintypeid":2},"target":{"fullname":"BarnNavnxxxx","familyname":"xxxxx","givenname":"xxxxxxxx","unilogin":"xxxx","loginid":2437106,"logintypeid":1},"url":"Overblik/172872","timestamp":"2024-01-15T11:32:28.137","read":false,"message":null,"Age":"20.22:13:26.6299975","notificationtypeid":1,"notificationtype":null,"data":[],"viewed":true},{"sender":{"fullname":"NavnPålære","familyname":"NavnPålære","givenname":"NavnPålære","unilogin":"xxxxx","loginid":381732,"logintypeid":2},"reciever":{"fullname":"NavnPålære","familyname":"NavnPålære","givenname":"NavnPålære","unilogin":"xxxxxx","loginid":381732,"logintypeid":2},"target":{"fullname":"NavnPåBarn2","familyname":"xxxx","givenname":"xxxxxx","unilogin":"xxxxxxx","loginid":1001246,"logintypeid":1},"url":"Overblik/120899","timestamp":"2023-05-30T08:46:13.41","read":true,"message":null,"Age":"251.00:59:41.3569975","notificationtypeid":1,"notificationtype":null,"data":[],"viewed":true}],"hasmore":false},"weekplanconfiguration":{"showplans":true,"narrowview_showplans":true,"showweekplanitemplanner":false,"usehtmlwidget":true},"links":[{"name":"Skoleportal","address":"https://skoleportal.easyiqcloud.dk","ssoenable":true},{"name":"Meddelelsesbog","address":"https://skoleportal.easyiqcloud.dk/elevplan","ssoenable":true}],"widgetlink":0}
men Ugeplan er stadig ikke fyldt ud, og attribute på sensor kid er stadig
Ugeplan - Not available Ugeplan next - Not available
Det er sådan det ser ud nu
Ah det er perfekt!
Content-type burde ikke være nødvendig at sætte. Burde ske automatisk når vi post'er json. Nej der er intet, der sætter ugeplan attrb. på sensorer endnu. Første step er at få noget data og nu hvor vi har det, så kan vi prøve at parse det for at generere noget tekst til sensoren.
Jeg har opdateret branchen nu. Ugenr er nu kalkuleret, så du må gerne teste om den virker.
Det virker super fint det du har lavet med weeks
@scaarup har du tid til et møde på teams, hvor vi kan gå igennem json filen og se hvordan vi skal strikse den sammen 🗡️
@ethante
Nej jeg får ikke tid til et Teams kald - jeg arbejder bare lidt ad-hoc på det her.
Det her: ownerid":538615" svarer det til id'et i Aula? Kan ses ved loglinjen: "Child ids and names:"
Det er bare i orden 👍
Nej den henter det ud med: 'childFilter': ['uniloginBarn1', 'uniloginBarn2']} og så kommer det hele i en pære vending :/
men kan man køre en "foreach childs" og kalde den derefter med vær barn og udfylde ugeplan som passer med det barn man kalder, så ville det passe, kan se at det en array af "Events": [ ] som indeholder det som skal udfylde, som dette:
{ "itemid": 8578504, "IconId": null, "ownerunilogin": "Lære's Unilogin", "updatedbyunilogin": "Lære's Unilogin", "ownername": "Lære's navn", "updatedbyname": "Lære's navn", "ownerid": 538615 <----- lære er owner, "visibility": 3, "start": "2024/02/06 08:00", "end": "2024/02/06 08:45", "isAllDay": false, "canEdit": false, "diffCount": 0, "title": " ", "chapterTitle": null, "color": "#43A6DF", "darkerColor": null, "itemurl": "", "icon": "~\\Images\\Plan\\svg\\open-book.svg", "itemType": 8, "description": "Drengene læser kapitel 13 og 14", "RecurrencyTypeId": 0, "RecurrencyStartDate": null, "RecurrencyEndDate": null, "recurringItemId": null, "IsSeries": false, "IsInstanceOfSeries": false, "ActivityIds": [ 1126108 ], "ActivityIdsCopy": null, "activities": "4a", "CourseIds": [], "CourseIdsCopy": null, "courses": "", "Private": false, "isFirstLineEmpty": false, "timeCreated": "2024-02-01T11:33:21.253", "timeUpdated": "2024-02-04T20:18:48.717", "updatedby": 538615, "Action": null, "Controller": null, "ActionParameters": null, "HtmlObject": null, "objectId": "f1bc5167-747f-48d7-93ab-3b1debbaa731", "extensiondata": null, "plans": null, "planIds": "", "prId": null, "isClassroom": false },
@ethante aha okay. Men der må da være en måde at se hvilke elementer, der hører til hvilke børn - når man nu kalder easyiq med multiple.
Når jeg kalder den fra aula, tager den bare begge børn med fra starten som childfilter og hvis jeg så vælger en af børnene i dropdown, laver den samme kald bare med childfilter med kun en af børnene med unilogin navn:
Okay, så må vi lave et kald per barn.
Det ville være super
@ethante vil du prøve den seneste ændring på branch https://github.com/scaarup/aula/tree/MU_Opgaver ?
@scaarup Jeg har testet det, første fejl kom af at: linje: 493 skulle ændres fra: "childFilter": userid, til "childFilter": [userid],
ellers ville den ikke lave kaldet, da det skal være en array.
derefter kommer den med denne
2024-02-12 08:47:27.772 ERROR (MainThread) [custom_components.aula.sensor] Unexpected error fetching sensor data: can only concatenate str (not "NoneType") to str
som kommer herfra tænker jeg:
for i in ugeplaner.json()["Events"]:
For den herfra:
`Unexpected error fetching sensor data: can only concatenate str (not "NoneType") to str Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 313, in _async_refresh self.data = await self._async_update_data() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 269, in _async_update_data return await self.update_method() ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/aula/sensor.py", line 60, in async_update_data await hass.async_add_executor_job(client.update_data) File "/usr/local/lib/python3.12/concurrent/futures/thread.py", line 58, in run result = self.fn(*self.args, **self.kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/aula/client.py", line 680, in update_data ugeplan(thisweek, "this") File "/config/custom_components/aula/client.py", line 508, in ugeplan _ugep = "
TypeError: can only concatenate str (not "NoneType") to str`
@ethante okay, prøv igen.
Det virkede meget bedre :D MEN.....
jeg for ikke fejl men intet er der:
bruger denne:
'{{ state_attr("sensor.resen_skole_lykke", "ugeplan") }}'
har ændret week til at være en med mange opgaver i, bare så jeg viste der kom sager :)
Okay :) Så må vi hellere lige se den fulde debug log.
2024-02-12 12:41:52.627 DEBUG (SyncWorker_10) [custom_components.aula.client] EasyIQ post data {'sessionId': 'XXXXXXXX', 'currentWeekNr': '2024-W06', 'userProfile': 'guardian', 'institutionFilter': ['779006'], 'childFilter': ['XXXXXXXX']} 2024-02-12 12:41:52.969 DEBUG (SyncWorker_10) [custom_components.aula.client] EasyIQ Opgaver status_code 200 2024-02-12 12:41:52.970 DEBUG (SyncWorker_10) [custom_components.aula.client] EasyIQ Opgaver response {"fromDate":"2024-02-05T00:00:00","toDate":"2024-02-10T00:00:00","images":null,"WeekPlan":{"Id":399696,"ActivityId":1126108,"ActivityName":"4a","Year":2024,"WeekNo":6,"Text":"","RawHtml":"","Visible":true,"TextId":"182675bb-6063-452d-9ffb-cec763d7bfde"},"otherweekplans":[],"Events":[{"itemid":8578504,"IconId":null,"ownerunilogin":"lene1969","updatedbyunilogin":"lene1969","ownername":"Lene XXXXXXXX","updatedbyname":"Lene XXXXXXXX","ownerid":538615,"visibility":3,"start":"2024/02/06 08:00","end":"2024/02/06 08:45","isAllDay":false,"canEdit":false,"diffCount":0,"title":" ","chapterTitle":null,"color":"#43A6DF","darkerColor":null,"itemurl":"","icon":"~\\Images\\Plan\\svg\\open-book.svg","itemType":8,"description":"Drengene læser kapitel 13 og 14","RecurrencyTypeId":0,"RecurrencyStartDate":null,"RecurrencyEndDate":null,"recurringItemId":null,"IsSeries":false,"IsInstanceOfSeries":false,"ActivityIds":[1126108],"ActivityIdsCopy":null,"activities":"4a","CourseIds":[],"CourseIdsCopy":null,"courses":"","Private":false,"isFirstLineEmpty":false,"timeCreated":"2024-02-01T11:33:21.253","timeUpdated":"2024-02-04T20:18:48.717","updatedby":538615,"Action":null,"Controller":null,"ActionParameters":null,"HtmlObject":null,"objectId":"f1bc5167-747f-48d7-93ab-3b1debbaa731","extensiondata":null,"plans":null,"planIds":"","prId":null,"isClassroom":false},{"itemid":8601258,"IconId":null,"ownerunilogin":"lene1969","updatedbyunilogin":"lene1969","ownername":"Lene XXXXXXXX","updatedbyname":"Lene XXXXXXXX","ownerid":538615,"visibility":3,"start":"2024/02/06 08:00","end":"2024/02/06 08:45","isAllDay":false,"canEdit":false,"diffCount":0,"title":" ","chapterTitle":null,"color":"rgb(255, 106, 0)","darkerColor":null,"itemurl":"","icon":"~\\Images\\Plan\\svg\\open-book.svg","itemType":8,"description":"<p>Ugens talemåde: \"At have ild i røven\".</p><p>Skriv en sætning med talemåden derhjemme til på fredag - tal om, hvad det betyder (måske nogle i 4.a har ild i røven :)</p>","RecurrencyTypeId":0,"RecurrencyStartDate":null,"RecurrencyEndDate":null,"recurringItemId":null,"IsSeries":false,"IsInstanceOfSeries":false,"ActivityIds":[1126108],"ActivityIdsCopy":null,"activities":"4a","CourseIds":[],"CourseIdsCopy":null,"courses":"","Private":false,"isFirstLineEmpty":false,"timeCreated":"2024-02-06T08:40:42.447","timeUpdated":"2024-02-06T18:17:01.9","updatedby":538615,"Action":null,"Controller":null,"ActionParameters":null,"HtmlObject":null,"objectId":"10955aa8-6f1d-4dfa-992d-d1ddc5e3f6a1","extensiondata":null,"plans":null,"planIds":"","prId":null,"isClassroom":false},{"itemid":8601264,"IconId":null,"ownerunilogin":"lene1969","updatedbyunilogin":null,"ownername":"Lene XXXXXXXX","updatedbyname":null,"ownerid":538615,"visibility":3,"start":"2024/02/08 08:00","end":"2024/02/08 08:45","isAllDay":false,"canEdit":false,"diffCount":0,"title":" ","chapterTitle":null,"color":"#43A6DF","darkerColor":null,"itemurl":"","icon":"~\\Images\\Plan\\svg\\open-book.svg","itemType":8,"description":"Drengene og pigerne læser bogen færdig til torsdag. Husk at medbringe bogen, da den skal afleveres tilbage til CFU. ","RecurrencyTypeId":0,"RecurrencyStartDate":null,"RecurrencyEndDate":null,"recurringItemId":null,"IsSeries":false,"IsInstanceOfSeries":false,"ActivityIds":[1126108],"ActivityIdsCopy":null,"activities":"4a","CourseIds":[],"CourseIdsCopy":null,"courses":"","Private":false,"isFirstLineEmpty":false,"timeCreated":"2024-02-06T08:42:39.697","timeUpdated":null,"updatedby":null,"Action":null,"Controller":null,"ActionParameters":null,"HtmlObject":null,"objectId":"7b6246cc-22d1-4559-9174-6865d5eab3cb","extensiondata":null,"plans":null,"planIds":"","prId":null,"isClassroom":false},{"itemid":8603300,"IconId":null,"ownerunilogin":"lene1969","updatedbyunilogin":null,"ownername":"Lene XXXXXXXX","updatedbyname":null,"ownerid":538615,"visibility":3,"start":"2024/02/09 08:00","end":"2024/02/09 08:45","isAllDay":false,"canEdit":false,"diffCount":0,"title":" ","chapterTitle":null,"color":"rgb(255, 0, 0)","darkerColor":null,"itemurl":"","icon":"~\\Images\\Plan\\svg\\open-book.svg","itemType":8,"description":"<p>Ugens talemåde: \"At have ild i røven\".</p><p>Skriv en sætning med talemåden derhjemme - tal om, hvad det betyder (måske nogle i 4.a har ild i røven :)</p>","RecurrencyTypeId":0,"RecurrencyStartDate":null,"RecurrencyEndDate":null,"recurringItemId":null,"IsSeries":false,"IsInstanceOfSeries":false,"ActivityIds":[1126108],"ActivityIdsCopy":null,"activities":"4a","CourseIds":[],"CourseIdsCopy":null,"courses":"","Private":false,"isFirstLineEmpty":false,"timeCreated":"2024-02-06T18:17:40.99","timeUpdated":null,"updatedby":null,"Action":null,"Controller":null,"ActionParameters":null,"HtmlObject":null,"objectId":"139b72bd-5d6e-48ba-84f1-4e79db77b163","extensiondata":null,"plans":null,"planIds":"","prId":null,"isClassroom":false},{"itemid":726181,"IconId":null,"ownerunilogin":null,"updatedbyunilogin":null,"ownername":null,"updatedbyname":null,"ownerid":381754,"visibility":0,"start":"2024-01-29T00:00:00.0000000","end":"2024-02-12T00:00:00.0000000","isAllDay":null,"canEdit":false,"diffCount":0,"title":"Skema, aktivitetskalender og Skolekalender","chapterTitle":null,"color":"#FF6666","darkerColor":null,"itemurl":"%7B%22route%22%3Anull%2C%22controller%22%3A%22Chapter%22%2C%22action%22%3A%22Index%22%2C%22params%22%3A%7B%22planId%22%3A%22726181%22%2C%22chapterId%22%3A%22-1%22%7D%2C%22child%22%3A%22XXXXXXXX%22%7D","icon":"~/Images/Plan/svg/clock.svg","itemType":5,"description":null,"RecurrencyTypeId":0,"RecurrencyStartDate":null,"RecurrencyEndDate":null,"recurringItemId":null,"IsSeries":false,"IsInstanceOfSeries":false,"ActivityIds":[],"ActivityIdsCopy":null,"activities":null,"CourseIds":[],"CourseIdsCopy":null,"courses":null,"Private":false,"isFirstLineEmpty":false,"timeCreated":null,"timeUpdated":null,"updatedby":null,"Action":null,"Controller":null,"ActionParameters":null,"HtmlObject":null,"objectId":null,"extensiondata":null,"plans":null,"planIds":"","prId":null,"isClassroom":false},{"itemid":746491,"IconId":null,"ownerunilogin":null,"updatedbyunilogin":null,"ownername":null,"updatedbyname":null,"ownerid":381754,"visibility":0,"start":"2024-01-29T00:00:00.0000000","end":"2024-02-12T00:00:00.0000000","isAllDay":null,"canEdit":false,"diffCount":0,"title":"Møder mm.","chapterTitle":null,"color":"#B200FF","darkerColor":null,"itemurl":"%7B%22route%22%3Anull%2C%22controller%22%3A%22Chapter%22%2C%22action%22%3A%22Index%22%2C%22params%22%3A%7B%22planId%22%3A%22746491%22%2C%22chapterId%22%3A%22-1%22%7D%2C%22child%22%3A%22XXXXXXXX%22%7D","icon":"~\\Images\\Plan\\svg\\child-safe-zone.svg","itemType":5,"description":null,"RecurrencyTypeId":0,"RecurrencyStartDate":null,"RecurrencyEndDate":null,"recurringItemId":null,"IsSeries":false,"IsInstanceOfSeries":false,"ActivityIds":[],"ActivityIdsCopy":null,"activities":null,"CourseIds":[],"CourseIdsCopy":null,"courses":null,"Private":false,"isFirstLineEmpty":false,"timeCreated":null,"timeUpdated":null,"updatedby":null,"Action":null,"Controller":null,"ActionParameters":null,"HtmlObject":null,"objectId":null,"extensiondata":null,"plans":null,"planIds":"","prId":null,"isClassroom":false}],"groups":[],"group":null,"weekinfo":{"currentweeknr":"Uge 6","prevweeknr":"2024-W05","nextweeknr":"2024-W07","weekstartdate":"2024-02-05T00:00:00","weekenddate":"2024-02-10T00:00:00","todaysweeknr":"2024-W07"},"notifications":{"latestview":"2024-01-29T07:05:54.88","notificationlist":[{"sender":{"fullname":"Mette Johannesen","familyname":"Johannesen","givenname":"Mette","unilogin":"mett1022","loginid":381732,"logintypeid":2},"reciever":{"fullname":"Mette Johannesen","familyname":"Johannesen","givenname":"Mette","unilogin":"mett1022","loginid":381732,"logintypeid":2},"target":{"fullname":"Liva Marie Stærdahl Søndergaard","familyname":"XXXXXX","givenname":"Liva Marie Stærdahl","unilogin":"liva4710","loginid":2437106,"logintypeid":1},"url":"Overblik/172872","timestamp":"2024-01-15T11:32:28.137","read":false,"message":null,"Age":"00:00:00","notificationtypeid":1,"notificationtype":null,"data":[],"viewed":true},{"sender":{"fullname":"Mette Johannesen","familyname":"Johannesen","givenname":"Mette","unilogin":"mett1022","loginid":381732,"logintypeid":2},"reciever":{"fullname":"Mette Johannesen","familyname":"Johannesen","givenname":"Mette","unilogin":"mett1022","loginid":381732,"logintypeid":2},"target":{"fullname":"Lykke Anna Stærdahl Søndergaard","familyname":"Søndergaard","givenname":"Lykke Anna Stærdahl","unilogin":"XXXXXXXX","loginid":1001246,"logintypeid":1},"url":"Overblik/120899","timestamp":"2023-05-30T08:46:13.41","read":true,"message":null,"Age":"00:00:00","notificationtypeid":1,"notificationtype":null,"data":[],"viewed":true}],"hasmore":false},"weekplanconfiguration":{"showplans":true,"narrowview_showplans":true,"showweekplanitemplanner":false,"usehtmlwidget":true},"links":[{"name":"Skoleportal","address":"https://skoleportal.easyiqcloud.dk","ssoenable":true},{"name":"Meddelelsesbog","address":"https://skoleportal.easyiqcloud.dk/elevplan","ssoenable":true}],"widgetlink":0} 2024-02-12 12:41:52.973 DEBUG (SyncWorker_10) [custom_components.aula.client] EasyIQ result: <h2>None</h2>None 2024-02-12 12:41:52.973 DEBUG (SyncWorker_10) [custom_components.aula.client] EasyIQ headers {'x-aula-institutionfilter': '779006', 'x-aula-userprofile': 'guardian', 'Authorization': 'Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImtpZCI6ImFlZTg0OTYwOTg3MDRkNjFlNWI4ZmYyNWJmZGQxNDJhZjkzZjE2YjAifQ.eyJpc3MiOiJBdWxhIiwiaWF0IjoxNzA3NzM4MTEyLjU5NDE1OSwiYXVkIjoiMDAwMSIsIkFzc3VyYW5jZUxldmVsIjoyLCJpc1BpbG90IjpmYWxzZSwiZXhwIjoxNzA3NzQxNzA5LCJqdGkiOiI2NWM5ZmE2Yzc1Yjk4My40NzczMzkyOCIsInN1YiI6ImFuZGUyOWY1In0.IdfnOCcvop-GKoA-hSYuxczCB-Z0GZJxQ-rrEyCf-JibxCuaKYcXHm0Gbo14F8qyywoaLau71uyWfD5rB4KdO4hd9TS1S2HyZKzzB2bjLTCZwBa6XFkA3jp5LLMutK_wLLBBOWxlDdRalTXebEumvBSUWMAp4RPlianjStA0_2GLxOIJVYgbQaRlLcpbo1Hgtiu4899eMBSLSy1RfojchqZXW-fhNljT8ohxu0jK8Ky_YxvxMPEv65NHU8bqld7R-kM8nhF1HLWW6HBdjb3WvYs8c-94xfPcYejyMz3bZY_FN_M9AuJsudrL6uUPRl3_GYXC9PizCc58JGymcRmShgTtuVlWZFwmFF3LpoSWYIUYI6rTB1LRYXHP6SiExUW4myoUWxn8TJTmwRMik5VkzMAxbL2LqLRw6y9LdLJ-H3jGjbNIS-JjyBnJfaU-cFM6nXAs0yZzp1LhJm0zAzH_Al5A0sls-bz-8qFiv8TRC8xWszHQ2VV1bqVK385XoRLV', 'accept': 'application/json', 'csrfp-token': 'e315004436c34141c370b981d83381ba', 'origin': 'https://www.aula.dk', 'referer': 'https://www.aula.dk/', 'authority': 'api.easyiqcloud.dk'} 2024-02-12 12:41:52.974 DEBUG (SyncWorker_10) [custom_components.aula.client] EasyIQ post data {'sessionId': 'XXXXXXXX', 'currentWeekNr': '2024-W06', 'userProfile': 'guardian', 'institutionFilter': ['779006'], 'childFilter': ['liva4710']} 2024-02-12 12:41:53.325 DEBUG (SyncWorker_10) [custom_components.aula.client] EasyIQ Opgaver status_code 200 2024-02-12 12:41:53.325 DEBUG (SyncWorker_10) [custom_components.aula.client] EasyIQ Opgaver response {"fromDate":"2024-02-05T00:00:00","toDate":"2024-02-10T00:00:00","images":null,"WeekPlan":{"Id":0,"ActivityId":0,"ActivityName":null,"Year":0,"WeekNo":0,"Text":"","RawHtml":null,"Visible":false,"TextId":"00000000-0000-0000-0000-000000000000"},"otherweekplans":[],"Events":[],"groups":[],"group":null,"weekinfo":{"currentweeknr":"Uge 6","prevweeknr":"2024-W05","nextweeknr":"2024-W07","weekstartdate":"2024-02-05T00:00:00","weekenddate":"2024-02-10T00:00:00","todaysweeknr":"2024-W07"},"notifications":{"latestview":"2024-01-29T07:05:54.88","notificationlist":[{"sender":{"fullname":"Mette Johannesen","familyname":"Johannesen","givenname":"Mette","unilogin":"mett1022","loginid":381732,"logintypeid":2},"reciever":{"fullname":"Mette Johannesen","familyname":"Johannesen","givenname":"Mette","unilogin":"mett1022","loginid":381732,"logintypeid":2},"target":{"fullname":"Liva XXXXXXXX","familyname":"Søndergaard","givenname":"Liva xxxxxxx","unilogin":"XXXXXXXX","loginid":2437106,"logintypeid":1},"url":"Overblik/172872","timestamp":"2024-01-15T11:32:28.137","read":false,"message":null,"Age":"00:00:00","notificationtypeid":1,"notificationtype":null,"data":[],"viewed":true},{"sender":{"fullname":"Mette xxxxxxx","familyname":"xxxxxxn","givenname":"Mette","unilogin":"mettxxxxx","loginid":381732,"logintypeid":2},"reciever":{"fullname":"Mette XXXXXX","familyname":"xxxxxxxn","givenname":"Mette","unilogin":"mettxxxxxx","loginid":381xxxx,"logintypeid":2},"target":{"fullname":"Lykke xxxxxxxx","familyname":"Sxxxxx","givenname":"Lykke","unilogin":"lyxxxxxx","loginid":1001246,"logintypeid":1},"url":"Overblik/120899","timestamp":"2023-05-30T08:46:13.41","read":true,"message":null,"Age":"00:00:00","notificationtypeid":1,"notificationtype":null,"data":[],"viewed":true}],"hasmore":false},"weekplanconfiguration":{"showplans":true,"narrowview_showplans":true,"showweekplanitemplanner":false,"usehtmlwidget":true},"links":[{"name":"Skoleportal","address":"https://skoleportal.easyiqcloud.dk","ssoenable":true},{"name":"Meddelelsesbog","address":"https://skoleportal.easyiqcloud.dk/elevplan","ssoenable":true}],"widgetlink":0} 2024-02-12 12:41:53.326 DEBUG (SyncWorker_10) [custom_components.aula.client] EasyIQ result: 2024-02-12 12:41:53.336 DEBUG (MainThread) [custom_components.aula.sensor] Finished fetching sensor data in 4.319 seconds (success: True) 2024-02-12 12:42:11.013 DEBUG (SyncWorker_59) [custom_components.aula.calendar] Updating calendars... 2024-02-12 12:42:11.031 DEBUG (SyncWorker_59) [custom_components.aula.calendar] Parsing skoleskema.json... 2024-02-12 12:42:11.064 DEBUG (SyncWorker_33) [custom_components.aula.calendar] Updating calendars... 2024-02-12 12:42:11.080 DEBUG (SyncWorker_33) [custom_components.aula.calendar] Parsing skoleskema.json... 2024-02-12 12:46:10.694 DEBUG (SyncWorker_40) [custom_components.aula.binary_sensor] There are NO unread messages
@ethante jeg har lige pushet en ny version. Havde fucket noget up
2024-02-12 14:13:57.372 ERROR (MainThread) [custom_components.aula.sensor] Unexpected error fetching sensor data: 'Weekplan'
`Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 313, in _async_refresh self.data = await self._async_update_data() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 269, in _async_update_data return await self.update_method() ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/aula/sensor.py", line 60, in async_update_data await hass.async_add_executor_job(client.update_data) File "/usr/local/lib/python3.12/concurrent/futures/thread.py", line 58, in run result = self.fn(*self.args, **self.kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/aula/client.py", line 677, in update_data ugeplan(thisweek, "this") File "/config/custom_components/aula/client.py", line 505, in ugeplan
KeyError: 'Weekplan'`
Okay, der er endnu en ny version.
2024-02-12 19:30:56.657 WARNING (SyncWorker_4) [homeassistant.loader] We found a custom integration aula which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2024-02-12 19:32:17.010 ERROR (MainThread) [custom_components.aula.sensor] Unexpected error fetching sensor data: Logger.debug() missing 1 required positional argument: 'msg'
File "/config/custom_components/aula/sensor.py", line 60, in async_update_data
File "/config/custom_components/aula/client.py", line 680, in update_data
File "/config/custom_components/aula/client.py", line 499, in ugeplan
2024-02-12 19:32:19.311 ERROR (MainThread) [homeassistant.components.sensor] Error while setting up aula platform for sensor
File "/config/custom_components/aula/sensor.py", line 75, in async_setup_entry
File "/config/custom_components/aula/client.py", line 680, in update_data
File "/config/custom_components/aula/client.py", line 499, in ugeplan
2024-02-12 19:32:20.859 WARNING (MainThread) [homeassistant.components.homekit] Cannot add binary_sensor.aula_aulamessage as this would exceed the 150 device limit. Consider using the filter option
2024-02-12 19:37:02.972 DEBUG (SyncWorker_6) [custom_components.aula.client] EasyIQ post data {'sessionId': 'xxxxxx', 'currentWeekNr': '2024-W06', 'userProfile': 'guardian', 'institutionFilter': ['779006'], 'childFilter': ['xxxxx']} 2024-02-12 19:37:03.307 ERROR (MainThread) [custom_components.aula.sensor] Unexpected error fetching sensor data: Logger.debug() missing 1 required positional argument: 'msg' File "/config/custom_components/aula/sensor.py", line 60, in async_update_data File "/config/custom_components/aula/client.py", line 680, in update_data File "/config/custom_components/aula/client.py", line 499, in ugeplan 2024-02-12 19:37:03.361 DEBUG (MainThread) [custom_components.aula.sensor] Finished fetching sensor data in 6.159 seconds (success: False)
2024-02-12 19:37:04.500 DEBUG (SyncWorker_18) [custom_components.aula.client] EasyIQ post data {'sessionId': 'xxxxx', 'currentWeekNr': '2024-W06', 'userProfile': 'guardian', 'institutionFilter': ['779006'], 'childFilter': ['xxxxx']} 2024-02-12 19:37:04.859 ERROR (MainThread) [homeassistant.components.sensor] Error while setting up aula platform for sensor File "/config/custom_components/aula/sensor.py", line 75, in async_setup_entry File "/config/custom_components/aula/client.py", line 680, in update_data File "/config/custom_components/aula/client.py", line 499, in ugeplan
Du var lige lidt for hurtig. Der kom en rettelse.
SÅ! Kom der sgu noget på :-) Dog kun på knægtens, tjekker lige om der er noget på 'den rigtige' AULA
Sønnens viste hvad der stod i AULA, det samme med datterens, nemlig ... intet, som i nada, tom, blank stykke papir. Så det er som det skal være.
Godt gået :-) @scaarup @ethante Det virker til at virke ;-)
Godt gået :-) @scaarup @ethante Det virker til at virke ;-)
Nå for dælen, det lyder lovende :)
@scaarup kan det lade sig gøre at convertere datetime på de enkelte opgaver i events til en dag eksempel mandag eller tirsdag efter som den ser sådan her ud:
Hvad er det for tidsstempler, der skal konverteres @ethante ? Jeg kan ikke lige se dem på dit screenshot.
Hej @scaarup Her er hvad jeg umiddelbart synes giver mening ... De er highlighted på billederne, hvis nu jeg er helt galt på den, kan du måske se hvilke jeg skal bruge ;-)
curl "https://www.youtube.com/s/player/6ee8f9ce/www-widgetapi.vflset/www-widgetapi.js" ^ -H "sec-ch-ua: ^\^"Not_A Brand^\^";v=^\^"8^\^", ^\^"Chromium^\^";v=^\^"120^\^", ^\^"Google Chrome^\^";v=^\^"120^\^"" ^ -H "Referer: https://skoleportal.easyiqcloud.dk/" ^ -H "DNT: 1" ^ -H "sec-ch-ua-mobile: ?0" ^ -H "User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36" ^ -H "sec-ch-ua-platform: ^\^"Windows^\^"" ^ --compressed
Svarende til AULA_1 & 2curl "https://api.easyiqcloud.dk/api/aula/weekinfo" ^ -X "OPTIONS" ^ -H "authority: api.easyiqcloud.dk" ^ -H "accept: */*" ^ -H "accept-language: da-DK,da;q=0.9,en-DK;q=0.8,en;q=0.7,en-US;q=0.6" ^ -H "access-control-request-headers: authorization,content-type,csrfp-token,x-aula-institutionfilter,x-aula-userprofile" ^ -H "access-control-request-method: POST" ^ -H "origin: https://www.aula.dk" ^ -H "referer: https://www.aula.dk/" ^ -H "sec-fetch-dest: empty" ^ -H "sec-fetch-mode: cors" ^ -H "sec-fetch-site: cross-site" ^ -H "user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36" ^ --compressed
er fra 3 & 4
AULA_.integration.txt
![AULA_4](https://github.com/scaarup/aula/assets/56511121/704eff13-1f3b-4cac-bcc0-99974cdf265c)