Skip to content

CumpsD/telenet

Telenet

Telenet for Home Assistant

A Home Assistant integration allowing to monitor your mobile, internet, dtv and telephone usage

Features

  • 🌐 Internet sensors
  • 📱 Mobile sensors
  • 📺 DTV sensors
  • 📞 Telephone sensors

MIT License Open your Home Assistant instance and open the repository inside the Home Assistant Community Store. hacs_badge maintainer buyme_coffee discord

GitHub issues Average time to resolve an issue Percentage of issues still open PRs Welcome

Hacs and Hassfest validation Python

manifest version github release github release date github last-commit github contributors github commit activity

Installation

Using HACS (recommended)

  1. Simply search for Telenet in HACS and install it easily.
  2. Restart Home Assistant
  3. Add the 'Telenet' integration via HA Settings > 'Devices and Services' > 'Integrations'
  4. Provide your Telenet BE username and password

Manual

  1. Copy the custom_components/telenet directory of this repository as config/custom_components/telenet in your Home Assistant instalation.
  2. Restart Home Assistant
  3. Add the 'Telenet' integration via HA Settings > 'Devices and Services' > 'Integrations'
  4. Provide your Telenet BE username and password

This integration will set up the following platforms.

Platform Description
telenet Home Assistant component for Telenet BE services

Contributions are welcome!

If you want to contribute to this please read the Contribution guidelines

Troubleshooting

  1. You can enable logging for this integration specifically and share your logs, so I can have a deep dive investigation. To enable logging, update your configuration.yaml like this, we can get more information in Configuration -> Logs page
logger:
  default: warning
  logs:
    custom_components.telenet: debug
  1. If you receive this exception in the logs:
No products found. Either the API is currently down or you are not migrated to the new Telenet IT system yet.

This might mean that your account is not migrated yet to the new Telenet IT platform. I only support the newest API, which is rolling out since beginning of 2023. So you'll need to be patient and hope Telenet migrates your account soon.

  1. If none of the above helped, you can always create an issue on Github or reach out on Discord

Configuration tip

You can exclude some sensors as they contain quite some information, like e.g.

recorder:
  exclude:
    entity_globs:
      - sensor.telenet_*_internet_daily_usage
      - sensor.telenet_*_internet_usage
      - sensor.telenet_*_internet_network
      - sensor.telenet_*_internet_wifi

Lovelace examples

Internet info and peak/off-peak usage Apex graph

Internet peak off-peak

Show markdown code

Replace <identifier> by your Telenet identifier

(Only at 2 places)

type: vertical-stack
cards:
  - type: custom:config-template-card
    variables:
      internet:
        identifier: <identifier>
    entities:
      - ${"sensor.telenet_"+internet.identifier+"_internet_usage"}
    card:
      type: vertical-stack
      cards:
        - type: markdown
          content: >-
            {% set identifier = "<identifier>"%} {% set internet_usage =
            "sensor.telenet_"+identifier+"_internet_usage"%}

            ## <img src="https://brands.home-assistant.io/telenet/icon.png"
            width="20"/>&nbsp;&nbsp;Je Internet {{identifier}}

            #### Reeds **{{state_attr(internet_usage,'used_percentage')}}%**
            verbruikt tijdens de huidige periode

            |||

            |----:|----:|

            | Periode | **{{state_attr(internet_usage,'start_date')|
            as_timestamp | timestamp_custom("%d/%m")}} -
            {{state_attr(internet_usage,'end_date')| as_timestamp |
            timestamp_custom("%d/%m")}}**

            | Verbruikt:|**{{state_attr(internet_usage,'total_usage')}}**

            |Totaal
            toegekend:|**{{state_attr(internet_usage,'allocated_usage')}}**

            |Wi-Free verbruik:| *{{state_attr(internet_usage,'wifree_usage')}}*

            |Laatste update: |*{{state_attr(internet_usage,'last_update') |
            as_timestamp | timestamp_custom("%d-%m-%Y %H:%M")}}*


            Nog **{{state_attr(internet_usage,'days_until')}}** dag(en) tot
            nieuwe periode
        - type: custom:apexcharts-card
          apex_config:
            tooltip:
              enabled: true
              followCursor: true
              x:
                show: false
                format: dd MMMM yyyy
              'y':
                show: true
          span:
            end: day
            offset: >-
              ${'+'+states['sensor.telenet_'+internet.identifier+'_internet_usage'].attributes.days_until+'d'}
          stacked: true
          graph_span: 1month
          header:
            standard_format: false
            show: true
            show_states: false
            title: ${'Verbruik piek en daluren huidige periode '+internet.identifier}
          now:
            show: true
            label: Vandaag
          series:
            - entity: ${'sensor.telenet_'+internet.identifier+'_internet_daily_usage'}
              name: Daluren
              type: column
              color: 1A9AAA
              show:
                legend_value: false
              float_precision: 2
              data_generator: |
                return entity.attributes.daily_date.map((day, index) => {
                  return [new Date(day), entity.attributes.daily_off_peak[index]];
                });
            - entity: ${'sensor.telenet_'+internet.identifier+'_internet_daily_usage'}
              name: Piekuren
              type: column
              color: A6D9D9
              show:
                legend_value: false
              float_precision: 2
              data_generator: |
                return entity.attributes.daily_date.map((day, index) => {
                  return [new Date(day), entity.attributes.daily_peak[index]];
                });
        - type: horizontal-stack
          cards:
            - type: entity
              name: Totaal P+D
              attribute: total_usage_with_offpeak
              entity: ${'sensor.telenet_'+internet.identifier+'_internet_usage'}
              icon: mdi:sigma
              unit: GB
            - type: entity
              name: Piekuren
              attribute: peak_usage
              entity: ${'sensor.telenet_'+internet.identifier+'_internet_usage'}
              unit: GB
              icon: mdi:arrow-up-bold
            - type: entity
              name: Daluren
              attribute: offpeak_usage
              entity: ${'sensor.telenet_'+internet.identifier+'_internet_usage'}
              icon: mdi:arrow-down-bold
        - type: custom:dual-gauge-card
          title: false
          min: 0
          max: 100
          shadeInner: true
          cardwidth: 350
          outer:
            entity: ${'sensor.telenet_'+internet.identifier+'_internet_usage'}
            label: used
            min: 0
            max: 100
            unit: '%'
            colors:
              - color: var(--label-badge-green)
                value: 0
              - color: var(--label-badge-yellow)
                value: 60
              - color: var(--label-badge-red)
                value: 80
          inner:
            entity: ${'sensor.telenet_'+internet.identifier+'_internet_usage'}
            label: period
            attribute: period_used_percentage
            min: 0
            max: 100
            unit: '%'


