SNMP uptime query format

Dear community,

I would like to ask for your help. I have a WiFi device and I query its uptime via SNMP. I get the following:

snmpwalk -v1 -c public iso.3.6.1.2.1.1.3.0
iso.3.6.1.2.1.1.3.0 = Timeticks: (1812421400) 209 days, 18:30:14.00

I would like to display this on the home assistant interface. I wrote this in the configuration.yaml file:

  - platform: snmp
    name: "wifi_uptime"
    version: "1"
    host: <device ip>
    community: public
    baseoid: iso.3.6.1.2.1.1.3.0
    accept_errors: true
    state_class: measurement
    scan_interval: 10

This returns this result: 1812421400

How can I remove the two 0’s from the end?
Then, how can I convert the map minute into an understandable date format?

Unfortunately, this doesn’t work for me:

  - platform: template
    sensors:
      wifi_uptime_human_readable:
        friendly_name: "Wifi Uptime"
        unit_of_measurement: ""
        value_template: >-
          {% set uptime_seconds = (states('sensor.wifi_uptime') | int) // 100 %}
          {% set years = uptime_seconds // (365 * 24 * 3600) %}
          {% set months = (uptime_seconds % (365 * 24 * 3600)) // (30 * 24 * 3600) %}
          {% set days = (uptime_seconds % (30 * 24 * 3600)) // (24 * 3600) %}
          {% set hours = (uptime_seconds % (24 * 3600)) // 3600 %}
          {% set minutes = (uptime_seconds % 3600) // 60 %}
          {% set seconds = uptime_seconds % 60 %}
          {{ years }} years, {{ months }} months, {{ days }} days, {{ hours }} hours, {{ minutes }} minutes, {{ seconds }} seconds

I get this as a result: unknown

I must be wrong as I am new to yaml. Where is the mistake, what am I doing wrong?

When posting code, like YAML, then mark the code and click the </> icon in the post editor.
This will preserve indentations, which often is the culprit to errors.

Thank you for your signal. I corrected.

I have no idea why it will not print it out correctly.
If I use the template and just use {{ years }} in the last line, then it works, but {{ years }} years does not.

I can see that I have made the conversion to human text in my lovelace cards instead of in the template.

Indeed. Unfortunately, I don’t know why it doesn’t display the rest.