home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
71.05k stars 29.71k forks source link

Error with Qingping Air Monitor (cgllc.airmonitor.s1) after firmware upgrade to 4.1.8_0244 #76646

Open igogold opened 2 years ago

igogold commented 2 years ago

The problem

After the firmware upgrade of Qingping Air Monitor (cgllc.airmonitor.s1) to version 4.1.8_0244 Home Assistant can't get info anymore.

It seems air monitor resets connection with mi home after upgrade. I reconnected it back to mi home, in the mihome mobile app the monitor started to work and shows current values from screen.

I removed integration in the HA and added it back using a token. It recognized cgllc.airmonitor.s1 device and added it to HA. But now I see only one sensor entry w/o an entry from air_monitor domain. And this sensor entry just unavailable.

What version of Home Assistant Core has the issue?

core-2022.8.3

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant OS

Integration causing the issue

Xiaomi Miio

Link to integration documentation on our website

https://www.home-assistant.io/integrations/xiaomi_miio/

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

2022-08-12 10:29:29.412 ERROR (MainThread) [homeassistant.components.air_quality] xiaomi_miio: Error on device update!
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 477, in _async_add_entity
await entity.async_device_update(warning=False)
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 702, in async_device_update
await task
File "/usr/src/homeassistant/homeassistant/components/xiaomi_miio/air_quality.py", line 135, in async_update
state = await self.hass.async_add_executor_job(self._device.status)
File "/usr/local/lib/python3.10/concurrent/futures/thread.py", line 58, in run
result = self.fn(*self.args, **self.kwargs)
File "/usr/local/lib/python3.10/site-packages/miio/click_common.py", line 184, in _wrap
return func(self, *args, **kwargs)
File "/usr/local/lib/python3.10/site-packages/miio/airqualitymonitor.py", line 197, in status
return AirQualityMonitorStatus(defaultdict(lambda: None, values))
ValueError: dictionary update sequence element #0 has length 1; 2 is required

2022-08-12 10:29:50.567 ERROR (MainThread) [homeassistant.helpers.entity] Update for sensor.cgllc_airmonitor_s1 fails
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 514, in async_update_ha_state
await self.async_device_update()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 709, in async_device_update
raise exc
File "/usr/src/homeassistant/homeassistant/components/xiaomi_miio/sensor.py", line 852, in async_update
state = await self.hass.async_add_executor_job(self._device.status)
File "/usr/local/lib/python3.10/concurrent/futures/thread.py", line 58, in run
result = self.fn(*self.args, **self.kwargs)
File "/usr/local/lib/python3.10/site-packages/miio/click_common.py", line 184, in _wrap
return func(self, *args, **kwargs)
File "/usr/local/lib/python3.10/site-packages/miio/airqualitymonitor.py", line 197, in status
return AirQualityMonitorStatus(defaultdict(lambda: None, values))
ValueError: dictionary update sequence element #0 has length 1; 2 is required

Additional information

The same issue with latest xiaomi-miio (0.5.12) in command line:

(miio) pk-imac-01-27:~% miiocli airqualitymonitor --ip 192.168.XX.XX --token XXXXXXX status
Traceback (most recent call last):
  File "/usr/local/lib/python-venv/miio/bin/miiocli", line 8, in <module>
    sys.exit(create_cli())
  File "/usr/local/lib/python-venv/miio/lib/python3.9/site-packages/miio/cli.py", line 66, in create_cli
    return cli(auto_envvar_prefix="MIIO")
  File "/usr/local/lib/python-venv/miio/lib/python3.9/site-packages/miio/click_common.py", line 51, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python-venv/miio/lib/python3.9/site-packages/click/core.py", line 1055, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python-venv/miio/lib/python3.9/site-packages/click/core.py", line 1657, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python-venv/miio/lib/python3.9/site-packages/click/core.py", line 1657, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python-venv/miio/lib/python3.9/site-packages/click/core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python-venv/miio/lib/python3.9/site-packages/click/core.py", line 760, in invoke
    return __callback(*args, **kwargs)
  File "/usr/local/lib/python-venv/miio/lib/python3.9/site-packages/miio/click_common.py", line 305, in wrap
    kwargs["result"] = func(*args, **kwargs)
  File "/usr/local/lib/python-venv/miio/lib/python3.9/site-packages/click/decorators.py", line 84, in new_func
    return ctx.invoke(f, obj, *args, **kwargs)
  File "/usr/local/lib/python-venv/miio/lib/python3.9/site-packages/click/core.py", line 760, in invoke
    return __callback(*args, **kwargs)
  File "/usr/local/lib/python-venv/miio/lib/python3.9/site-packages/miio/click_common.py", line 270, in command_callback
    return miio_command.call(miio_device, *args, **kwargs)
  File "/usr/local/lib/python-venv/miio/lib/python3.9/site-packages/miio/click_common.py", line 217, in call
    return method(*args, **kwargs)
  File "/usr/local/lib/python-venv/miio/lib/python3.9/site-packages/miio/click_common.py", line 184, in _wrap
    return func(self, *args, **kwargs)
  File "/usr/local/lib/python-venv/miio/lib/python3.9/site-packages/miio/airqualitymonitor.py", line 197, in status
    return AirQualityMonitorStatus(defaultdict(lambda: None, values))
