Telstra smart modem gen 2 uptime status in home assistant.


Nerd Stuff
[email protected] Jul 23, 2023 09:50 AM

Assumption is you have root access on router and the macoers repo, and have installed snmpd on there and you have started/enabled it.

then in your configuration.yaml:

sensor:
  - platform: snmp
    name: "Wifi uptime"
    host: 192.168.1.253
    baseoid: iso.3.6.1.2.1.25.1.1.0
    accept_errors: true
    value_template: "
      {% set time = (value | int) | int %}
      {% set minutes = ((time % 360000) / 6000) | int %}
      {% set hours = ((time % 8640000) / 360000) | int %}
      {% set days = (time / 8640000) | int %}
      {%- if time < 6000 -%}
        Less than a minute
      {%- else -%}
        {%- if days > 0 -%}
          {{ days }}d
        {%- endif -%}
        {%- if hours > 0 -%}
          {%- if days > 0 -%}
            {{ ' ' }}
          {%- endif -%}
          {{ hours }}h
        {%- endif -%}
        {%- if minutes > 0 -%}
          {%- if days > 0 or hours > 0 -%}
            {{ ' ' }}
          {%- endif -%}
          {{ minutes }}m
        {%- endif -%}
        {%- endif -%}"

Restart HA and goto dashboard edit and add the card for 'Wifi Update' from the sensors panel.

If your baseoid is different then you can install the package 'snmp' under Debian or 'net-snmp-utils' under Fedora 38, and try this command to see what your baseoid options are:

$ snmpwalk -Os -c public -v 2c 192.168.1.253

Please note you will have to replace both instances of '192.168.1.253' with your router IP!

telstra smart modem gen 2 DJA0231 Technicolor root access macoers repo home assistant snmp snmpd fedora debian.