Systemmonitor: Error on device update!

Hi to all!
I got this error several weeks ago, but I’m not able to solve it.

systemmonitor: Error on device update!
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 324, in _async_add_entity
    await entity.async_device_update(warning=False)
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 476, in async_device_update
    await self.hass.async_add_executor_job(self.update)
  File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/src/homeassistant/homeassistant/components/systemmonitor/sensor.py", line 151, in update
    self._state = round(psutil.disk_usage(self.argument).free / 1024 ** 3, 1)
  File "/usr/local/lib/python3.7/site-packages/psutil/__init__.py", line 2013, in disk_usage
    return _psplatform.disk_usage(path)
  File "/usr/local/lib/python3.7/site-packages/psutil/_psposix.py", line 121, in disk_usage
    st = os.statvfs(path)
FileNotFoundError: [Errno 2] No such file or directory: ''

Hassio on PI3+ 0.108.3

Thanks in advance
Boogs

Please show your config for the system monitor sensors otherwise we can’t help.

- platform: systemmonitor
  resources:
#   - type: disk_use_percent
#      arg: /config
    - type: memory_free
    - type: memory_use_percent
    - type: processor_use
    - type: last_boot     
    - type: disk_free
    - type: network_in
      arg: eth0
    - type: network_out
      arg: eth0
    - type: ipv4_address
      arg: eth0

Try this:

    - type: disk_free
      arg: /
1 Like

Perfect!!!
Thanks!!!

The docs are a bit misleading. They say the args are optional. In this case there does not seem to be a default so it is required.

Thanks, Tom. Was having the same problem.

Thanks! Was also having the same problem.

Has anyone reported this as a bug?

It’s not really an issue. there are optional arguments in the table. So it’s both. You just have to look up the table to see if an argument is required.

Well it is a binary thing. The argument for a type is either required or optional. If it is required (for the component to work) and is not there, it should fail the configuration check. If it is optional, it should have a default value.

image

Unfortunately the way the page is laid out arg: is applicable to more than one option. Some are optional, some aren’t.

But in that case, the component should have a default value for the argument that is required. It should not just not work without explanation (the error message does not tell you that an argument is missing).