DSB Mobile - substitution plan into Home Assistant

Hi,

My sons school has an online platform for the substitution plan www.dsbmobile.de.
My plan was to get the data for this plan into home assistant, i found this API on github DSB API and was able to get data for his class with this python script:

import dsbapi

dsbclient = dsbapi.DSBApi("Kennung", "Passwort")
entries = dsbclient.fetch_entries()

for s in range(len(entries)):
  for i in range(len(entries[s])):
    entry = entries[s][i]
    if entry["lesson"] == "06D":
        print("date:", entry.get("date", "n/a"))
        print("day:", entry.get("day", "n/a"))
        print("type:", entry.get("type", "n/a"))
        print("class:", entry.get("class", "n/a"))
        print("lesson:", entry.get("lesson", "n/a"))
        print("subject:", entry.get("subject", "n/a"))
        print("room:", entry.get("room", "n/a"))
        print("new_subject:", entry.get("new_subject", "n/a"))
        print("new_teacher:", entry.get("new_teacher", "n/a"))
        print("teacher:", entry.get("teacher", "n/a"))
        print("col8:", entry.get("col8", "n/a"))
        print("col9:", entry.get("col9", "n/a"))
        print("\n")

The outcome of this was:

date: 14.2.2023
day: Dienstag
type: KRIE
class: 5
lesson: 06D
subject: MU
room: ---
new_subject: KRIE
new_teacher: MU
teacher: 06D
col8: A106
col9: Entfall


date: 14.2.2023
day: Dienstag
type: KRIE
class: 6
lesson: 06D
subject: MU
room: ---
new_subject: KRIE
new_teacher: MU
teacher: 06D
col8: A112
col9: Entfall


date: 10.2.2023
day: Freitag
type: HOEC
class: 1 - 2
lesson: 06D
subject: M
room: ---
new_subject: HOEC
new_teacher: M
teacher: 06D
col8: A005
col9: Entfall

But i have no idea how i could now implement this to Home Assistant.
Can someone advise me how to achieve this?

Maybe this is also interesting for other people as DSB Mobile seems to be used for several schools in Germany.

1 Like

Hi @groxxi ,
our son’s school in Hamburg is using the same app. Did you make it to include the information onto the dashboard?

Regards
Jörg