Home Assistant integration for Leitir, Iceland's public library system. Track your library loans, see due dates, and renew books directly from Home Assistant.
- Loan tracking: See all your active library loans as sensors
- Due date monitoring: Get the next due date across all loans
- Renewable count: Know how many items can be renewed
- Multi-account support: Add multiple library accounts
- Services: Renew individual loans or all renewable items at once
| Sensor | Description |
|---|---|
sensor.leitir_<account>_loans |
Total number of active loans (loan details in attributes) |
sensor.leitir_<account>_renewable |
Count of loans that can be renewed |
sensor.leitir_<account>_next_due |
Earliest due date among all loans |
sensor.leitir_<account>_loan_<title> |
Individual sensor per loan with details |
| Service | Description |
|---|---|
leitir.renew_loan |
Renew a specific loan by ID |
leitir.renew_all |
Renew all renewable loans for an account |
leitir.refresh |
Force an immediate data refresh |
- Open HACS in your Home Assistant instance
- Click the three dots in the top right corner
- Select "Custom repositories"
- Add
https://github.com/axelpaul/leitir-hawith category "Integration" - Click "Install"
- Restart Home Assistant
- Download the latest release from GitHub
- Copy the
custom_components/leitirfolder to your Home Assistantconfig/custom_components/directory - Restart Home Assistant
- Go to Settings > Devices & Services
- Click Add Integration
- Search for "Leitir"
- Enter your Leitir credentials:
- Account name: A friendly name for this account
- Username: Your Leitir username
- Password: Your Leitir password
- Click Submit
After setup, you can configure refresh times:
- Go to the Leitir integration
- Click Configure
- Set custom refresh times (comma-separated, e.g.,
08:00, 18:00)
By default, the integration refreshes at 18:00 daily.
automation:
- alias: "Library book due reminder"
trigger:
- platform: template
value_template: >
{{ (as_timestamp(states('sensor.leitir_myaccount_next_due')) - as_timestamp(now())) < 86400 }}
action:
- service: notify.mobile_app
data:
title: "Library Reminder"
message: "You have a book due tomorrow!"automation:
- alias: "Auto renew library books"
trigger:
- platform: time
at: "09:00:00"
condition:
- condition: numeric_state
entity_id: sensor.leitir_myaccount_renewable
above: 0
action:
- service: leitir.renew_all
data:
entry_id: "{{ config_entry_id('sensor.leitir_myaccount_loans') }}"A complete Lovelace dashboard example is available in examples/dashboard.yaml. It includes:
- Summary cards showing total loans, books vs games, renewable count, due soon, and overdue items
- Quick action buttons for renewing all loans and refreshing data
- Auto-generated loan list sorted by due date with color-coded status indicators
Required custom cards (available via HACS):
If you encounter issues, please open an issue on GitHub.
This project is licensed under the MIT License - see the LICENSE file for details.
