wuwentao / midea_ac_lan

Auto-configure and then control your Midea M-Smart devices (Air conditioner, Fan, Water heater, Washer, etc) via local area network.
MIT License
230 stars 10 forks source link

current_energy_consumptionn and realtime_power at 0 not being reported. #293

Closed WickedInvi closed 2 weeks ago

WickedInvi commented 3 weeks ago

HA core version

2024.7.2

Current integration version

v0.5.7

Last known working integration version

None

Device type and model

Air Conditioner 00000Q1A (0)

Working mobile app

NetHome Plus

The description of problem

I've had this issue for a while but never got around to reporting, I seen someone mention in another closed issue that the AC might not have the capabilities, but in that issue the return for all total_energy_consumption, current_energy_consumptionn, and realtime_power was 0. I have total_energy_consumption but realtime_power and current_energy_consumption are 0. Is this something that is possibly a bug or the AC does not sent the data?

The logs

HA AC Midea Log 22.08.24 13.15.txt

2024-08-22 13:17:14.287 DEBUG (AC) [midealocal.device] [153931628282338] Sending: {'header': 'aa20ac00000000000003', 'body': '418100ff00000000000000000000000000000000420f', 'message type': '.03', 'body type': '.41'}
2024-08-22 13:17:14.288 DEBUG (AC) [midealocal.device] [153931628282338] Sending: {'header': 'aa11ac00000000000003', 'body': '41210144000109', 'message type': '.03', 'body type': '.41'}
2024-08-22 13:17:15.211 DEBUG (AC) [midealocal.devices.ac] [153931628282338] Received: {'header': 'aa22ac00000000000303', 'body': 'c00129667f7f003f000000615d0000000000000000001f16', 'message type': '.03', 'body type': '.c0'}
2024-08-22 13:17:15.211 DEBUG (AC) [midealocal.device] [153931628282338] Status update: {'power': True, 'mode': 1, 'target_temperature': 25.0, 'fan_speed': 102, 'swing_vertical': True, 'swing_horizontal': True, 'smart_eye': False, 'dry': False, 'aux_heating': False, 'boost_mode': False, 'sleep_mode': False, 'frost_protect': False, 'comfort_mode': True, 'eco_mode': False, 'natural_wind': False, 'temp_fahrenheit': False, 'screen_display': True, 'full_dust': False, 'indoor_temperature': 23.0, 'outdoor_temperature': 21.0, 'indirect_wind': False}
2024-08-22 13:17:15.620 DEBUG (AC) [midealocal.devices.ac] [153931628282338] Received: {'header': 'aa1fac00000000000303', 'body': 'c12101440001020600000000000000000000000014', 'message type': '.03', 'body type': '.c1'}
2024-08-22 13:17:15.620 DEBUG (AC) [midealocal.device] [153931628282338] Status update: {'total_energy_consumption': 102.06, 'current_energy_consumption': 0.0, 'realtime_power': 0.0}
2024-08-22 13:17:29.645 DEBUG (AC) [midealocal.device] [153931628282338] Sending: {'header': 'aa20ac00000000000003', 'body': '418100ff00000000000000000000000000000000458c', 'message type': '.03', 'body type': '.41'}
2024-08-22 13:17:29.647 DEBUG (AC) [midealocal.device] [153931628282338] Sending: {'header': 'aa11ac00000000000003', 'body': '41210144000109', 'message type': '.03', 'body type': '.41'}
2024-08-22 13:17:30.572 DEBUG (AC) [midealocal.devices.ac] [153931628282338] Received: {'header': 'aa22ac00000000000303', 'body': 'c00129667f7f003f000000615d0000000000000000009f9a', 'message type': '.03', 'body type': '.c0'}
2024-08-22 13:17:30.572 DEBUG (AC) [midealocal.device] [153931628282338] Status update: {'power': True, 'mode': 1, 'target_temperature': 25.0, 'fan_speed': 102, 'swing_vertical': True, 'swing_horizontal': True, 'smart_eye': False, 'dry': False, 'aux_heating': False, 'boost_mode': False, 'sleep_mode': False, 'frost_protect': False, 'comfort_mode': True, 'eco_mode': False, 'natural_wind': False, 'temp_fahrenheit': False, 'screen_display': True, 'full_dust': False, 'indoor_temperature': 23.0, 'outdoor_temperature': 21.0, 'indirect_wind': False}
2024-08-22 13:17:30.907 DEBUG (AC) [midealocal.devices.ac] [153931628282338] Received: {'header': 'aa1fac00000000000303', 'body': 'c121014400010207000000000000000000000000b3', 'message type': '.03', 'body type': '.c1'}
2024-08-22 13:17:30.907 DEBUG (AC) [midealocal.device] [153931628282338] Status update: {'total_energy_consumption': 102.07, 'current_energy_consumption': 0.0, 'realtime_power': 0.0}
2024-08-22 13:17:40.719 WARNING (SyncWorker_2) [homeassistant.helpers.frame] Detected that custom integration 'hass_agent' calls device_registry.async_update_device from a thread other than the event loop, which may cause Home Assistant to crash or data to corrupt. For more information, see https://developers.home-assistant.io/docs/asyncio_thread_safety/#device_registryasync_update_device at custom_components/hass_agent/__init__.py, line 29: device_registry.async_get_or_create(, please report it to the author of the 'hass_agent' custom integration
2024-08-22 13:17:40.721 ERROR (SyncWorker_2) [homeassistant.util.logging] Exception in updated when handling msg on 'hass.agent/devices/main_desktop': '{"serial_number":"2ebf97b6-2dd1-48bb-876a-cbbc4ff8a8ed","device":{"identifiers":"hass.agent-main_desktop","manufacturer":"HASS.Agent Team","model":"Microsoft Windows NT 10.0.22631.0","name":"main_desktop","sw_version":"2.0.1"},"apis":{"notifications":true,"media_player":true}}'
Traceback (most recent call last):
  File "/config/custom_components/hass_agent/__init__.py", line 144, in updated
    update_device_info(hass, entry, payload)
  File "/config/custom_components/hass_agent/__init__.py", line 29, in update_device_info
    device_registry.async_get_or_create(
  File "/usr/src/homeassistant/homeassistant/helpers/device_registry.py", line 799, in async_get_or_create
    device = self.async_update_device(
             ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/device_registry.py", line 1024, in async_update_device
    self.hass.verify_event_loop_thread("device_registry.async_update_device")
  File "/usr/src/homeassistant/homeassistant/core.py", line 463, in verify_event_loop_thread
    frame.report_non_thread_safe_operation(what)
  File "/usr/src/homeassistant/homeassistant/helpers/frame.py", line 225, in report_non_thread_safe_operation
    report(
  File "/usr/src/homeassistant/homeassistant/helpers/frame.py", line 159, in report
    _report_integration(what, integration_frame, level, error_if_integration)
  File "/usr/src/homeassistant/homeassistant/helpers/frame.py", line 197, in _report_integration
    raise RuntimeError(
RuntimeError: Detected that custom integration 'hass_agent' calls device_registry.async_update_device from a thread other than the event loop, which may cause Home Assistant to crash or data to corrupt. For more information, see https://developers.home-assistant.io/docs/asyncio_thread_safety/#device_registryasync_update_device at custom_components/hass_agent/__init__.py, line 29: device_registry.async_get_or_create(. Please report it to the author of the 'hass_agent' custom integration.

2024-08-22 13:17:44.940 DEBUG (AC) [midealocal.device] [153931628282338] Sending: {'header': 'aa20ac00000000000003', 'body': '418100ff000000000000000000000000000000004871', 'message type': '.03', 'body type': '.41'}
2024-08-22 13:17:44.941 DEBUG (AC) [midealocal.device] [153931628282338] Sending: {'header': 'aa11ac00000000000003', 'body': '41210144000109', 'message type': '.03', 'body type': '.41'}
2024-08-22 13:17:45.840 DEBUG (AC) [midealocal.devices.ac] [153931628282338] Received: {'header': 'aa22ac00000000000303', 'body': 'c00129667f7f003f000000615d000000000000000000b77b', 'message type': '.03', 'body type': '.c0'}
2024-08-22 13:17:45.840 DEBUG (AC) [midealocal.device] [153931628282338] Status update: {'power': True, 'mode': 1, 'target_temperature': 25.0, 'fan_speed': 102, 'swing_vertical': True, 'swing_horizontal': True, 'smart_eye': False, 'dry': False, 'aux_heating': False, 'boost_mode': False, 'sleep_mode': False, 'frost_protect': False, 'comfort_mode': True, 'eco_mode': False, 'natural_wind': False, 'temp_fahrenheit': False, 'screen_display': True, 'full_dust': False, 'indoor_temperature': 23.0, 'outdoor_temperature': 21.0, 'indirect_wind': False}
2024-08-22 13:17:46.241 DEBUG (AC) [midealocal.devices.ac] [153931628282338] Received: {'header': 'aa1fac00000000000303', 'body': 'c121014400010207000000000000000000000000b3', 'message type': '.03', 'body type': '.c1'}
2024-08-22 13:17:46.241 DEBUG (AC) [midealocal.device] [153931628282338] Status update: {'total_energy_consumption': 102.07, 'current_energy_consumption': 0.0, 'realtime_power': 0.0}
wuwentao commented 2 weeks ago

@WickedInvi from your message, these value really zero and only total_energy_consumption have value, i'm not sure with the reason now,

some question need to confirm:

  1. could you provide your device SN to double check it.
  2. these power/energy value already available in your NetHome Plus or any Midea official app?
WickedInvi commented 2 weeks ago

I am not sure if it works with Midea app, NetHome Plus was the recommended with the AC. In the App no readings are available. In about device on the app the Terminal Barcode is P0000000Q1AC93C4239F04, I need to look for the documents from it to confirm if that is the SN or something else.

wuwentao commented 2 weeks ago

thanks, it should be the SN, just checked with it, seems it's a very old device? the SN also not match with the latest SN format.

so for this total_energy_consumption is always the same value for your device and don't have any changes, as this device not support this feature, it required new HW module to support it.

I bought 4 AC device in the year of 2021(in China), also not support these power/energy feature, all the value is 0.

This year I just replaced a old Midea air conditioner that my parents had used for at least fifteen years with a new one, it support this feature, and i can got the value from both Midea app and current HomeAssistant integration.

so I think it should not a bug, and just this device not support it, as your device don't have this hardware module to support this software feature.

@WickedInvi

WickedInvi commented 2 weeks ago

We just purchased in July, I've checked SN on the side 540E923820624220130358, it's Rotenso Imoto I50Xi R14 Total is on going and working. image

wuwentao commented 2 weeks ago

thanks, both SN should got the same lua script result, it's the same one, and not have power/energy support. the feature should based on device hardware module, so I'm not sure with it.

and from the HEX packets that device query and response, we can only found total_energy_consumption have value, and no current/realtime value. is this total_energy_consumption value works as the expected result?

maybe you can contact with the seller to confirm this feature support.

WickedInvi commented 2 weeks ago

I had it connected to a smart plug to test consumption and it seemed accurate enough, but it is strange because I would expect that to know the total it needs to know what is using. I remember reading about the module, and even had it saved somewhere I think to buy at a later day. I do think he would know I will close this for now as seems like it a hardware/device issue rather than the integration.

Thank you for your help.

wuwentao commented 2 weeks ago

yes, if the device hardware not send these data to us, we can't parse and save these data for you to view.