ValueError: dictionary update sequence element #0 has length 1; 2 is required
Anton-Ka commented 1 year ago

No, battery level excluded. Like in this message.

ildar170975 commented 1 year ago

Btw, can anyone see (using any integration) new data added on a display on the latest firmware?

vmishurov commented 1 year ago

I confirm. On Xiaomi Miot Auto, the device works properly.

pkmcnc commented 1 year ago

Btw, can anyone see (using any integration) new data added on a display on the latest firmware?

Nope...

gleam-ru commented 1 year ago

bump. Any news?

SergeyPomelov commented 1 year ago

Not stale

AntoxaSa commented 1 year ago

so did not solve the problem in the new version of HA?

SergeyPomelov commented 1 year ago

No. Xiaomi Miot Auto is fine, Xiaomi Miio is not. Home Assistant 2022.9.5 plus Qinping CGS1 firmware 4.1.8_0256. I suspect it's dead since I'd updated the firmware.

ildar170975 commented 1 year ago

Xiaomi Miot Auto is fine

What do you mean by "fine"? Miot platform does not create a sensor for a battery_level, only these sensors: image

SergeyPomelov commented 1 year ago

@ildar170975 Here's an issued discussion tread, so the context is the bug. Fine means the device is working and getting some data, not just effectively dead. As I can see the battery just wasn't implemented https://home.miot-spec.com/spec/cgllc.airmonitor.s1, you can file a feature request there, here it's irrelevant. I either do not see battery, however can see it in miHome, so it's doable to implement it in miot.

akarpych commented 1 year ago

updating the device to 4.1.8_0267 and HA to 2023.1.2 did not resolve the issue.

diablotin09 commented 1 year ago

Better on my side with the firmware 4.1.8_0267 . I had disconnections every 2 or 3 days and i got only 1 in the last 20 days with this new firmware.

AntoxaSa commented 1 year ago

When will there be an official decision in the home assistant?

issue-triage-workflows[bot] commented 1 year ago

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

alexander-saratovcev commented 1 year ago

As a workaround, I added it through Xiaomi Miot Auto. Any plans to support it in HA without Xiaomi Miot Auto integration?

diablotin09 commented 1 year ago

Still not working properly on my side with regular disconnections !

issue-triage-workflows[bot] commented 1 year ago

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

SergeyPomelov commented 1 year ago

IMHO, that eager bot's policy not respecting other bug's liveness tags and earlier dismissing of the staleness isn't a “clean some old issues”, it's more of a “we won't do ignored by the maintainers issues”.

issue-triage-workflows[bot] commented 9 months ago

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

akarpych commented 9 months ago

Anybody here? News?

sstu commented 9 months ago

Don't expect a solution here, no one is doing this. There is a solution and it has long been known

ildar170975 commented 9 months ago

There is a solution and it has long been known

Which is? Do not be so enigmatic. Care to post a link to it if you mentioned.

sstu commented 9 months ago

That's all here - https://github.com/Cheaterdev/clear_grass-ha/issues/13 184543529-6989c7d2-dd04-4834-935f-ab7f54ac7c8c

