Cheaterdev / clear_grass-ha

Xiaomi ClearGrass Air Detector integration into Home Assistant
59 stars 18 forks source link

Error while setting up platform clear_grass #2

Closed GreyEarl closed 5 years ago

GreyEarl commented 5 years ago

Stranger issue while trying to get the cusom_component to work.

1:40 custom_components/clear_grass/sensor.py (ERROR) unable to parse json '': Expecting value: line 1 column 1 (char 0)

Error while setting up platform clear_grass

Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/helpers/entity_platform.py", line 126, in _async_setup_platform
    SLOW_SETUP_MAX_WAIT)
  File "/usr/lib/python3.7/asyncio/tasks.py", line 416, in wait_for
    return fut.result()
  File "/home/homeassistant/.homeassistant/custom_components/clear_grass/sensor.py", line 260, in async_setup_platform
    device_info = air_quality_monitor.info()
  File "/srv/homeassistant/lib/python3.7/site-packages/miio/device.py", line 329, in info
    return DeviceInfo(self.send("miIO.info"))
  File "/srv/homeassistant/lib/python3.7/site-packages/miio/device.py", line 265, in send
    self.__id = m.data.value["id"]
TypeError: 'NoneType' object is not subscriptable
GreyEarl commented 5 years ago

Problem fixed. For the ones who have the same issue. During the first initialization/registration of the ClearGrass monitor, the device needs to have a working internet connection. I had blocked internet access for the device. In addition to that I have a PiHole server running. So that was a bad combo.

After registering the device in Home Assistant you can block access and enable PiHole filtering again.