Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[miio.protocol] unable to parse json '': Expecting value: line 1 column 1 (char 0) #35118

Closed
darootler opened this issue May 3, 2020 · 5 comments · Fixed by #37422
Closed

Comments

@darootler
Copy link

darootler commented May 3, 2020

The problem

After every HA reboot this error is logged.

Environment

  • Home Assistant Core release with the issue: 0.109.3
  • Last working Home Assistant Core release (if known): Not sure, maybe 0.108.9
  • Operating environment (Home Assistant/Supervised/Docker/venv): Home Assistant
  • Integration causing this issue: xiaomi_miio
  • Link to integration documentation on our website: https://www.home-assistant.io/integrations/vacuum.xiaomi_miio/

Problem-relevant configuration.yaml

vacuum:
  - platform: xiaomi_miio
    host: 192.168.5.3
    name: Abstellraum Staubsauger
    token: !secret vacuum_token

Traceback/Error logs

2020-05-03 10:55:22 ERROR (SyncWorker_19) [miio.protocol] unable to parse json '': Expecting value: line 1 column 1 (char 0)

Additional information

The problem occurs with the original firmware 4007 but not with the valetudo customized firmware 4007.

@probot-home-assistant
Copy link

Hey there @rytilahti, @syssi, mind taking a look at this issue as its been labeled with a integration (xiaomi_miio) you are listed as a codeowner for? Thanks!
(message by CodeOwnersMention)

@rytilahti
Copy link
Member

rytilahti commented May 3, 2020

This is coming from the fan speed mode detection: if the vacuum is not connected to the cloud, it will return erroneous response for miIO.info. The next release of python-miio will allow proper handling of this (by requiring the integration to catch the exception): rytilahti/python-miio#685

@rytilahti
Copy link
Member

This should actually be fixed already for some time (the fan_speed_presets() falls back to gen1 fan speeds if it cannot obtain the information from the device). Please reopen if this is still an issue.

@Mariusthvdb
Copy link
Contributor

Seeing the same error on another integration here:

2020-07-04 00:04:03 ERROR (MainThread) [homeassistant.components.binary_sensor] stookalert: Error on device update!
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 319, in _async_add_entity
    await entity.async_device_update(warning=False)
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 466, in async_device_update
    self.update  # type: ignore
  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/stookalert/binary_sensor.py", line 85, in update
    self._api_handler.get_alerts()
  File "/usr/local/lib/python3.7/site-packages/stookalert/rivm_stookalert.py", line 35, in get_alerts
    alerts = self.request()
  File "/usr/local/lib/python3.7/site-packages/stookalert/rivm_stookalert.py", line 54, in request
    json_response = json.loads(response.text)
  File "/usr/local/lib/python3.7/json/__init__.py", line 348, in loads
    return _default_decoder.decode(s)
  File "/usr/local/lib/python3.7/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/local/lib/python3.7/json/decoder.py", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

so maybe bus is something else and this issue shouldn't be closed?

@rytilahti
Copy link
Member

rytilahti commented Jul 3, 2020

That is a completely different bug, but this bug is (likely) neither solved before #37422 gets merged, so I'm opening this until that happens.

To your issue, you should report that to the developer of stookalert integration (or maybe even to the upstream lib, as json decode errors should probably handled there).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants