跳到正文
DEV Community· Sythos·· 2 小時前AI 評分43

CVV Dashboard:從 ClasseViva 到 Home Assistant 的儀錶板實作架構

From ClasseViva to Home Assistant: a dashboard architecture in practice / Da ClasseViva a Home Assistant: architettura di una dashboard in pratica

AI 導讀

CVV Dashboard 透過 Home Assistant 整合及 Lovelace 卡片,將 ClasseViva 的成績、公告訊息、日程及功課等校務資訊集中到儀錶板。卡片支援多種檢視,並為每名學生提供四個用途各異的日曆;過往學年資料可按需載入並快取 30 分鐘。項目要求 Home Assistant 2024.7.0 或更新版本及 HACS,卡片隨整合自動載入。

正文
English Italiano

The challenge

ClasseViva presents school information across different screens. CVV Dashboard brings averages, grades, noticeboard messages, agenda events, teacher annotations, published reports and homework into Home Assistant.

The project has two parts: a Home Assistant integration that exposes the data, and a Lovelace card that presents it. The card discovers the integration’s entities automatically, so its configuration does not need a manually copied entity_id.

Il problema

ClasseViva distribuisce le informazioni scolastiche su schermate diverse. CVV Dashboard le raccoglie in Home Assistant: medie, voti, comunicazioni in bacheca, agenda, annotazioni dei docenti, scrutini pubblicati e compiti.

Il progetto ha due componenti: un’integrazione Home Assistant che espone i dati e una card Lovelace che li presenta. La card rileva automaticamente le entità dell’integrazione, senza dover copiare a mano gli entity_id nella configurazione.

One card, several views

The card can show averages, grades, the noticeboard, agenda, notes, reports, homework or a combined view. This keeps the YAML configuration consistent while allowing a dashboard to focus on one kind of information at a time.

The average view can show the overall average and school periods. The grade view includes subject averages and recent grades; noticeboard messages can show formatted text and attachments.

Una card, più viste

La card può mostrare medie, voti, bacheca, agenda, note, scrutini, compiti oppure una vista combinata. La configurazione YAML resta coerente e la dashboard può concentrarsi su un tipo di informazione alla volta.

La vista delle medie mostra la media generale e i periodi scolastici. Quella dei voti include medie per materia e voti recenti; nella bacheca le comunicazioni possono mostrare testo formattato e allegati.

Calendars stay separate

Each student gets four Home Assistant calendars:

  • Agenda: a summary of homework and annotations.
  • Homework: assigned work only.
  • Teacher notes: annotations, alerts and virtual classrooms.
  • Room bookings: classroom reservations only.

Keeping them separate makes each calendar independently selectable and colour-coded in Home Assistant.

I calendari restano distinti

Per ogni studente Home Assistant riceve quattro calendari:

  • Agenda: riepilogo di compiti e annotazioni.
  • Compiti: solo i compiti assegnati.
  • Note dei docenti: annotazioni, avvisi e aule virtuali.
  • Prenotazioni aula: solo le prenotazioni delle aule.

Separarli permette di selezionare ogni calendario indipendentemente e di assegnargli un colore in Home Assistant.

School years without duplicate accounts

The card has a school-year selector. When data for a year is not already configured, it can fetch that year on demand using the active login and cache the result for 30 minutes. This makes it possible to browse previous years without adding the same account again just for that purpose.

The automatic option follows the school year, which runs from September 1 to August 31. The first load of a past year can take a few seconds.

Anni scolastici senza duplicare gli account

La card offre un selettore dell’anno scolastico. Se i dati di un anno non sono già configurati, può recuperarli al momento riutilizzando il login attivo e conservarli in cache per 30 minuti. Così si possono consultare gli anni passati senza aggiungere di nuovo lo stesso account.

L’opzione automatica segue l’anno scolastico, dal 1° settembre al 31 agosto. Il primo caricamento di un anno passato può richiedere qualche secondo.

Multiple students and Home Assistant layouts

A dashboard can select which student accounts to show, set their order and use custom display names. The same card can also be placed in a Lovelace Panorama view; separate cards can sit side by side when a household wants to compare different views or students.

The project requires Home Assistant 2024.7.0 or later and HACS. The Lovelace card is included with the integration and loads automatically.

Più studenti e layout Home Assistant

La dashboard può scegliere quali account mostrare, in quale ordine e con quali nomi visualizzati. La card si può usare anche in una vista Lovelace Panorama; card separate possono stare affiancate per mostrare viste o studenti diversi.

Il progetto richiede Home Assistant 2024.7.0 o successivo e HACS. La card Lovelace è inclusa nell’integrazione e viene caricata automaticamente.

Project scope

CVV Dashboard is an independent project and is not affiliated with or supported by Gruppo Spaggiari. Its documentation describes access to the signed-in user’s own ClasseViva account; the Home Assistant integration stores the account password there.

Technical reference: source code and README

This article was prepared with AI assistance and checked against the project documentation.

Ambito del progetto

CVV Dashboard è un progetto indipendente, non affiliato né supportato da Gruppo Spaggiari. La documentazione descrive l’accesso ai dati dell’account ClasseViva dell’utente autenticato; l’integrazione Home Assistant salva lì la password dell’account.

Riferimento tecnico: codice sorgente e README

Questo articolo è stato preparato con l’assistenza dell’AI e verificato rispetto alla documentazione del progetto.

來源:DEV Community · dev.to