Skip to content

myTselection/orange

Repository files navigation

hacs_badge GitHub release GitHub repo size

GitHub issues GitHub last commit GitHub commit activity

Orange Mobile Belgium (Alpha)

Orange Home Assistant custom component. This custom component has been built from the ground up to bring your Orange mobile phone usage details into Home Assistant to help you towards a better follow up on your usage information. This integration is built against the public website provided by Orange Belgium.

For now only Belgian Mobile subscriptions are supported (the only ones I have). Feel free to extend via pull request.

This integration is in no way affiliated with Orange.

Installation

  • HACS: HACS > Integration > add repo 'https://github.com/myTselection/orange' > search for Orange and install
  • Restart Home Assistant
  • Add 'Orange.be' integration via HA Settings > 'Devices and Services' > 'Integrations'
  • Provide Orange.be username and password

If Orange accepts your credentials in a browser but rejects the integration login, add the optional browser Cookie header:

  • Log in at https://e-services.orange.be/nl/overview in your browser.
  • Open the browser developer tools network tab and select the successful https://sso.orange.be/nl/overview request.
  • Copy the full Cookie request header value and paste it into the integration's Browser Cookie header field.

The browser Cookie header is stored in the Home Assistant config entry like the password. It can expire when Orange ends the browser session.

Integration

This integration uses a Home Assistant DataUpdateCoordinator and polls the Orange Belgium customer zone every 30 minutes.

It creates:

  • An account sensor with customer metadata, average invoice amount, account type, payment method, and discovered subscriptions.
  • One subscription sensor per mobile number found in the Orange dashboard switcher, including plan name and billing/usage period dates.
  • One balance sensor per usage block found on each subscription overview page. Known examples are surf volume, national calls, SMS, international calls/SMS, and employer-paid monthly amount.

Balance sensors expose the most useful value as their state:

  • Remaining amount when Orange shows a remaining bundle value, for example 289.2 GB or 19.28 EUR.
  • Consumed amount when Orange shows an unlimited bundle with consumed usage, for example 13 min or 0 SMS.

Common balance attributes include remaining, used, used_percentage, consumed, total, and orange_updated where available. Period dates are exposed on the subscription sensors.

Status

Still some optimisations are planned, see Issues section in GitHub.

Debug logging

If the integration sets up but sensors stay empty, enable debug logging and restart Home Assistant:

logger:
  default: info
  logs:
    custom_components.orange: debug

Useful log lines start with Orange SSO, Fetched Orange page, Orange parsed overview page, Orange Belgium refresh parsed, and Creating Orange subscription sensors.

Technical pointers

The main logic and API connection related code can be found within:

All other files just contain boilerplat code for the integration to work wtihin HA or to have some constants/strings/translations.

Example usage

Entity IDs depend on the mobile number and the balance labels returned by Orange. For a subscription 32486686824, the surf volume entity is expected to look like:

type: entities
entities:
  - entity: sensor.orange_32486686824_subscription
  - entity: sensor.orange_32486686824_surfvolume
  - entity: sensor.orange_32486686824_bellen_naar_alle_netwerken

About

Orange Home Assistant custom component HACS to get Orange Mobile Belgium subscription and usage details.

Topics

Resources

License

Stars

1 star

Watchers

1 watching

Forks

Releases

No releases published

Contributors

Languages