Skip to content

v3.2.0 — New mobile API, dynamic sub-sensors, clean data

Choose a tag to compare

@claesmathias claesmathias released this 01 Jun 20:10
· 5 commits to main since this release

Breaking change notice

Mobile sensor entity IDs are unchanged — the plan labels (Unlimited, Data SIM Unlimited) are preserved. The underlying API has been completely replaced; no configuration changes needed.


What's new

New mobile API (customer-web-billing)

The integration now uses the same API as the Telenet web app:

Old endpoint New endpoint
/mobile-service/v3/mobilesubscriptions/{id}/usages /customer-web-billing-mobile-usage/v1/mobile-lines/{msisdn}/usage
/product-service/v1/product-subscriptions?producttypes=MOBILE /customer-web-billing-mobile-line-selector/v1/mobile-lines

Benefits:

  • No more Cloudflare 429 / bot-detection errors that caused sensors to go Unknown
  • Consumed / remaining / total / percentage returned directly — no complex bundle/shared/included parsing
  • isDataOnly flag comes from the API (no more guessing from voice data presence)
  • Voice minutes and SMS count in a clean tiles[] array
  • ~100 lines of fragile parsing code removed

Mobile sensor attributes (per subscription)

Attribute Example
usage_gb 64.13 GB
used_percentage_data 21.4 %
max_data_gb 300 GB
data_unlimited true (FUP plan)
period_days_left 10.1
voice_used_minutes 50.8 min
voice_unlimited true
has_voice false for data-only SIMs
last_update_formatted 22:06 on 1 Jun

Dynamic sub-sensor entities (per SIM, auto-created)

Five separate HA entities are created automatically for every mobile subscription — no configuration.yaml needed:

  • … days left (days until billing period resets)
  • … max data (GB cap, e.g. 300)
  • … usage %
  • … voice used (minutes; None for data-only SIMs)
  • … last update

Bug fixes

  • callTelenet no longer crashes with UnboundLocalError when a network error occurs before any response is received
  • response is not None guard added to all retry-enabled API methods

Tests

New tests/test_usage_report.py — live integration test that logs in and prints a full usage report table for all products. All 6 tests pass against the live API.