ildar170975 commented 9 months ago
  1. The solution "remove from sensor.py everything related to a battery level" is not a solution. It's a temporarily fix which became a permanent due to some reasons (including a russian invasion - and the author said his is in Ukrainian army now). This fix allowed the integration to at least acquire other data from devices. The official Mi Home App does provide a battery level (at least I see a "97%" value after disconnecting my device from a power supply, same value as displayed on the device).

  2. A fix in a 3rd party integration cannot be a reason to stop fixing a standard HA integration.

SergeyPomelov commented 9 months ago

@sstu Thanks for the input. Yes, the issue is dead. Yet, it isn't stale, huh. I fixed it by the same way you posted or you can use Miot Auto integration from HACS.

I'm here mostly for displaying that keeping the current bot's behaviour is... veeery suboptimal. It shoudn't be a helper for ignoring actual relevant and serious bugs.

ildar170975 commented 9 months ago

@SergeyPomelov

Miio integration from HACS

Could you tell does it provide a battery_level info?

SergeyPomelov commented 9 months ago
  1. No battery. Out of curiosity, why do you need a battery monitoring here? It has battery, however, it lasts hours, not days. That's enough for outages or measuring something outside... definitely not for running without a usb as a primary use-case. 2. Sorry, it was Miot Auto, see the screen. Screenshot 2023-11-26 231623
ildar170975 commented 9 months ago
  1. Out of curiosity, why do you need a battery monitoring here?

Not crucial. Each sensor in my house which equipped with a battery & mainly powered by an external supply is monitored for a battery_level. That is why I am interested in restoring this functionality in this device/integration.

issue-triage-workflows[bot] commented 6 months ago

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

ildar170975 commented 6 months ago

still there

dumbodumbos commented 6 months ago

the problem still exists

WeslyG commented 5 months ago

If you want a simple resolve this issue please use https://github.com/al-one/hass-xiaomi-miot with hasc Local connection Qingping with 4+ firmware work fine for me with ip and local key. image

issue-triage-workflows[bot] commented 2 months ago

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

SergeyPomelov commented 2 months ago

I won't post any issues on the Home Assistant GitHub ever again. It's extremely frustrating to put in the effort to fill in all the details and then have each ignored issue repeatedly flagged by the bot bodyguarding all of the actual and the existing issues. Instead, I propose to mark all the variety of core components ignoring issues with the same "clever" bot as unsupported.

DreamNik commented 1 month ago

Then just ignore the community, and patch your instance manually to suit your needs. Open source means no obligations neither on developer nor on user. Modify and fix everything as you wish, share at your will (or GNU GPL compliance).

Here is my fix: /venv/hass/lib/python3*/site-packages/miio

--- a/airqualitymonitor.py
--- b/airqualitymonitor.py
@@ -17,7 +17,6 @@
 AVAILABLE_PROPERTIES_COMMON = [
     "power",
     "aqi",
-    "battery",
     "usb_state",
     "time_state",
     "night_state",
@@ -28,7 +27,7 @@

 AVAILABLE_PROPERTIES_B1 = ["co2e", "humidity", "pm25", "temperature", "tvoc"]

-AVAILABLE_PROPERTIES_S1 = ["battery", "co2", "humidity", "pm25", "temperature", "tvoc"]
+AVAILABLE_PROPERTIES_S1 = ["co2", "humidity", "pm25", "temperature", "tvoc"]

 AVAILABLE_PROPERTIES = {
     MODEL_AIRQUALITYMONITOR_V1: AVAILABLE_PROPERTIES_COMMON,
SergeyPomelov commented 1 month ago

Local fix - that's what I did years ago. You missed the point: there are no obligations to fix the issue or even to reply. However, there is an obligation to respect others' input. Simply removing valid and informative bug reports doesn't benefit the community. I have never done that in projects where I am a developer. If I had to use an alike blunt bot, instead of removing valued input, I would mark the components as unsupported/abandoned to avoid wasting anyone's time. I have left dozens of my filled issues to the bot shredder and won't post new ones. From my experience, many users have already silently lost any motivation to report because of that.

ildar170975 commented 1 month ago

There are plenty of issues in HA core & frontend w/o any feedback from devs, and these issues can be just auto-closed.