概要
Fetch Xfinity Internet Service Usage Data and publish it to Home Assistant sensor
システム・インフラ計測したスター増加
- 24時間
- 0
- 7日間
- 0
- 15日間
- 0
- 1か月
- 履歴を収集中
期間ごとの純増数です。期間は重複しており、日別の値ではありません。未計測の値は空欄です。スター数は注目度の指標であり、品質の保証ではありません。
README.md
オリジナルHome Assistant App to fetch Xfinity Internet and Mobile Usage Data
Fetch Xfinity Internet and Xfinity Mobile usage data and publish it to Home Assistant sensors. Thank you @csobrinho for your assistance in analyzing the Android Xfinity App API. And a shout out to @Shapes0 for their insight as well.
Setup
- Add this repository
https://github.com/thor0215/hassio-xfinity-usageto Home Assistant as a source for third-party apps. See the Home Assistant documentation if you have questions on how to do that. You can also use the button below.
To test the published 2026.11.2 development image as a local Home Assistant app, follow the local app installation instructions.
Installation
Install the Xfinity Usage app
Run app once, then go to Log and copy the URL shown.
Open a new tab in your browser.
Right click on the empty browser page and go to Inspect.
In the new DevTools window, go to Network.
Paste the URL into the blank browser page and log into your Xfinity account
If you are prompted to open an application after login, cancel the prompt.
Go back to the DevTools, and in the Filter type 'code?'

Click on the highlighted xerxessecure.com url.
Scroll to the Response Headers and find the 'Location' header
Copy the 'code' value. In the example below the code value is oi-f0a780e44b644ee199b3f2f2b16ae09a

Now go back to the App Configuration and paste that code into the Xfinity Code option.
Sometimes the Configuration page does not update the changes pushed by the script. Simply go to the list of Apps and then back into this Apps and the Configuration page should be refreshed.Now Start the App and check the logs.
If you are using MQTT, see the MQTT Setup instructions below. If MQTT is enabled the app will no longer update the default sensor.
After starting the app, check the log for "INFO: Usage data retrieved and processed"
Now go to Developer tools -> States and search for sensor.xfinity_usage or for MQTT setups, sensor.xfinity_internet_usage
App Defaults: Page Timeout is 60 seconds and the script runs every 60 minutes (3600 seconds)
Enable or disable usage checks
The app configuration includes separate Enable Internet Usage and Enable Mobile Usage options. Both are enabled by default. Disable either option to skip checking for that subscription's service and usage activity; the other subscription continues to be checked independently.
For standalone Docker or Kubernetes deployments, use the INTERNET_USAGE_ENABLED and MOBILE_USAGE_ENABLED environment variables with true or false.
Service and plan detection
The app checks Internet and Xfinity Mobile independently. For Internet service, GraphQL is preferred for the plan, usage, and gateway details; the My Account REST API is used only when GraphQL is unavailable or returns incomplete data. Plan details include the plan name and download/upload speeds when Xfinity returns them; unavailable speeds are reported as -1. The Internet MQTT device uses the returned modem or router details when available, but missing gateway details do not prevent publishing the usage sensor.
Mobile service is checked before requesting line usage, and the Mobile sensors include available plan type, subgroup, and data-limit details. These checks use Xfinity's internal app APIs; prepaid Mobile service detection and live API behavior have not been verified.
Xfinity Mobile usage
When mobile usage is available for the account, the app publishes an account-total sensor (sensor.xfinity_mobile_usage) and a sensor for each line. Per-line entity IDs use a stable, opaque identifier; the displayed name uses the line nickname when available. Usage is normalized to GB, and sensors include the current cycle end date when supplied by Xfinity.
The mobile sensors are also published through MQTT auto-discovery when MQTT is enabled. The mobile API is an internal Xfinity app API and may change without notice.
Usage diagnostics export
The Create Usage Diagnostics Export option is off by default. When enabled, a successful Internet usage or Mobile account-summary response creates or replaces /config/xfinity_mobile_diagnostics.json. The combined report keeps response-field structure and rounded usage amounts while omitting account and line identifiers, phone numbers, names, device values, billing amounts, and cycle dates. It is stored locally, excluded from app backups, and is never sent automatically. Review and redact it before sharing; disabling the option stops future exports but does not remove an existing file.
For standalone Docker or Kubernetes deployments, set DIAGNOSTICS_ENABLED to true to enable the same local-only export.
Docker/Kubernetes Setup
Known limitation for default sensor. This does not apply to MQTT setups.
There is a known limitation that the sensor will be unavailable if you restart Home Assistant. This is caused by the way Home Assistant handles sensors which are not backed up by an entity, but instead come from an add-on or AppDaemon. You can easily fix that with the following blueprint:
Or use this automation directly:
alias: Restore Xfinity Internet Usage sensor on startup
description: Restore Xfinity Internet Usage sensor on startup
trigger:
- platform: homeassistant
event: start
condition: []
action:
- service: hassio.app_restart
metadata: {}
data:
app: 989f231b_xfinity-usage
mode: single
Example sensor.xfinity_usage:
state: 554
policy_name: 1.2 Terabyte Data Plan
start_date: 04/01/2024
end_date: 04/30/2024
home_usage: 554
wifi_usage: 0
total_usage: 554
allowable_usage: 1229
unit_of_measure: GB
display_usage: true
devices:
- id: 44:A5:XX:XX:XX:XX
usage: 559
policyName: XI Superfast
additional_blocks_used: 0
additional_cost_per_block: 10
additional_units_per_block: 50
additional_block_size: 50
additional_included: 0
additional_used: 0
additional_percent_used: 0
additional_remaining: 0
billable_overage: 0
overage_charges: 0
overage_used: 0
current_credit_amount: 0
max_credit_amount: 0
maximum_overage_charge: 100
policy: limited
courtesy_used: 0
courtesy_remaining: 1
courtesy_allowed: 1
courtesy_months: 03/2023
in_paid_overage: false
remaining_usage: 675
friendly_name: Xfinity Usage
unit_of_measurement: GB
device_class: data_size
state_class: measurement
icon: mdi:wan
internet_download_speeds_Mbps: 800
internet_upload_speeds_Mbps: 20
関連プロジェクトを探す
読み込み中…