mill1000 / midea-ac-py

Home Assistant custom integration to control Midea (and associated brands) air conditioners via LAN.
MIT License
154 stars 16 forks source link

Midea AC intermittedly becomes unavailable. #254

Open Merril-r opened 1 month ago

Merril-r commented 1 month ago

Goodday,

I have noticed that my midea ac becomes unavailable then available intermittedly. This is my first time installing the integration. This happens on two of my units.

Diagnostic log.

{
  "home_assistant": {
    "installation_type": "Home Assistant OS",
    "version": "2024.10.1",
    "dev": false,
    "hassio": true,
    "virtualenv": false,
    "python_version": "3.12.4",
    "docker": true,
    "arch": "x86_64",
    "timezone": "Africa/Johannesburg",
    "os_name": "Linux",
    "os_version": "6.6.46-haos",
    "supervisor": "2024.10.0",
    "host_os": "Home Assistant OS 13.1",
    "docker_version": "26.1.4",
    "chassis": "vm",
    "run_as_root": true
  },
  "custom_components": {
    "hacs": {
      "documentation": "https://hacs.xyz/docs/configuration/start",
      "version": "2.0.1",
      "requirements": [
        "aiogithubapi>=22.10.1"
      ]
    },
    "midea_ac": {
      "documentation": "https://github.com/mill1000/midea-ac-py",
      "version": "2024.10.1",
      "requirements": [
        "msmart-ng>=2024.9.0"
      ]
    },
    "alexa_media": {
      "documentation": "https://github.com/alandtse/alexa_media_player/wiki",
      "version": "4.13.4",
      "requirements": [
        "alexapy==1.29.2",
        "packaging>=20.3",
        "wrapt>=1.14.0"
      ]
    },
    "sonoff": {
      "documentation": "https://github.com/AlexxIT/SonoffLAN",
      "version": "3.8.1",
      "requirements": [
        "pycryptodome>=3.6.6"
      ]
    }
  },
  "integration_manifest": {
    "domain": "midea_ac",
    "name": "Midea Smart AC",
    "codeowners": [
      "mill1000"
    ],
    "config_flow": true,
    "dependencies": [],
    "documentation": "https://github.com/mill1000/midea-ac-py",
    "iot_class": "local_polling",
    "issue_tracker": "https://github.com/mill1000/midea-ac-py/issues",
    "loggers": [
      "msmart"
    ],
    "requirements": [
      "msmart-ng>=2024.9.0"
    ],
    "version": "2024.10.1",
    "is_built_in": false
  },
  "setup_times": {
    "null": {
      "setup": 1.549581065773964e-05
    },
    "01JA5CHM2YVWTFG4TPNDWRSNC9": {
      "wait_import_platforms": -0.0020050639286637306,
      "config_entry_setup": 1.9061271317768842
    }
  },
  "data": {
    "config_entry": {
      "created_at": "2024-10-14T11:27:49.342264+00:00",
      "data": {
        "id": 30786325851843,
        "host": "172.16.40.24",
        "port": 6444,
        "token": "**REDACTED**",
        "k1": "**REDACTED**"
      },
      "discovery_keys": {},
      "disabled_by": null,
      "domain": "midea_ac",
      "entry_id": "01JA5CHM2YVWTFG4TPNDWRSNC9",
      "minor_version": 2,
      "modified_at": "2024-10-14T11:27:49.342267+00:00",
      "options": {
        "prompt_tone": true,
        "temp_step": 1.0,
        "fan_speed_step": 1,
        "use_fan_only_workaround": false,
        "show_all_presets": false,
        "additional_operation_modes": null,
        "max_connection_lifetime": null,
        "use_alternate_energy_format": false
      },
      "pref_disable_new_entities": false,
      "pref_disable_polling": false,
      "source": "user",
      "title": "midea_ac 30786325851843",
      "unique_id": "30786325851843",
      "version": 1
    },
    "device": {
      "ip": "172.16.40.24",
      "port": 6444,
      "id": 30786325851843,
      "online": true,
      "supported": true,
      "type": 172,
      "name": null,
      "sn": null,
      "key": "**REDACTED**",
      "token": "**REDACTED**",
      "supported_modes": [
        5,
        3,
        2,
        4,
        1
      ],
      "supported_swing_modes": [
        0,
        3,
        12,
        15
      ],
      "supported_fan_speeds": [
        20,
        40,
        60,
        80,
        102,
        100
      ],
      "supports_custom_fan_speed": true,
      "supported_rate_selects": [
        100
      ],
      "supports_eco": true,
      "supports_ieco": false,
      "supports_turbo": true,
      "supports_freeze_protection": true,
      "supports_display_control": false,
      "supports_filter_reminder": false,
      "supports_self_clean": true,
      "supports_purifier": true,
      "supports_humidity": false,
      "supports_target_humidity": false,
      "supports_vertical_swing_angle": true,
      "supports_horizontal_swing_angle": true,
      "supports_breezeless": false,
      "supports_breeze_mild": false,
      "supports_breeze_away": true,
      "enable_energy_usage_requests": true,
      "use_alternate_energy_format": false,
      "_supported_properties": [
        9,
        10,
        66,
        57
      ]
    }
  }
}
mill1000 commented 1 month ago

Try setting the maximum connection lifetime. https://github.com/mill1000/midea-ac-py?tab=readme-ov-file#resolving-connectivity-issues

Merril-r commented 1 month ago

Try setting the maximum connection lifetime. https://github.com/mill1000/midea-ac-py?tab=readme-ov-file#resolving-connectivity-issues

I made the change you mentioned. Still getting the intermittent unavailable. Sometimes it stays unavailable then I have to restart the integration a couple of times.

I have also included a debug file that I recorded when the integration become unavaialble.

home-assistant_midea_ac_freezing-2024-10-15T06-46-00.354Z.log

mill1000 commented 1 month ago

Can you keep debugging enabled and restart HA? I can't quite follow what happened to your device but it appears to be rejecting the authentication process.

Merril-r commented 1 month ago

Can you keep debugging enabled and restart HA? I can't quite follow what happened to your device but it appears to be rejecting the authentication process.

I did a reboot with debugging enabled home-assistant_midea_ac_2024-10-16T08-14-28.355Z.log

mill1000 commented 1 month ago

Thanks. Some disconnects are occurring on a 60s interval. Try reducing your connection lifetime to 45 seconds.

Merril-r commented 1 month ago

Thanks. Some disconnects are occurring on a 60s interval. Try reducing your connection lifetime to 45 seconds.

I will try that and monitor. I will keep you posted

mill1000 commented 2 weeks ago

How's it going? I'm assuming no news might be good news?

Merril-r commented 2 weeks ago

How's it going? I'm assuming no news might be good news?

The freezing is still there but a lot less from what I can pick up

mill1000 commented 1 week ago

Well if you can grab a debug log of a long session e.g. 1 hour+ I could take another look.