mill1000 / midea-msmart

Python library for local control of Midea (and associated brands) smart air conditioners.
MIT License
45 stars 2 forks source link

Air filter status not seen in homeassistant #142

Closed lpispek closed 2 weeks ago

lpispek commented 1 month ago

This is in HomeAssistant:

image

This is in mobile app:

image

mill1000 commented 1 month ago

Can you query the device state with msmart-ng --debug?

lpispek commented 1 month ago

I getting this: image image

I have some debug logs from HA:

home-assistant_midea_ac_2024-07-15T17-57-45.169Z.log

mill1000 commented 1 month ago

Sorry I had meant msmart-ng query --debug. The full command would be along the lines of msmart-ng query --debug <IP>

mill1000 commented 1 month ago

For good measure run smart-ng query --debug --capabilities too

lpispek commented 1 month ago

For good measure run smart-ng query --debug --capabilities too

DEBUG:asyncio:Using selector: EpollSelector
INFO:msmart.lan:Creating new connection to 192.168.254.15:6444.
DEBUG:msmart.lan:Connected to 192.168.254.15:6444.
INFO:msmart.lan:Authenticating with 192.168.254.15:6444.
DEBUG:msmart.lan:Sending data to 192.168.254.15:6444: 83700040200000006a064b0dc80acd873d4f94caa79badea068a3d17b55f93bf379b1548a07ff7e0357467bf7b4778e393125090f5388e07487ab4543f885428860d2d0e18921f78
DEBUG:msmart.lan:Received data from 192.168.254.15:6444: 837000402001b948ae8ca4f8f0353878eb42d8e55a51eefc1a0e7f9afbcd5d501d3d50e79f97bad0a1a04404d1582fd0ca4b7710317bae60e8366e113cc6f82ba6049abc159e3b2f
INFO:msmart.lan:Authentication successful. Expiration: 2024-07-16T10:02:47+00:00, Local key: 3dc00f0377ba336e0e83d91cee3151b7d785b93faf2030d36cd52fdcc2df6c79
INFO:msmart.cli:Querying device capabilities.
DEBUG:msmart.base_device:Sending command to 192.168.254.15:6444: aa0fac00000000000003b5010001e5a6
DEBUG:msmart.lan:Sending packet to 192.168.254.15:6444: 5a5a01115800200000000000573002160f0718145f540000008400000000000000000000000000000542065231b95b9123b7f675b1de90ae915c618b02ed2747fad73f2ffa0db1d3f9baadfb4b80cbcd81707dd73c6e9d29
DEBUG:msmart.lan:Sending data to 192.168.254.15:6444: 8370007e2066f1eaa6dd45408497f7181b1b9b04f4fcbbf7e47eca412dbe0f7e2d6d1afd110af626f5ed7f474172ce91643175394bb425bbd478ec3c2f09d8b957a933993dddf58d14dd0d069113be9cea5724b495cd89635779b5a91520b66c22061831bdb7688663f5de09446ef0fa4ce0aad49c9e91068efbe6e15f89f12a08ca021e1865
DEBUG:msmart.lan:Received data from 192.168.254.15:6444: 8370009e2063a559016cd59b22b0f40b8cf89110016c8383984ea8ff87261b62a3df4ced9a3639dccc7ae71275b1f774303444ddd66fa93035c5734ad47a45ae5831fcfd90334bb70d7e5f2e5686f75a1d0e96e2bfe209465b4920f80471f78ce7de800a4bad4d5318aaf42103bee6f39045ca90f1f17b946f1ee3e2751281cc5943d995ee9293d341e0e4be2ed467945b66bf431345d61dd97609cc01e91160d7c26419e5a0
DEBUG:msmart.lan:Received packet from 192.168.254.15:6444: 5a5a01117800208000000000073102160f0718145f540000008400000000000000000180000000001530de0917f0977e5489810ca402e8a3c3d5eb236c52bd02910eae00249ae9df04cce07ec260ce3a50d3005c21213b21a07cfa0f4048a36c739491af3ed778e55316ed200b2ae97cacf954b0207da443
DEBUG:msmart.lan:Received response from 192.168.254.15:6444: aa39ac00000000000303b50912020101180001001402010115020101160201001a020101100201011f020103250207203c203c203c0501001a25
DEBUG:msmart.base_device:Response from 192.168.254.15:6444 in 0.140000 seconds.
DEBUG:msmart.device.AC.command:Capabilities response payload: b50912020101180001001402010115020101160201001a020101100201011f020103250207203c203c203c050100
DEBUG:msmart.device.AC.command:Raw capabilities: {'eco_mode': True, 'eco_mode_2': False, 'silky_cool': False, 'heat_mode': True, 'cool_mode': True, 'dry_mode': True, 'auto_mode': True, 'swing_horizontal': True, 'swing_vertical': True, 'energy_stats': False, 'energy_setting': False, 'energy_bcd': False, 'turbo_heat': True, 'turbo_cool': True, 'fan_silent': False, 'fan_low': False, 'fan_medium': False, 'fan_high': False, 'fan_auto': False, 'fan_custom': True, 'humidity_auto_set': False, 'humidity_manual_set': True, 'cool_min_temperature': 16.0, 'cool_max_temperature': 30.0, 'auto_min_temperature': 16.0, 'auto_max_temperature': 30.0, 'heat_min_temperature': 16.0, 'heat_max_temperature': 30.0, 'decimals': True}
DEBUG:msmart.base_device:Sending command to 192.168.254.15:6444: aa10ac00000000000003b501010102c1c6
DEBUG:msmart.lan:Sending packet to 192.168.254.15:6444: 5a5a01115800200000000000023102160f0718145f540000008400000000000000000000000000004704d4f6cb7e757d97bb0fb355e696691c6cb0cecabc7672cd44e0d17faa57086ffcccdf10a2aac4658268bb6ba06085
DEBUG:msmart.lan:Sending data to 192.168.254.15:6444: 8370007e2066bcfd5290198d211ef88ef31406083058ccb6979c8ee048d1dbf64e7aa2a8f8c7163db090034c80521b669e7cee2e11d363b6da23eb3de0ec445e0289474be0bf5dfed043e505d6534535b791c19079d6f97e0e160e3d56aa4d94e5258f564c298f4f17c26fa53398f938b65c536f85c6e006fb70a603723b9e39ce9fa4d26dd8
DEBUG:msmart.lan:Received data from 192.168.254.15:6444: 8370009e2063d731a69e569db5809d389ab8949825f94a3e3a00d1544eedd68788a4f75de995721c311cd27130443dbe8989c54c0fe6595f3bc0a30595d7bfc6d3d6db57990af2d73545d4bc9acc145b7bc2f5eced960ab42da2d05c1933bdee7034e8b9773a9c162f6f0f019c0586cacaf2e7d162e2cb067c375239ae0ae47f03de4406778b19cde3b0511cfc9c56c9c1986689ecbfff4b4b620c448f78a0737d72fab5dbea
DEBUG:msmart.lan:Received packet from 192.168.254.15:6444: 5a5a01117800208000000000953102160f0718145f540000008400000000000000000180000000004d8b7df3df9f0d46124174ecae72b07d5eab2881baca7cf77395a43aa7e53eabe69fd130628cec43922db841ecdb135df57323bdcaed7aa5ee57ac18f1fae1130e5bfd3f7ecc1b75d080c2da9e491352
DEBUG:msmart.lan:Received response from 192.168.254.15:6444: aa33ac00000000000303b5091e0201011302010122020100190201003900010142000101090001010a000101300001010000cd4e
DEBUG:msmart.base_device:Response from 192.168.254.15:6444 in 0.140000 seconds.
DEBUG:msmart.device.AC.command:Capabilities response payload: b5091e0201011302010122020100190201003900010142000101090001010a000101300001010000
DEBUG:msmart.device.AC.command:Raw capabilities: {'anion': True, 'freeze_protection': True, 'fahrenheit': True, 'aux_electric_heat': False, 'self_clean': True, 'one_key_no_wind_on_me': True, 'swing_vertical_angle': True, 'swing_horizontal_angle': True, 'smart_eye': True}
DEBUG:msmart.device.AC.command:Merged raw capabilities: {'eco_mode': True, 'eco_mode_2': False, 'silky_cool': False, 'heat_mode': True, 'cool_mode': True, 'dry_mode': True, 'auto_mode': True, 'swing_horizontal': True, 'swing_vertical': True, 'energy_stats': False, 'energy_setting': False, 'energy_bcd': False, 'turbo_heat': True, 'turbo_cool': True, 'fan_silent': False, 'fan_low': False, 'fan_medium': False, 'fan_high': False, 'fan_auto': False, 'fan_custom': True, 'humidity_auto_set': False, 'humidity_manual_set': True, 'cool_min_temperature': 16.0, 'cool_max_temperature': 30.0, 'auto_min_temperature': 16.0, 'auto_max_temperature': 30.0, 'heat_min_temperature': 16.0, 'heat_max_temperature': 30.0, 'decimals': True, 'anion': True, 'freeze_protection': True, 'fahrenheit': True, 'aux_electric_heat': False, 'self_clean': True, 'one_key_no_wind_on_me': True, 'swing_vertical_angle': True, 'swing_horizontal_angle': True, 'smart_eye': True}
INFO:msmart.cli:{'supported_modes': [<OperationalMode.FAN_ONLY: 5>, <OperationalMode.DRY: 3>, <OperationalMode.COOL: 2>, <OperationalMode.HEAT: 4>, <OperationalMode.AUTO: 1>], 'supported_swing_modes': [<SwingMode.OFF: 0>, <SwingMode.HORIZONTAL: 3>, <SwingMode.VERTICAL: 12>, <SwingMode.BOTH: 15>], 'supported_fan_speeds': [<FanSpeed.SILENT: 20>, <FanSpeed.LOW: 40>, <FanSpeed.MEDIUM: 60>, <FanSpeed.HIGH: 80>, <FanSpeed.AUTO: 102>], 'supports_custom_fan_speed': True, 'supports_eco_mode': True, 'supports_turbo_mode': True, 'supports_freeze_protection_mode': True, 'supports_display_control': False, 'supports_filter_reminder': False, 'max_target_temperature': 30.0, 'min_target_temperature': 16.0}
lpispek commented 1 month ago

