Usage meter for Home Assistant
See the ABB Usage Meter Instructions for Home Assistant PDF file for iinstructions on how to use this repo. When the meter is added you can display usage on a lovelace card in Home Assistant.
Pre-requisites
- Needs to be running on a linux distribution (including HassOS).
- The usage retrieval uses a bash script to retrieve the usage json file from Aussie Broadband. This then creates a sensor abb_usage.
- You need to run the abbcreds.sh script first. This stores all your logon information in a file, abbcreds.json; Creates an abbcookie.txt valid for 12 months; creates the abbtoken.json which is a refresh token that is used to refresh the cookie 100 days before it expires. (Cookies are valid for 1 year). This stops us hammering the ABB API unnecessarily.
- This script can be in a sub-directory and should be aware of it's location and expects the data files above in the same directory as the script.
- This script should work with any Home Assistant Installation... Hassbian, Hassio etc... (NOTE: Script WILL now work with Docker installs after 0.98.0 which ic based on Alpine Linux not Debian as they have included jq in the base. For earlier releases it may not work with HA Docker as apparently and inexplicably, the docker container does not have the linux jq command!!!! In that case a cronjob should work)
- The abbcreds.sh will give you a 'hint' as to the value you entered the last time you ran the script. If that is unchanged, just press [Enter] otherwise EDIT the correct details in. You WILL need to rerun this script if you change your password!
- Your Home Assistant installation needs to have a long term access token
- You can make your own cards for Lovelace or use my sample ones. The Lovelace cards I supply require 2 custom cards. config-template-card and bar-card available here:
https://github.com/custom-cards/config-template-card