core: AsusWRT: ValueError: invalid literal for int() with base 10: '' after upgrade to 107.x

The problem

After updating to 107.x i am receivign errors like : ValueError: invalid literal for int() with base 10: ‘’

Environment

HassOS 3.12

  • Home Assistant release with the issue: 107.0
  • Last working Home Assistant release (if known): 106.5
  • Operating environment (Hass.io/Docker/Windows/etc.): HassOS
  • Integration causing this issue: AsusWRT
  • Link to integration documentation on our website: https://www.home-assistant.io/integrations/asuswrt/

Problem-relevant configuration.yaml

device_tracker:
  - platform: asuswrt
    host: !secret asus
    username: !secret asus_username
    password: !secret asus_password  
    consider_home: 180
    # scan_interval: 5
    new_device_defaults:
      track_new_devices: false
      #hide_if_away: false

asuswrt:
  host: !secret asus
  username: !secret asus_username
  password: !secret asus_password
  sensors:
    - upload
    - download
    - upload_speed
    - download_speed


Traceback/Error logs

2020-03-18 19:03:23 ERROR (MainThread) [homeassistant.helpers.entity] Update for sensor.asuswrt_upload fails
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 279, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 474, in async_device_update
    await self.async_update()
  File "/usr/src/homeassistant/homeassistant/components/asuswrt/sensor.py", line 128, in async_update
    await super().async_update()
  File "/usr/src/homeassistant/homeassistant/components/asuswrt/sensor.py", line 57, in async_update
    self._rates = await self._api.async_get_bytes_total()
  File "/usr/local/lib/python3.7/site-packages/aioasuswrt/asuswrt.py", line 325, in async_get_bytes_total
    rx = await self.async_get_rx()
  File "/usr/local/lib/python3.7/site-packages/aioasuswrt/asuswrt.py", line 332, in async_get_rx
    return int(data[0])
ValueError: invalid literal for int() with base 10: ''

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 4
  • Comments: 29 (22 by maintainers)

Most upvoted comments

Doing some debugging, I’m no expert on debugging HA some doing this live with loggers added. I see the interface being passed to the router to query is ’ /var/lib/misc’ when I do it love on HA, but eth0 when I run standalone. This is clearly wrong. I’ll dig further, but meeting to go to.

This looks like a mismatch from sensor to asuswrt. Init for sensor doesn’t include time_cache.

    api = AsusWrt(
        conf[CONF_HOST],
        conf[CONF_PORT],
        conf[CONF_PROTOCOL] == "telnet",
        conf[CONF_USERNAME],
        conf.get(CONF_PASSWORD, ""),
        conf.get("ssh_key", conf.get("pub_key", "")),
        conf[CONF_MODE],
        conf[CONF_REQUIRE_IP],
        conf[CONF_INTERFACE],
        conf[CONF_DNSMASQ],
    )
    def __init__(self, host, port=None, use_telnet=False, username=None,
                 password=None, ssh_key=None, mode='router', require_ip=False,
                 time_cache=CHANGE_TIME_CACHE_DEFAULT, interface='eth0',
                 dnsmasq='/var/lib/misc'):