Sorry I had meant msmart-ng query --debug. The full command would be along the lines of msmart-ng query --debug <IP>

DEBUG:asyncio:Using selector: EpollSelector
INFO:msmart.lan:Creating new connection to 192.168.254.15:6444.
DEBUG:msmart.lan:Connected to 192.168.254.15:6444.
INFO:msmart.lan:Authenticating with 192.168.254.15:6444.
DEBUG:msmart.lan:Sending data to 192.168.254.15:6444: 83700040200000006a064b0dc80acd873d4f94caa79badea068a3d17b55f93bf379b1548a07ff7e0357467bf7b4778e393125090f5388e07487ab4543f885428860d2d0e18921f78
DEBUG:msmart.lan:Received data from 192.168.254.15:6444: 837000402001b94851aa8b0a560c0c555758493ae18ee807112861688f12b5d48eb45f3ceae8078476d395e25ad169543010b83cb3ceb337d53f89c255d78b024639d3ded959bbcf
INFO:msmart.lan:Authentication successful. Expiration: 2024-07-16T10:04:16+00:00, Local key: 82c3bbe1003a0789fae7e8fb7e14e05206120ada4c978337af7b9d3818615e9d
INFO:msmart.cli:Querying device state.
DEBUG:msmart.base_device:Sending command to 192.168.254.15:6444: aa21ac00000000000003418100ff03ff0002000000000000000000000000030169fe
DEBUG:msmart.lan:Sending packet to 192.168.254.15:6444: 5a5a01116800200000000000081104160f0718145f5400000084000000000000000000000000000065cd8728fc6a5d31e6464235e81fa3b3e10c552981b23022cb71ea0fc54dc25e29ff4bed361a3a2fbe593a9d1a72103560dab944e7e7f997a9fc59032f0057de
DEBUG:msmart.lan:Sending data to 192.168.254.15:6444: 8370008e2066695bc3453e90f6c37cc01c98730fa3f751325b4193692c3a2d6a1c519e1a5268890725ae443e061138090d22dcbb95ffbe97054546820ff4a7d8eb289ce757670d9c2b20cffb53c7487476721e9b8004cd72cd38ca8e162b288194f2b7e25ab5b7d82ae2cd55fd21110bc9dec5cf7c836bf3ae0f32205e8ed4bbf6129e769f5279b30bcbca0be816d6acd9280ad9422d
DEBUG:msmart.lan:Received data from 192.168.254.15:6444: 8370008e2063b87b7db50c8dff6d0b3466c65750f074b80c97346151b1204fbf90bbacbee82b6c82d6ad47cbaab77ad6ed1f8df2106577f649b42045bc6ab7c53d6c02054cd56ea91bd0e9508b0f2ac470bce389c342457deb62b5698970105c1667e13808ce0c7ec1998d18fa15bb16c97b2681749c49f1caecb1e79591ee383969195d7277cc38654075a4a06641a4748c098dacfd
DEBUG:msmart.lan:Received packet from 192.168.254.15:6444: 5a5a01116800208000000000d41104160f0718145f540000008400000000000000000180000000002d4fcae04d1e3e04d5236de487bd83b5fcf3a3575093c51908c762ad421d9988f363a4fa3ab04ebbe7659daa2f951885836c80b3a066c3038f73d16f0d4ba33b
DEBUG:msmart.lan:Received response from 192.168.254.15:6444: aa28ac00000000000303c0014a667f7f0033000000666a0e00020000001e000000000000000001bfc6
DEBUG:msmart.base_device:Response from 192.168.254.15:6444 in 0.140000 seconds.
DEBUG:msmart.device.AC.command:State response payload: c0014a667f7f0033000000666a0e00020000001e000000000000000001
DEBUG:msmart.base_device:Sending command to 192.168.254.15:6444: aa20ac00000000000003412101450000000000000000000000000000000002b6d1
DEBUG:msmart.lan:Sending packet to 192.168.254.15:6444: 5a5a01116800200000000000161104160f0718145f540000008400000000000000000000000000008e34b4a0dc5b17d068e7428ef3c24da3b7137d94a0bcccdb4faeb178225166edd552dc387dd44c9da6ad74580560b54c9dc4f24a44e210cd98091d407c6751e2
DEBUG:msmart.lan:Sending data to 192.168.254.15:6444: 8370008e20665210fda6702cc92ac81a7bc1451f2214dc8445d420135b12eac2ae8d321fdfe3733c129147613bb36dc4cf4921201389a6e3a02f419c53a35c6240ef9058db98ba6c4b2154362a959ff94920ca6c1cdbd1638fb1f008faf9564303b8ee70847e9b7ff857e1345e685ded6305c7b25dd4e5c070cee72ae2bb72a7bf42dcb8ffc5b5b7b3cf52f889cca6e802f4ee5aef07
DEBUG:msmart.lan:Received data from 192.168.254.15:6444: 8370008e2063de418ea5f758a96c0e3425f580f3f37883a3ade3c4a7d620dc2c3d256b84535125ea13d5c1130f2794cc98f770315816130cc30b79bd0dcb43eefed0d9ff0557770ff5557f9266970212dce93f002d3688bba36e63af34096f9c740f378f75040614de10b2f7b6e235fbbcbd84408ea68417aea0359c8dad361c200b962fae791f6099f9df0adef39f720c469e89e2c5
DEBUG:msmart.lan:Received packet from 192.168.254.15:6444: 5a5a01116800208000000000615104160f0718145f54000000840000000000000000018000000000eb69337928b750304e23fe675e4b4623dd82b644d1ce7532aaa4deb49b64d16b017d89c929cfc331e0389c024f6645b32cb468a84cdecaebed4f7555d1748b8a
DEBUG:msmart.lan:Received response from 192.168.254.15:6444: aa20ac00000000000303c121014528521020572600000003860d00c7790002e522
DEBUG:msmart.base_device:Response from 192.168.254.15:6444 in 0.140000 seconds.
DEBUG:msmart.device.AC.command:Humidity response payload: c121014528521020572600000003860d00c7790002
INFO:msmart.cli:{'ip': '192.168.254.15', 'port': 6444, 'id': 145135534888031, 'online': True, 'supported': True, 'type': <DeviceType.AIR_CONDITIONER: 172>, 'name': None, 'sn': None, 'key': 'fd2e72c23e3548b9a648a4c8828a2f60cb5c44e9d1414c04aa05d20bb5d311ae', 'token': '6a064b0dc80acd873d4f94caa79badea068a3d17b55f93bf379b1548a07ff7e0357467bf7b4778e393125090f5388e07487ab4543f885428860d2d0e18921f78', 'power': True, 'mode': <OperationalMode.COOL: 2>, 'fan_speed': <FanSpeed.AUTO: 102>, 'swing_mode': <SwingMode.HORIZONTAL: 3>, 'horizontal_swing_angle': <SwingAngle.OFF: 0>, 'vertical_swing_angle': <SwingAngle.OFF: 0>, 'target_temperature': 26.0, 'indoor_temperature': 26.2, 'outdoor_temperature': 28.0, 'target_humidity': 30, 'indoor_humidity': 40, 'eco': False, 'turbo': False, 'freeze_protection': False, 'sleep': False, 'display_on': True, 'beep': False, 'fahrenheit': False, 'filter_alert': False, 'follow_me': False, 'purifier': False, 'total_energy_usage': None, 'current_energy_usage': None, 'real_time_power_usage': None}
mill1000 commented 1 month ago

Thanks. Your device doesn't report any filter capabilities... But the app sure does.

Does the device have an indicator that the filter needs cleaning?

There might be a property message that has this info instead.

Are you able to change the filter time from 250 hrs?

lpispek commented 1 month ago

Thanks. Your device doesn't report any filter capabilities... But the app sure does.

Does the device have an indicator that the filter needs cleaning?

No, the device doesn't have any indicator about the filter.

There might be a property message that has this info instead.

Are you able to change the filter time from 250 hrs?

Yes, I can change this value in the app and I can set the filter status to clean.

I think that this is not a feature of the device, I think it is cloud-based to track the working time of the device and after that suggest the cleaning of the filter. Maybe I'm wrong :)

mill1000 commented 1 month ago

I think that this is not a feature of the device, I think it is cloud-based to track the working time of the device and after that suggest the cleaning of the filter. Maybe I'm wrong :)

That's definitely crossed my mind too.

Lets try one more thing. Can you try running this example?

import asyncio
import logging

from msmart.device import AirConditioner as AC
from msmart.device.AC.command import GetPropertiesCommand

logging.basicConfig(level=logging.DEBUG)

DEVICE_IP = "YOUR_DEVICE_IP"
DEVICE_PORT = 6444
DEVICE_ID = "YOUR_DEVICE_ID"