Auto entities for costs

Auto entities Costs

Show markdown code
type: custom:auto-entities
card:
  type: entities
  title: Telenet kosten
filter:
  include:
    - entity_id: sensor.telenet*
      attributes:
        icon: mdi:currency-eur

Network & Wifi info

Network Markdown

Show markdown code

Replace <identifier> by your Telenet identifier and <customer_id> by your Telenet account ID

type: markdown
content: >
  ## <img
  src="https://github.com/geertmeersman/telenet/blob/main/images/brand/icon.png?raw=true"
  width="25"/>&nbsp;&nbsp;Telenet <identifier>

  ## <img src="https://github.com/geertmeersman/telenet/blob/main/images/brand/icon.png?raw=true" width="25"/>&nbsp;&nbsp;Telenet <identifier>
  ## Modem info
  | | |
  |----:|----:|
  |**Type**|{{state_attr("sensor.telenet_<customer_id>_<identifier>_internet_network","modemType")}}|
  |**Model**|{{state_attr("sensor.telenet_<customer_id>_<identifier>_internet_network","model")}}|
  |**Last seen**|{{state_attr("sensor.telenet_<customer_id>_<identifier>_internet_network","lastSeen")}}|
  |**Last seen light**|{{state_attr("sensor.telenet_<customer_id>_<identifier>_internet_network","lastSeenLight")}}|
  |**Public IP Adress**|{{state_attr("sensor.telenet_<customer_id>_<identifier>_internet_network","ipAddressInfos")[0].ipAddress}}|

  ## Network clients
  |Name|IP|Interface|Vendor
  |----:|----:|----:|----:|{% for item in state_attr("sensor.telenet_<customer_id>_<identifier>_internet_network","clients") %}
  {%if "name" in item %}{{item["name"]}}{% else %}|{%-endif %}|{%for ip in item["ipAddressInfos"] %}{%if ip["ipType"] == "IPv4" %}{{ip["ipAddress"]}}{%-endif %}
  {%-endfor %}|{{item["connectedInterface"]}}|{{item["vendor"]}}{%-endfor %}

  ## Wifi Settings
  |||
  |----:|----:|
  |**Wireless enabled**|{{state_attr("sensor.telenet_<customer_id>_<identifier>_internet_wifi","wirelessEnabled")}}|
  |**HomeSpot enabled**|{{state_attr("sensor.telenet_<customer_id>_<identifier>_internet_wifi","homeSpotEnabled")}}|
  |**Wps enabled**|{{state_attr("sensor.telenet_<customer_id>_<identifier>_internet_wifi","wifiWpsEnabled")}}|

Sensors logic

The integration creates for each subscription linked to your account the following sensors

Interact with the sensors flow here

Sensors flow

Screenshots

Description Screenshot
Config flow init Config flow init
Config flow options Config flow options
Config flow language update Config flow language update
Config flow password update Config flow password update
Config flow success Config flow success
Config flow multi account setup Config flow multi account setup
One for 2 sensors One for 2 sensors
All-Internet & Usage Based Pricing sensors All-Internet & Usage Based Pricing
Internet sensors Internet sensors
Internet sensor Internet sensor
Plan sensor Plan sensor
ONE for 2 bundle sensors ONE for 2 bundle sensors
DTV sensors DTV sensors

Code origin

The code of this Home Assistant integration has been written by analysing the calls made by the Telenet website and by contributing to the integration made by @myTselection. It made me curious on how to build an integration from scratch, using the recommendations here https://developers.home-assistant.io/docs/creating_component_index/. I tried to pull out of the website as much information as possible.

I have no link with Telenet Group N.V.

About

Home Assistant component for Telenet BE services

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages