Custom Home Assistant component based on the my.t Usage Checker script to get remaining monthly data allowance from the my.t (Mauritius Telecom) portal.
Copy the entire "myt_usage" folder to your custom_components folder. If you have never installed any custom Home Assistant component, create a folder named "custom_components" in your Home Assistant configuration folder.
Add the following to your configuration.yaml:
sensor:
- platform: myt_usage
username: !secret myt_username
password: !secret myt_password
scan_interval: 7200
username
and password
: Use the same credentials that you use to log in to internetaccount.myt.mu. If you don't know your username or password, please contact the Mauritius Telecom Hotline.
scan_interval
: This value is in seconds and will determine how often the script will check the my.t portal for the remaining data. I don't know if Mauritius Telecom has any limit to the number of times you can log in to the portal but I've found that a value of 7200 (2 hours) is good enough for me. I wouldn't recommend setting it below 1800 (30 minutes) as I don't believe the portal is updated that often.
Once you have installed the custom component, added your credentials to your configuration.yaml, and restarted Home Assistant, you should have new sensor called "my.t Remaining Data" (sensor.myt_usage
).
You can then use any card to display the value in the Lovelace frontend:
I recommend the built-in Sensor card:
Or the awesome mini-graph-card:
- This project uses MechanicalSoup to scrape the my.t portal.