# For V3 devices
DEVICE_TOKEN = None  # "YOUR_DEVICE_TOKEN"
DEVICE_KEY = None  # "YOUR_DEVICE_KEY"

async def main():
    device = AC(ip=DEVICE_IP, port=6444, device_id=int(DEVICE_ID))
    if DEVICE_TOKEN and DEVICE_KEY:
        await device.authenticate(DEVICE_TOKEN, DEVICE_KEY)

    command = GetPropertiesCommand([0x0409])
    command._protocol_version = 3
    for response in await device._send_command_get_responses(command):
        print(response)

if __name__ == "__main__":
    asyncio.run(main())
lpispek commented 1 month ago

Yes, I have run it:

DEBUG:asyncio:Using selector: EpollSelector
INFO:msmart.lan:Creating new connection to 192.168.254.15:6444.
DEBUG:msmart.lan:Connected to 192.168.254.15:6444.
INFO:msmart.lan:Authenticating with 192.168.254.15:6444.
DEBUG:msmart.lan:Sending data to 192.168.254.15:6444: 83700040200000006a064b0dc80acd873d4f94caa79badea068a3d17b55f93bf379b1548a07ff7e0357467bf7b4778e393125090f5388e07487ab4543f885428860d2d0e18921f78
DEBUG:msmart.lan:Received data from 192.168.254.15:6444: 837000402001b948979e514d2814632191ac880bc196c2122d0f790cb53bb1e54ff4900d6c0af7e5d3cec760098a749f3c3bc8b1cfbb53890544fe4acaf3490337b251a6633f155f
INFO:msmart.lan:Authentication successful. Expiration: 2024-07-17T03:56:55+00:00, Local key: 07d5ad059cf3914039a27332b17efb9de6fe1715aa6c9efb5e8383f46a92c050
DEBUG:msmart.base_device:Sending command to 192.168.254.15:6444: aa10ac00000000000303b101090401e698
DEBUG:msmart.lan:Sending packet to 192.168.254.15:6444: 5a5a011158002000000000005738380f100718145f5400000084000000000000000000000000000035a4f4d6b23798a8b545107ce592e4c916f2001661155e81a9c0a342a2e233052efe9d2ff21f8b9176c2782feab2b895
DEBUG:msmart.lan:Sending data to 192.168.254.15:6444: 8370007e20668c010635f0a8aaedb594331bbab78271daf7e40f1014a0b7189014ff6f87a0fca510b0df938e07318b4b5132a9c5db4597ddf612cb685c5fb95cc4e4c1a79471100fe1e151bf7a069a7a83dd84209d0f9a069fc467a08183b5744ffa3bb2f1ec1ec1b93b3f919dc4a122a02601cf0115fb320945780411c362ed4ac7bdbc7c7f
DEBUG:msmart.lan:Received data from 192.168.254.15:6444: 8370007e20636e1040bfe94f30de6b4e397bbd3065ec633bd3b2c045c32f850d1853837e96d590adc4eadf4b308ff1f79e80c3210d78ecd06f55e3ded93d1a5384052f204ae5cc6d4c99599e2c9a8f0a5f522a38cb78d848a9bc3355e9520e81bc6c4c616163121ae29f4e0dc09f27ef24c7244b65df399b8f2a16f1457bf2153a649b8dbd1c
DEBUG:msmart.lan:Received packet from 192.168.254.15:6444: 5a5a01115800208000000000c5f8380f100718145f540000008400000000000000000180000000006cc5826b9da6eca7286a56b9c2b7aadbd5d6325316d083852b52586a078c55b77f0a9c56e3c55ee243bc487d4e9a39d5
DEBUG:msmart.lan:Received response from 192.168.254.15:6444: aa12ac00000000000303b10109040000007409
DEBUG:msmart.base_device:Response from 192.168.254.15:6444 in 0.100000 seconds.
DEBUG:msmart.device.AC.command:Properties response payload: b1010904000000
<msmart.device.AC.command.PropertiesResponse object at 0x7a2251a9e810>
mill1000 commented 1 month ago

Thanks. Looks like that property isn't supported.

Might be a cloud-based solution like you said before.

lpispek commented 1 month ago

Ok, thank you for the time and effort to check this out.

On Tue, 16 Jul 2024 at 18:08, Tucker Kern @.***> wrote:

Thanks. Looks like that property isn't supported.

Might be a cloud-based solution like you said before.

— Reply to this email directly, view it on GitHub https://github.com/mill1000/midea-msmart/issues/142#issuecomment-2231315915, or unsubscribe https://github.com/notifications/unsubscribe-auth/APKM6CTPEM6S3UGD4CNQRRDZMVAPRAVCNFSM6AAAAABK4KXXYKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEMZRGMYTKOJRGU . You are receiving this because you authored the thread.Message ID: @.***>