SoundGoof / hallon

retrieve statistics about your Hallon mobile broadband subscription

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Hallon

Retrieve statistics about your Hallon mobile broadband subscription

> cp .hallon-credentials.template.yaml .hallon-credentials.yaml
> chmod og-rw .hallon-credentials.yaml
<edit .hallon-credentials.yaml>
> ./hallon.py
total left used used_pct daysleft
10 4.24 5.76 58 30

To publish to MQTT for use with e.g. Home Assistant (http://home-assistant.io) from crontab:

hallon.py | mosquitto_pub -h $MQTT_BROKER -u $MQTT_USER -P $MQTT_PW -i $MQTT_ID -t me/tel/hallon -q 1 -r -s

With corresponding Home Assistant sensor configured, e.g.:

- platform: mqtt
  state_topic: "me/tel/hallon"
  name: Mobile broadband usage
  unit_of_measurement: "%"
  value_template: '{{ value_json.used_pct }}'

No licence, public domain, feel free to use for anything. Please contribute improvements/bugfixes etc.

About

retrieve statistics about your Hallon mobile broadband subscription


Languages

Language:Python 100.0%