This tool allows you to run periodic comcast data usage checks and save the results to Influxdb
This code is adopted from the work done by barrycarey in the similar thing for capturing speedtest data as well as jantman's xfinity-usage python example
Key | Description |
---|---|
Delay | Delay between runs |
Output | Write console output while tool is running |
Key | Description |
---|---|
Address | Delay between updating metrics |
Port | InfluxDB port to connect to. 8086 in most cases |
Database | Database to write collected stats to |
Username | User that has access to the database |
Password | Password for above user |
Key | Description |
---|---|
Username | Comcast username (don't include the @comcast.com) |
Password | Password for above user |
'measurement': 'comcast_data_usage',
'fields': {
'used',
'total',
'unit'
}
See this example json for a singlestat panel as shown in the screenshot above
Before the first use run pip3 install -r requirements.txt
Enter your desired information in config.ini and run InfluxdbComcast.py
Optionally, you can specify the --config argument to load the config file from a different location.
Python 3+
You will need the influxdb library installed to use this - Found Here
Install Docker
Make a directory to hold the config.ini file. Navigate to that directory and download the sample config.ini in this repo.
mkdir comcastUsage-for-influxdb
curl -O https://raw.githubusercontent.com/billimek/comcastUsage-for-influxdb/blob/master/config.ini comcastUsage-for-influxdb/config.ini
cd comcastUsage-for-influxdb
Modify the config file with your influxdb settings.
vim config.ini
Modify the 'Address =' line include the ip or hostname of your influxdb instance. Example:
Address = 10.13.14.200
Modify the 'Username' and 'Password' in the COMCAST section with your comcast login credentials. NOTE you only need the username portion of your comcast login, not the @comcast.com part Example:
[COMCAST]
Username = annoying_customer
Password = supersecretpassword
docker run -d \
--name="comcast" \
-v config.ini:/src/config.ini \
--restart="always" \
billimek/comcastusage-for-influxdb