The leap-card login page has changed and requires Microsoft authentication to access the site.
Unfortunately and disappointingly Leap still haven't provided a public API either, so it's no longer a straightforward process.
Display Transport For Ireland (TFI) Leap Card balance in Home Assistant
- Add leap_sensor files to /config/custom_components/leap_sensor folder
- Add Leap Card credentials to configuration.yaml
- platform: leap_sensor
name: 'My Leap Card Balance' # Optional, defaults to 'Leap Card Balance'
username: 'username' # Required
password: 'password' # Required
(or better, password: !secret leap_pw)
- This sensor uses an updated version of PyLeapCard by @skhg (https://github.com/skhg/pyleapcard).
- Limitations of PyLeapCard apply, for example only the first registered card will be displayed in HA.
- Multiple Leap Cards can be included in Home Assistant by using multiple copies of the 'leap_sensor' platform in configuration.yaml, just change the credentials.
- This module runs an update every 5 minutes. On HA load, it will show 'Unknown' until 5 minutes have passed. This allows HA to stabilise before pulling data from TFI.
- Don't forget to setup automations! Example below for Low Balance, but an increase of balance (i.e. top-up) could be done!
- alias: Leap Balance
initial_state: true
trigger:
platform: numeric_state
entity_id: sensor.leap_card_balance
below: 5
action:
- service: notify.ios_iphone
data:
title: "Leap: Balance Alert"
message: "Balance Low!"