K02 WIFI USB with NetHome app

did you copy the example setup file to settings.py file and check the permission ?
i got it running, but have the following problems:

tried with api key from example
starting the script sets my AC to fan mode 17°C
i can controll it via openhab but as soon the refresh get triggered all values are back to default
(fan mode 17°C)
next question after solving the issue is how to run automatic start of the .py script after OH is up
any idea?

Thanks
Thomas

here the log,

we can see that first the current cloud values are overwritten by fan mode and 17°C
then i switch to cooling mode 22°C (via OH) Web interface
and after next poll the values get back to 17°C fan :frowning:

$ python3 main.py
2019-06-19 17:40:20,811 API call user/login/id/get: {'loginAccount': 'XXXXXX@gmx.net', 'clientType': 1, 'stamp': '20190619174020', 'language': 'en_US', 'appId': 1017, 'sign': '2ad959273f1f185cde7d9001de65e640f5239711a6ef1fc158ddbf2f347f46bc', 'format': 2, 'src': 17}
2019-06-19 17:40:21,137 Call to login with d055e17b-fecd-48ef-9291-8f585dd3b187 XXXXXX@gmx.net XXXXXX
2019-06-19 17:40:21,140 API call user/login: {'loginAccount': 'XXXXXX@gmx.net', 'clientType': 1, 'stamp': '20190619174021', 'language': 'en_US', 'appId': 1017, 'password': 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX', 'sign': '6c221a6ba7dc9e6bfb1b930afd9140b530a42f328c2c620212cad72e3ce8c720', 'format': 2, 'src': 17}
2019-06-19 17:40:22,237 API call homegroup/list/get: {'clientType': 1, 'stamp': '20190619174022', 'language': 'en_US', 'sessionId': 'a9667604410948fea3e5d1e3146383f220190619154021361', 'appId': 1017, 'sign': 'cce8d30758f00ac444a2a033cdfaf189e2ccd69b67147278c086fc7ed9496b62', 'format': 2, 'src': 17}
2019-06-19 17:40:22,534 API call appliance/list/get: {'clientType': 1, 'stamp': '20190619174022', 'language': 'en_US', 'sessionId': 'a9667604410948fea3e5d1e3146383f220190619154021361', 'appId': 1017, 'sign': 'c7ab3690d63c1ae439d2d9eb858d0e42df8bc867a919d82c1a1b13f2bacb3aa7', 'homegroupId': '589540', 'format': 2, 'src': 17}
2019-06-19 17:40:23,065 Device list: [{'type': '0xAC', 'sn': '05ba13cf6eb7d90483d19350b6f9fb70ae4dd78ba5af74dfe0ea0c9f068dcbde649a1e6b83327f969ecf5c2a6e6028ae', 'des': '', 'name': 'Schlafzimmer', 'activeStatus': '1', 'onlineStatus': '1', 'modelNumber': '0', 'id': '16492674433370'}, {'type': '0xAC', 'sn': '05ba13cf6eb7d90483d19350b6f9fb70243ae6f0e3dcdc48b1a1943d05a23cac649a1e6b83327f969ecf5c2a6e6028ae', 'des': '', 'name': 'Wohnzimmer', 'activeStatus': '1', 'onlineStatus': '1', 'modelNumber': '0', 'id': '16492674456715'}]
2019-06-19 17:40:23,068 Refreshing Wohnzimmer
2019-06-19 17:40:23,070 Sending to 16492674456715: 5a5a01115700200000000000000000000e031214c679000000050a00000000000000000002000000aa1eac00000000000302408100ff03ff00300000000000000000000003bb8100000000000000000000000000000000
2019-06-19 17:40:23,075 API call appliance/transparent/send: {'applianceId': '16492674456715', 'clientType': 1, 'stamp': '20190619174023', 'language': 'en_US', 'sessionId': 'a9667604410948fea3e5d1e3146383f220190619154021361', 'appId': 1017, 'sign': 'df541bfc1dd7db61b22d8f7f9f46e8d11ca0e392478af8790da51db41b50146d', 'order': 'f6a7018c7a1300cfd29bbfde235b725e03020e687ed0d3cfc116c714c8237fb128f48fbc4b9053c57bc2a3860dad41a7d29cc12dd2c9123a805657f00ac40d3115775d291c8852615fc6c654e36784f32f9a90c42bb597e226f731131925f2a7b42ba73a39f70e96f911536c232fbed9d7fc0e2685604a83f8b2a015c3be81d64fd194b9181f08fcccbe11c4dd6c6ee6e7e60cc51ca89f95d46d3fddf0a30ff21f664a9618aa3d5d830cb26ec0605af9e75db8079f6717522bef6275d1a34bd9ab601d856f561cb97015da2f13153d9a', 'format': 2, 'src': 17, 'funId': '0000'}
2019-06-19 17:40:24,257 Received from 16492674456715: 5a5a01005b0020800000000000000000000000008b9c0000000f0000000000000000000001000000aa22ac00000000000302c001a1667f7f00300000005f7d000000000000000000581ce700000000000000000000000000000000
2019-06-19 17:40:24,258 Appliance response data: c001a1667f7f00300000005f7d000000000000000000581ce700000000000000000000000000000000
2019-06-19 17:40:24,260 Setting OH: ac_Wohnzimmer_turbo_mode (turbo_mode) = OFF
2019-06-19 17:40:24,295 Setting OH: ac_Wohnzimmer_swing_mode (swing_mode) = 0.0
2019-06-19 17:40:24,318 Setting OH: ac_Wohnzimmer_power_state (power_state) = ON
2019-06-19 17:40:24,344 Setting OH: ac_Wohnzimmer_operational_mode (operational_mode) = 5.0
2019-06-19 17:40:24,368 Setting OH: ac_Wohnzimmer_target_temperature (target_temperature) = 17.0
2019-06-19 17:40:24,391 Setting OH: ac_Wohnzimmer_online (online) = ON
2019-06-19 17:40:24,416 Setting OH: ac_Wohnzimmer_indoor_temperature (indoor_temperature) = 22.5
2019-06-19 17:40:24,440 Setting OH: ac_Wohnzimmer_active (active) = ON
2019-06-19 17:40:24,463 Setting OH: ac_Wohnzimmer_fan_speed (fan_speed) = 102.0
2019-06-19 17:40:24,485 Setting OH: ac_Wohnzimmer_outdoor_temperature (outdoor_temperature) = 37.5
2019-06-19 17:40:24,510 Setting OH: ac_Wohnzimmer_eco_mode (eco_mode) = OFF
2019-06-19 17:40:24,531 Refreshing Schlafzimmer
2019-06-19 17:40:24,532 Sending to 16492674433370: 5a5a01115700200000000000000000000e031214c679000000050a00000000000000000002000000aa1eac00000000000302408100ff03ff00300000000000000000000003bb8100000000000000000000000000000000
2019-06-19 17:40:24,535 API call appliance/transparent/send: {'applianceId': '16492674433370', 'clientType': 1, 'stamp': '20190619174024', 'language': 'en_US', 'sessionId': 'a9667604410948fea3e5d1e3146383f220190619154021361', 'appId': 1017, 'sign': '05dae5e0be03fd38d86ece4ab5c48fdd1d08497f752f6bcd7bc6ee01f77b217d', 'order': 'f6a7018c7a1300cfd29bbfde235b725e03020e687ed0d3cfc116c714c8237fb128f48fbc4b9053c57bc2a3860dad41a7d29cc12dd2c9123a805657f00ac40d3115775d291c8852615fc6c654e36784f32f9a90c42bb597e226f731131925f2a7b42ba73a39f70e96f911536c232fbed9d7fc0e2685604a83f8b2a015c3be81d64fd194b9181f08fcccbe11c4dd6c6ee6e7e60cc51ca89f95d46d3fddf0a30ff21f664a9618aa3d5d830cb26ec0605af9e75db8079f6717522bef6275d1a34bd9ab601d856f561cb97015da2f13153d9a', 'format': 2, 'src': 17, 'funId': '0000'}
2019-06-19 17:40:34,787 Error ignored: '3176' - 'The asyn reply does not exist '
2019-06-19 17:40:34,789 Retrying API call: 'appliance/transparent/send'
2019-06-19 17:40:34,791 API call appliance/transparent/send: {'applianceId': '16492674433370', 'clientType': 1, 'stamp': '20190619174034', 'language': 'en_US', 'sessionId': 'a9667604410948fea3e5d1e3146383f220190619154021361', 'appId': 1017, 'sign': '55926454f7573c1697d4ac1b1d23dbcee1e925692e810e6924b55b7f2bc89b42', 'order': 'f6a7018c7a1300cfd29bbfde235b725e03020e687ed0d3cfc116c714c8237fb128f48fbc4b9053c57bc2a3860dad41a7d29cc12dd2c9123a805657f00ac40d3115775d291c8852615fc6c654e36784f32f9a90c42bb597e226f731131925f2a7b42ba73a39f70e96f911536c232fbed9d7fc0e2685604a83f8b2a015c3be81d64fd194b9181f08fcccbe11c4dd6c6ee6e7e60cc51ca89f95d46d3fddf0a30ff21f664a9618aa3d5d830cb26ec0605af9e75db8079f6717522bef6275d1a34bd9ab601d856f561cb97015da2f13153d9a', 'format': 2, 'src': 17, 'funId': '0000'}
2019-06-19 17:40:35,872 Received from 16492674433370: 5a5a01005b0020800000000000000000000000005a410000000f0000000000000000000001000000aa22ac00000000000302c001a1667f7f003000000060850000000000000000005805f500000000000000000000000000000000
2019-06-19 17:40:35,873 Appliance response data: c001a1667f7f003000000060850000000000000000005805f500000000000000000000000000000000
2019-06-19 17:40:35,874 Setting OH: ac_Schlafzimmer_turbo_mode (turbo_mode) = OFF
2019-06-19 17:40:35,913 Setting OH: ac_Schlafzimmer_swing_mode (swing_mode) = 0.0
2019-06-19 17:40:35,957 Setting OH: ac_Schlafzimmer_power_state (power_state) = ON
2019-06-19 17:40:35,999 Setting OH: ac_Schlafzimmer_operational_mode (operational_mode) = 5.0
2019-06-19 17:40:36,033 Setting OH: ac_Schlafzimmer_target_temperature (target_temperature) = 17.0
2019-06-19 17:40:36,058 Setting OH: ac_Schlafzimmer_online (online) = ON
2019-06-19 17:40:36,080 Setting OH: ac_Schlafzimmer_indoor_temperature (indoor_temperature) = 23.0
2019-06-19 17:40:36,103 Setting OH: ac_Schlafzimmer_active (active) = ON
2019-06-19 17:40:36,124 Setting OH: ac_Schlafzimmer_fan_speed (fan_speed) = 102.0
2019-06-19 17:40:36,149 Setting OH: ac_Schlafzimmer_outdoor_temperature (outdoor_temperature) = 41.5
2019-06-19 17:40:36,169 Setting OH: ac_Schlafzimmer_eco_mode (eco_mode) = OFF
2019-06-19 17:40:51,584 Sending to 16492674456715: 5a5a01115700200000000000000000000e031214c679000000050a00000000000000000002000000aa1eac00000000000302408100ff03ff00300000000000000000000003bb8100000000000000000000000000000000
2019-06-19 17:40:51,587 API call appliance/transparent/send: {'applianceId': '16492674456715', 'clientType': 1, 'stamp': '20190619174051', 'language': 'en_US', 'sessionId': 'a9667604410948fea3e5d1e3146383f220190619154021361', 'appId': 1017, 'sign': '48fb1a59b7cdee97a1eba8999b2a6494bcc54bf5952dc3417048a2e9f37fd766', 'order': 'f6a7018c7a1300cfd29bbfde235b725e03020e687ed0d3cfc116c714c8237fb128f48fbc4b9053c57bc2a3860dad41a7d29cc12dd2c9123a805657f00ac40d3115775d291c8852615fc6c654e36784f32f9a90c42bb597e226f731131925f2a7b42ba73a39f70e96f911536c232fbed9d7fc0e2685604a83f8b2a015c3be81d64fd194b9181f08fcccbe11c4dd6c6ee6e7e60cc51ca89f95d46d3fddf0a30ff21f664a9618aa3d5d830cb26ec0605af9e75db8079f6717522bef6275d1a34bd9ab601d856f561cb97015da2f13153d9a', 'format': 2, 'src': 17, 'funId': '0000'}
2019-06-19 17:40:52,750 Received from 16492674456715: 5a5a01005b0020800000000000000000000000008b9c0000000f0000000000000000000001000000aa22ac00000000000302c001a1667f7f00300000005f7d000000000000000000581ce700000000000000000000000000000000
2019-06-19 17:40:52,751 Appliance response data: c001a1667f7f00300000005f7d000000000000000000581ce700000000000000000000000000000000
2019-06-19 17:40:52,752 Push to Midea Wohnzimmer: operational_mode = 2.0
2019-06-19 17:40:52,753 Push to Midea Wohnzimmer: target_temperature = 22
2019-06-19 17:40:52,754 Sending to 16492674456715: 5a5a01115700200000000000000000000e031214c679000000050a00000000000000000002000000aa1eac000000000003024081466603ff00300000000000000000000003bbd400000000000000000000000000000000
2019-06-19 17:40:52,759 API call appliance/transparent/send: {'applianceId': '16492674456715', 'clientType': 1, 'stamp': '20190619174052', 'language': 'en_US', 'sessionId': 'a9667604410948fea3e5d1e3146383f220190619154021361', 'appId': 1017, 'sign': '9a7986ae88bc77df0d99eb90a7ce57d0f4c2c71f1dff201ae4ccc449a4191843', 'order': 'f6a7018c7a1300cfd29bbfde235b725e03020e687ed0d3cfc116c714c8237fb128f48fbc4b9053c57bc2a3860dad41a7d29cc12dd2c9123a805657f00ac40d3115775d291c8852615fc6c654e36784f32f9a90c42bb597e226f731131925f2a7b42ba73a39f70e96f911536c232fbed94fd58788b8d50ea54dd171b2d824c450a09809c4acba65e98f2932e2eeaa95bee7e60cc51ca89f95d46d3fddf0a30ff212274e957f5d86d83ae7b44672df369ce7e60cc51ca89f95d46d3fddf0a30ff2a86c0346e55df729a7c8062824cb2bec', 'format': 2, 'src': 17, 'funId': '0000'}
2019-06-19 17:40:53,849 Received from 16492674456715: 5a5a01005b0020800000000000000000000000008b9c0000000f0000000000000000000001000000aa22ac00000000000302c00146667f7f00300000005f7d00000000000000000058d58900000000000000000000000000000000
2019-06-19 17:40:53,850 Appliance response data: c00146667f7f00300000005f7d00000000000000000058d58900000000000000000000000000000000
2019-06-19 17:40:53,965 Sending to 16492674433370: 5a5a01115700200000000000000000000e031214c679000000050a00000000000000000002000000aa1eac00000000000302408100ff03ff00300000000000000000000003bb8100000000000000000000000000000000
2019-06-19 17:40:53,967 API call appliance/transparent/send: {'applianceId': '16492674433370', 'clientType': 1, 'stamp': '20190619174053', 'language': 'en_US', 'sessionId': 'a9667604410948fea3e5d1e3146383f220190619154021361', 'appId': 1017, 'sign': '1207a41dc29d47f9bededc3153d13a9a5ca78bb43da9311fdca45a9f403c9edb', 'order': 'f6a7018c7a1300cfd29bbfde235b725e03020e687ed0d3cfc116c714c8237fb128f48fbc4b9053c57bc2a3860dad41a7d29cc12dd2c9123a805657f00ac40d3115775d291c8852615fc6c654e36784f32f9a90c42bb597e226f731131925f2a7b42ba73a39f70e96f911536c232fbed9d7fc0e2685604a83f8b2a015c3be81d64fd194b9181f08fcccbe11c4dd6c6ee6e7e60cc51ca89f95d46d3fddf0a30ff21f664a9618aa3d5d830cb26ec0605af9e75db8079f6717522bef6275d1a34bd9ab601d856f561cb97015da2f13153d9a', 'format': 2, 'src': 17, 'funId': '0000'}
2019-06-19 17:40:55,005 Received from 16492674433370: 5a5a01005b0020800000000000000000000000005a410000000f0000000000000000000001000000aa22ac00000000000302c001a1667f7f0030000000608400000000000000000058d02b00000000000000000000000000000000
2019-06-19 17:40:55,006 Appliance response data: c001a1667f7f0030000000608400000000000000000058d02b00000000000000000000000000000000
2019-06-19 17:40:55,009 Push to Midea Schlafzimmer: operational_mode = 2.0
2019-06-19 17:40:55,011 Push to Midea Schlafzimmer: target_temperature = 22
2019-06-19 17:40:55,013 Sending to 16492674433370: 5a5a01115700200000000000000000000e031214c679000000050a00000000000000000002000000aa1eac000000000003024081466603ff00300000000000000000000003bbd400000000000000000000000000000000
2019-06-19 17:40:55,020 API call appliance/transparent/send: {'applianceId': '16492674433370', 'clientType': 1, 'stamp': '20190619174055', 'language': 'en_US', 'sessionId': 'a9667604410948fea3e5d1e3146383f220190619154021361', 'appId': 1017, 'sign': '3dfb573ab509ded0a664d5aa08eca5dc6db98a132c60fea890896c1102a80577', 'order': 'f6a7018c7a1300cfd29bbfde235b725e03020e687ed0d3cfc116c714c8237fb128f48fbc4b9053c57bc2a3860dad41a7d29cc12dd2c9123a805657f00ac40d3115775d291c8852615fc6c654e36784f32f9a90c42bb597e226f731131925f2a7b42ba73a39f70e96f911536c232fbed94fd58788b8d50ea54dd171b2d824c450a09809c4acba65e98f2932e2eeaa95bee7e60cc51ca89f95d46d3fddf0a30ff212274e957f5d86d83ae7b44672df369ce7e60cc51ca89f95d46d3fddf0a30ff2a86c0346e55df729a7c8062824cb2bec', 'format': 2, 'src': 17, 'funId': '0000'}
2019-06-19 17:40:56,033 Received from 16492674433370: 5a5a01005b0020800000000000000000000000005a410000000f0000000000000000000001000000aa22ac00000000000302c00146667f7f0030000000608400000000000000000058193d00000000000000000000000000000000
2019-06-19 17:40:56,035 Appliance response data: c00146667f7f0030000000608400000000000000000058193d00000000000000000000000000000000
2019-06-19 17:41:36,610 Refreshing Wohnzimmer
2019-06-19 17:41:36,611 Sending to 16492674456715: 5a5a01115700200000000000000000000e031214c679000000050a00000000000000000002000000aa1eac00000000000302408100ff03ff00300000000000000000000003bb8100000000000000000000000000000000
2019-06-19 17:41:36,613 API call appliance/transparent/send: {'applianceId': '16492674456715', 'clientType': 1, 'stamp': '20190619174136', 'language': 'en_US', 'sessionId': 'a9667604410948fea3e5d1e3146383f220190619154021361', 'appId': 1017, 'sign': '51a11aad78aceda1b091bc30b1b0959b2c68d03355aa4d446910e9c7b73c1598', 'order': 'f6a7018c7a1300cfd29bbfde235b725e03020e687ed0d3cfc116c714c8237fb128f48fbc4b9053c57bc2a3860dad41a7d29cc12dd2c9123a805657f00ac40d3115775d291c8852615fc6c654e36784f32f9a90c42bb597e226f731131925f2a7b42ba73a39f70e96f911536c232fbed9d7fc0e2685604a83f8b2a015c3be81d64fd194b9181f08fcccbe11c4dd6c6ee6e7e60cc51ca89f95d46d3fddf0a30ff21f664a9618aa3d5d830cb26ec0605af9e75db8079f6717522bef6275d1a34bd9ab601d856f561cb97015da2f13153d9a', 'format': 2, 'src': 17, 'funId': '0000'}
2019-06-19 17:41:37,861 Received from 16492674456715: 5a5a01005b0020800000000000000000000000008b9c0000000f0000000000000000000001000000aa22ac00000000000302c001a1667f7f00300000005f7d000000000000000000581ce700000000000000000000000000000000
2019-06-19 17:41:37,862 Appliance response data: c001a1667f7f00300000005f7d000000000000000000581ce700000000000000000000000000000000
2019-06-19 17:41:37,863 Setting OH: ac_Wohnzimmer_operational_mode (operational_mode) = 5.0
2019-06-19 17:41:37,884 Setting OH: ac_Wohnzimmer_target_temperature (target_temperature) = 17.0
2019-06-19 17:41:37,925 Refreshing Schlafzimmer
2019-06-19 17:41:37,926 Sending to 16492674433370: 5a5a01115700200000000000000000000e031214c679000000050a00000000000000000002000000aa1eac00000000000302408100ff03ff00300000000000000000000003bb8100000000000000000000000000000000
2019-06-19 17:41:37,929 API call appliance/transparent/send: {'applianceId': '16492674433370', 'clientType': 1, 'stamp': '20190619174137', 'language': 'en_US', 'sessionId': 'a9667604410948fea3e5d1e3146383f220190619154021361', 'appId': 1017, 'sign': '6ea0e6f76b1a4f1ccd0e1918ebc935ee14606e761e35799aa08c8431551b2257', 'order': 'f6a7018c7a1300cfd29bbfde235b725e03020e687ed0d3cfc116c714c8237fb128f48fbc4b9053c57bc2a3860dad41a7d29cc12dd2c9123a805657f00ac40d3115775d291c8852615fc6c654e36784f32f9a90c42bb597e226f731131925f2a7b42ba73a39f70e96f911536c232fbed9d7fc0e2685604a83f8b2a015c3be81d64fd194b9181f08fcccbe11c4dd6c6ee6e7e60cc51ca89f95d46d3fddf0a30ff21f664a9618aa3d5d830cb26ec0605af9e75db8079f6717522bef6275d1a34bd9ab601d856f561cb97015da2f13153d9a', 'format': 2, 'src': 17, 'funId': '0000'}
2019-06-19 17:41:39,062 Received from 16492674433370: 5a5a01005b0020800000000000000000000000005a410000000f0000000000000000000001000000aa22ac00000000000302c001a1667f7f0030000000618400000000000000000058b84200000000000000000000000000000000
2019-06-19 17:41:39,062 Appliance response data: c001a1667f7f0030000000618400000000000000000058b84200000000000000000000000000000000
2019-06-19 17:41:39,063 Setting OH: ac_Schlafzimmer_indoor_temperature (indoor_temperature) = 23.5
2019-06-19 17:41:39,085 Setting OH: ac_Schlafzimmer_operational_mode (operational_mode) = 5.0
2019-06-19 17:41:39,106 Setting OH: ac_Schlafzimmer_target_temperature (target_temperature) = 17.0
2019-06-19 17:41:39,128 Setting OH: ac_Schlafzimmer_outdoor_temperature (outdoor_temperature) = 41.0
2019-06-19 17:41:57,591 Sending to 16492674456715: 5a5a01115700200000000000000000000e031214c679000000050a00000000000000000002000000aa1eac00000000000302408100ff03ff00300000000000000000000003bb8100000000000000000000000000000000
2019-06-19 17:41:57,594 API call appliance/transparent/send: {'applianceId': '16492674456715', 'clientType': 1, 'stamp': '20190619174157', 'language': 'en_US', 'sessionId': 'a9667604410948fea3e5d1e3146383f220190619154021361', 'appId': 1017, 'sign': 'e97a34dda40b56ae84bb595f63046c6564ce1430f7b250ae4ac6cb54d96e6498', 'order': 'f6a7018c7a1300cfd29bbfde235b725e03020e687ed0d3cfc116c714c8237fb128f48fbc4b9053c57bc2a3860dad41a7d29cc12dd2c9123a805657f00ac40d3115775d291c8852615fc6c654e36784f32f9a90c42bb597e226f731131925f2a7b42ba73a39f70e96f911536c232fbed9d7fc0e2685604a83f8b2a015c3be81d64fd194b9181f08fcccbe11c4dd6c6ee6e7e60cc51ca89f95d46d3fddf0a30ff21f664a9618aa3d5d830cb26ec0605af9e75db8079f6717522bef6275d1a34bd9ab601d856f561cb97015da2f13153d9a', 'format': 2, 'src': 17, 'funId': '0000'}
2019-06-19 17:41:58,750 Received from 16492674456715: 5a5a01005b0020800000000000000000000000008b9c0000000f0000000000000000000001000000aa22ac00000000000302c001a1667f7f00300000005f7e000000000000000000587a8800000000000000000000000000000000
2019-06-19 17:41:58,751 Appliance response data: c001a1667f7f00300000005f7e000000000000000000587a8800000000000000000000000000000000
2019-06-19 17:41:58,751 Push to Midea Wohnzimmer: operational_mode = 2.0
2019-06-19 17:41:58,752 Push to Midea Wohnzimmer: target_temperature = 22
2019-06-19 17:41:58,753 Sending to 16492674456715: 5a5a01115700200000000000000000000e031214c679000000050a00000000000000000002000000aa1eac000000000003024081466603ff00300000000000000000000003bbd400000000000000000000000000000000
2019-06-19 17:41:58,755 API call appliance/transparent/send: {'applianceId': '16492674456715', 'clientType': 1, 'stamp': '20190619174158', 'language': 'en_US', 'sessionId': 'a9667604410948fea3e5d1e3146383f220190619154021361', 'appId': 1017, 'sign': 'cd1ed53f64671b854ebdbbcb1c67175c74cd363e8cbfc3e150f02ee4928be23a', 'order': 'f6a7018c7a1300cfd29bbfde235b725e03020e687ed0d3cfc116c714c8237fb128f48fbc4b9053c57bc2a3860dad41a7d29cc12dd2c9123a805657f00ac40d3115775d291c8852615fc6c654e36784f32f9a90c42bb597e226f731131925f2a7b42ba73a39f70e96f911536c232fbed94fd58788b8d50ea54dd171b2d824c450a09809c4acba65e98f2932e2eeaa95bee7e60cc51ca89f95d46d3fddf0a30ff212274e957f5d86d83ae7b44672df369ce7e60cc51ca89f95d46d3fddf0a30ff2a86c0346e55df729a7c8062824cb2bec', 'format': 2, 'src': 17, 'funId': '0000'}
2019-06-19 17:41:59,759 Received from 16492674456715: 5a5a01005b0020800000000000000000000000008b9c0000000f0000000000000000000001000000aa22ac00000000000302c00146667f7f00300000005f7e00000000000000000058b3aa00000000000000000000000000000000
2019-06-19 17:41:59,760 Appliance response data: c00146667f7f00300000005f7e00000000000000000058b3aa00000000000000000000000000000000
2019-06-19 17:41:59,874 Sending to 16492674433370: 5a5a01115700200000000000000000000e031214c679000000050a00000000000000000002000000aa1eac00000000000302408100ff03ff00300000000000000000000003bb8100000000000000000000000000000000
2019-06-19 17:41:59,878 API call appliance/transparent/send: {'applianceId': '16492674433370', 'clientType': 1, 'stamp': '20190619174159', 'language': 'en_US', 'sessionId': 'a9667604410948fea3e5d1e3146383f220190619154021361', 'appId': 1017, 'sign': 'd14404a4b15eff98e09531978372ca94f1fb530e5c6ba99a876cb4ceea815b65', 'order': 'f6a7018c7a1300cfd29bbfde235b725e03020e687ed0d3cfc116c714c8237fb128f48fbc4b9053c57bc2a3860dad41a7d29cc12dd2c9123a805657f00ac40d3115775d291c8852615fc6c654e36784f32f9a90c42bb597e226f731131925f2a7b42ba73a39f70e96f911536c232fbed9d7fc0e2685604a83f8b2a015c3be81d64fd194b9181f08fcccbe11c4dd6c6ee6e7e60cc51ca89f95d46d3fddf0a30ff21f664a9618aa3d5d830cb26ec0605af9e75db8079f6717522bef6275d1a34bd9ab601d856f561cb97015da2f13153d9a', 'format': 2, 'src': 17, 'funId': '0000'}
2019-06-19 17:42:00,956 Received from 16492674433370: 5a5a01005b0020800000000000000000000000005a410000000f0000000000000000000001000000aa22ac00000000000302c001a1667f7f00300000006185000000000000000000586d8c00000000000000000000000000000000
2019-06-19 17:42:00,957 Appliance response data: c001a1667f7f00300000006185000000000000000000586d8c00000000000000000000000000000000
2019-06-19 17:42:00,958 Push to Midea Schlafzimmer: operational_mode = 2.0
2019-06-19 17:42:00,959 Push to Midea Schlafzimmer: target_temperature = 22
2019-06-19 17:42:00,960 Sending to 16492674433370: 5a5a01115700200000000000000000000e031214c679000000050a00000000000000000002000000aa1eac000000000003024081466603ff00300000000000000000000003bbd400000000000000000000000000000000
2019-06-19 17:42:00,964 API call appliance/transparent/send: {'applianceId': '16492674433370', 'clientType': 1, 'stamp': '20190619174200', 'language': 'en_US', 'sessionId': 'a9667604410948fea3e5d1e3146383f220190619154021361', 'appId': 1017, 'sign': '1d1b5dfcafc21c190a6b560b3212a14ae12161f0c2835f7f026c9bde1aeca179', 'order': 'f6a7018c7a1300cfd29bbfde235b725e03020e687ed0d3cfc116c714c8237fb128f48fbc4b9053c57bc2a3860dad41a7d29cc12dd2c9123a805657f00ac40d3115775d291c8852615fc6c654e36784f32f9a90c42bb597e226f731131925f2a7b42ba73a39f70e96f911536c232fbed94fd58788b8d50ea54dd171b2d824c450a09809c4acba65e98f2932e2eeaa95bee7e60cc51ca89f95d46d3fddf0a30ff212274e957f5d86d83ae7b44672df369ce7e60cc51ca89f95d46d3fddf0a30ff2a86c0346e55df729a7c8062824cb2bec', 'format': 2, 'src': 17, 'funId': '0000'}
2019-06-19 17:42:02,018 Received from 16492674433370: 5a5a01005b0020800000000000000000000000005a410000000f0000000000000000000001000000aa22ac00000000000302c00146667f7f0030000000618500000000000000000058a4b000000000000000000000000000000000
2019-06-19 17:42:02,019 Appliance response data: c00146667f7f0030000000618500000000000000000058a4b000000000000000000000000000000000
^C2019-06-19 17:42:05,081 Shutting down in response to keyboard interrupt

I got it up and running! :stuck_out_tongue:

Main error from my side is that I used python instead of python3…

For those who have issues with it, this is what I’ve done:

sudo apt-get install python3-requests
sudo apt-get install python3-crypto

I’ve got following files on my server now:

 /etc/openhab2/scripts/midea/
   -rw-r--r-- 1 root    root    12195 apr  5 21:27 main.py
   -rw-r--r-- 1 root    root    15443 jun 19 19:23 master.zip
   drwxr-xr-x 3 root    root     4096 jun 19 19:28 midea/
   drwxr-xr-x 2 root    root     4096 jun 20 20:33 __pycache__/
   -rwxrwxr-x 1 openhab openhab   353 jun 19 20:06 settings.py

/etc/openhab2/scripts/midea/midea/
   -rw-r--r-- 1 root    root     1950 apr  5 21:27 client.py
   -rw-r--r-- 1 root    root     8140 apr  5 21:27 cloud.py
   -rw-r--r-- 1 root    root     7314 apr  5 21:27 command.py
   -rw-r--r-- 1 root    root     2062 apr  5 21:27 crc8.py
   -rw-r--r-- 1 root    root    10098 apr  5 21:27 device.py
   -rw-r--r-- 1 root    root        0 apr  5 21:27 __init__.py
   -rw-r--r-- 1 root    root     1383 apr  5 21:27 packet_builder.py
   drwxr-xr-x 2 root    root     4096 jun 19 19:28 __pycache__/
   -rw-r--r-- 1 root    root     3791 apr  5 21:27 security.py

The file settings.py must be updated with your login credentials.
The APP key is found on the internet. Not sure if it’s needs to be changed to something else.

APPKEY = '3742e9e5842d4ad59c2db887e12449f9'
EMAIL = 'LOGINMAIL'
PASSWORD = 'PWD'
AIRCONS = ('Ouderkamer', 'Kinderkamer', 'Leefruimte', 'Keuken', 'Badkamer')   
OH_URL = 'http://SERVERURL:8080'  
MIDEA_POLL_FREQ_SECS = 900
OPENHAB_POLL_FREQ_SECS = 15

I’m using a small bash script with crontab that checks every 30 minutes if it’s running. With this, when you reboot the server, everything should be running in 30 minutes max.
Below is the essentials of this script. I’m using it also to check a roomba script. I’ve cleaned it a bit, Hope I didn’t erased/changed wrong things…

/etc/openhab2/scripts/midea_check.sh  
   #!/bin/sh 
   CHECK=main.py;
   CURRENT_DATE=$(date '+%d/%m/%Y-%H:%M:%S')
   if
        ps ax | grep -v grep | grep $CHECK > /dev/null 
   then 
        echo "$CURRENT_DATE : $CHECK running, everything is fine" >> /var/log/openhab2/midea_check.log
   else                          
        echo "$CURRENT_DATE : $CHECK not running!" >> /var/log/openhab2/midea_check.log
        python3 /etc/openhab2/scripts/midea/main.py &
   fi

/etc/crontab
   */30 *  * * *   root    bash /etc/openhab2/scripts/midea_check.sh

Thanks Ben !

this works fine, but still having problems that refresh pushes the default data 17°C Fan mode :frowning:

is all working fine for you ? are you using persistance ?
thanks
Thomas

2019-06-21 10:48:04,213 Sending to 16492674456715: 5a5a01115700200000000000000000000e031214c679000000050a00000000000000000002000000aa1eac00000000000302408100ff03ff00300000000000000000000003bb8100000000000000000000000000000000
2019-06-21 10:48:04,217 API call appliance/transparent/send: {'stamp': '20190621104804', 'clientType': 1, 'sessionId': '995c05ca9f1a4dbf8b5c60d379f49ef020190621082213713', 'language': 'en_US', 'funId': '0000', 'src': 17, 'sign': '88724d146e7dccc094f863b219ef40def418a3ac2601f58ab334052d3b648010', 'order': '40ce3274f90e90a5bb167a242098678c30e915894bf1e24d8ef6f5e258d4af01c31f9ad8be202f8fafbbb08792893c810a228d420769b32c28b35d460a72c87c03edca2744a6d99f4f994e2d6176caebfbd09d619d64852c3001b2a05f2843e17cfd1137c1a1ef52e45f122020ac5dea3720525b3d86bfb114676d563a2736c7550c3640d8108a024859a10676e08b3fdae4c3a8aa0c41d138bc368fd2cf5589586dc1a088aea85d612d435adcaed6619eba921e6588b69bbf1a3b727c04ebe72865918ead5d7b7293d95435a32c8ee6', 'format': 2, 'appId': 1017, 'applianceId': '16492674456715'}
2019-06-21 10:48:05,201 Received from 16492674456715: 5a5a01005b0020800000000000000000000000008b9c0000000f0000000000000000000001000000aa22ac00000000000302c001a1667f7f003000000063640000000000000000005863b500000000000000000000000000000000
2019-06-21 10:48:05,203 Appliance response data: c001a1667f7f003000000063640000000000000000005863b500000000000000000000000000000000
2019-06-21 10:48:05,205 Push to Midea Wohnzimmer: target_temperature = 24
2019-06-21 10:48:05,207 Push to Midea Wohnzimmer: operational_mode = 2.0
2019-06-21 10:48:05,209 Sending to 16492674456715: 5a5a01115700200000000000000000000e031214c679000000050a00000000000000000002000000aa1eac000000000003024081486603ff00300000000000000000000003bbd200000000000000000000000000000000
2019-06-21 10:48:05,216 API call appliance/transparent/send: {'stamp': '20190621104805', 'clientType': 1, 'sessionId': '995c05ca9f1a4dbf8b5c60d379f49ef020190621082213713', 'language': 'en_US', 'funId': '0000', 'src': 17, 'sign': '94cd71457666ac8bd745b7c1156874b0c6ea326e99d0aa960f1a1c77e651523e', 'order': '40ce3274f90e90a5bb167a242098678c30e915894bf1e24d8ef6f5e258d4af01c31f9ad8be202f8fafbbb08792893c810a228d420769b32c28b35d460a72c87c03edca2744a6d99f4f994e2d6176caebfbd09d619d64852c3001b2a05f2843e17cfd1137c1a1ef52e45f122020ac5dea0f7a2cc98376735b19832d4134f0f88f3e6e50d7eef1ec367933d5115108bd49dae4c3a8aa0c41d138bc368fd2cf55893eb165eaa2b3e60bb5b67195820cf38fdae4c3a8aa0c41d138bc368fd2cf55894f55bb2fda86a9405f6c6dbaba5b72e7', 'format': 2, 'appId': 1017, 'applianceId': '16492674456715'}
2019-06-21 10:48:06,323 Received from 16492674456715: 5a5a01005b0020800000000000000000000000008b9c0000000f0000000000000000000001000000aa22ac00000000000302c00148667f7f0030000000636400000000000000000058fb7600000000000000000000000000000000
2019-06-21 10:48:06,325 Appliance response data: c00148667f7f0030000000636400000000000000000058fb7600000000000000000000000000000000
2019-06-21 10:48:18,508 Refreshing Wohnzimmer
2019-06-21 10:48:18,509 Sending to 16492674456715: 5a5a01115700200000000000000000000e031214c679000000050a00000000000000000002000000aa1eac00000000000302408100ff03ff00300000000000000000000003bb8100000000000000000000000000000000
2019-06-21 10:48:18,512 API call appliance/transparent/send: {'stamp': '20190621104818', 'clientType': 1, 'sessionId': '995c05ca9f1a4dbf8b5c60d379f49ef020190621082213713', 'language': 'en_US', 'funId': '0000', 'src': 17, 'sign': 'bc4fc2e3ff8a273f6241c45096d19071038cdd9564ac714943da018a28fa0be2', 'order': '40ce3274f90e90a5bb167a242098678c30e915894bf1e24d8ef6f5e258d4af01c31f9ad8be202f8fafbbb08792893c810a228d420769b32c28b35d460a72c87c03edca2744a6d99f4f994e2d6176caebfbd09d619d64852c3001b2a05f2843e17cfd1137c1a1ef52e45f122020ac5dea3720525b3d86bfb114676d563a2736c7550c3640d8108a024859a10676e08b3fdae4c3a8aa0c41d138bc368fd2cf5589586dc1a088aea85d612d435adcaed6619eba921e6588b69bbf1a3b727c04ebe72865918ead5d7b7293d95435a32c8ee6', 'format': 2, 'appId': 1017, 'applianceId': '16492674456715'}
2019-06-21 10:48:19,634 Received from 16492674456715: 5a5a01005b0020800000000000000000000000008b9c0000000f0000000000000000000001000000aa22ac00000000000302c001a1667f7f003000000063640000000000000000005863b500000000000000000000000000000000
2019-06-21 10:48:19,635 Appliance response data: c001a1667f7f003000000063640000000000000000005863b500000000000000000000000000000000
2019-06-21 10:48:19,637 Setting OH: ac_Wohnzimmer_target_temperature (target_temperature) = 17.0
2019-06-21 10:48:19,676 Setting OH: ac_Wohnzimmer_operational_mode (operational_mode) = 5.0
2019-06-21 10:48:19,710 Refreshing Schlafzimmer
2019-06-21 10:48:19,711 Sending to 16492674433370: 5a5a01115700200000000000000000000e031214c679000000050a00000000000000000002000000aa1eac00000000000302408100ff03ff00300000000000000000000003bb8100000000000000000000000000000000
2019-06-21 10:48:19,715 API call appliance/transparent/send: {'stamp': '20190621104819', 'clientType': 1, 'sessionId': '995c05ca9f1a4dbf8b5c60d379f49ef020190621082213713', 'language': 'en_US', 'funId': '0000', 'src': 17, 'sign': '9ea14b0ee7ba974c1a4f247e6be71b3830ca721eac5a70c60f3188df9f616846', 'order': '40ce3274f90e90a5bb167a242098678c30e915894bf1e24d8ef6f5e258d4af01c31f9ad8be202f8fafbbb08792893c810a228d420769b32c28b35d460a72c87c03edca2744a6d99f4f994e2d6176caebfbd09d619d64852c3001b2a05f2843e17cfd1137c1a1ef52e45f122020ac5dea3720525b3d86bfb114676d563a2736c7550c3640d8108a024859a10676e08b3fdae4c3a8aa0c41d138bc368fd2cf5589586dc1a088aea85d612d435adcaed6619eba921e6588b69bbf1a3b727c04ebe72865918ead5d7b7293d95435a32c8ee6', 'format': 2, 'appId': 1017, 'applianceId': '16492674433370'}
2019-06-21 10:48:20,644 Received from 16492674433370: 5a5a01005b0020800000000000000000000000005a410000000f0000000000000000000001000000aa22ac00000000000302c001a1667f7f0030000000646a0000000000000000005850c100000000000000000000000000000000
2019-06-21 10:48:20,645 Appliance response data: c001a1667f7f0030000000646a0000000000000000005850c100000000000000000000000000000000


At first sight, it’s working fine:
I can nicely power on the indoor units by basicUI. It starts with the last target temperature of the remotes. In my case 21 degrees. Indoor temperature is around 23 degrees, measured with basicUI. I put the target temperature to 17 degrees by basicUI. And about 20 minutes later, the target degrees is still on 17 degrees. The mode is on auto.

Items

Switch  ac_Leefruimte_online                    "Leefruimte [%s]"               <switch>                (gPersChng)
Number  ac_Leefruimte_operational_mode          "Mode [%s]"                     <pump>                  (gPersChng)
Number  ac_Leefruimte_target_temperature        "Gewenste temperatuur [%dÂC]"   <temperature_cold>      (gPersChng)
Number  ac_Leefruimte_indoor_temperature        "Gemeten Temperatuur [%.1fÂC]"  <temperature>           (gPersChng)
...

Sitemap

 Group item=HVAC {             
   Switch item=ac_Leefruimte_power_state
   Selection label="Functie" item=ac_Leefruimte_operational_mode mappings=[ 1.0="Auto",2.0="Koelen",3.0="Drogen",4.0="Warmen",5.0="Ventilator"]
   Setpoint item=ac_Leefruimte_target_temperature minValue=17 maxValue=30 
   Text item=ac_Leefruimte_indoor_temperature
   ...
   }

ok, doesn’t work for me, the function midea_to_openhab returns allways the same wrong values
doesn’t matter what is set in the cloud.

what devices are you using ? i have Dimstal SMND-12 (by Midea)

I’ve got some Midea MISSION-WF-53 and MISSION-WF-35.

Not sure what you mean with the persistance, function midea_to_openhab or cloud.
For the moment, I’ve got just an item controlled through the sitemap. Guess that if you can poweron/-off the indoor units, the cloud connections to Midea is working?

I use target temperatures with the auto-mode. And everything is nicely triggered/noticed. Even when I change it by the hvac remotes…

My Problem is the following

when i start the script it reads the Values from Midea Cloud connection,
but they are wrong ! Both devices are turned off but it reads the following:

2019-06-23 12:14:00,850 Received from 16492674433370: 5a5a01005b0020800000000000000000000000005a410000000f0000000000000000000001000000aa22ac00000000000302c001a1667f7f0030000000638200000000000000000058a45600000000000000000000000000000000
2019-06-23 12:14:00,851 Appliance response data: c001a1667f7f0030000000638200000000000000000058a45600000000000000000000000000000000
2019-06-23 12:14:00,854 Setting OH: ac_Schlafzimmer_turbo_mode (turbo_mode) = OFF
2019-06-23 12:14:00,885 Setting OH: ac_Schlafzimmer_active (active) = ON
2019-06-23 12:14:00,912 Setting OH: ac_Schlafzimmer_operational_mode (operational_mode) = 5.0
2019-06-23 12:14:00,939 Setting OH: ac_Schlafzimmer_swing_mode (swing_mode) = 0.0
2019-06-23 12:14:00,961 Setting OH: ac_Schlafzimmer_fan_speed (fan_speed) = 102.0
2019-06-23 12:14:00,985 Setting OH: ac_Schlafzimmer_eco_mode (eco_mode) = OFF
2019-06-23 12:14:01,011 Setting OH: ac_Schlafzimmer_target_temperature (target_temperature) = 17.0
2019-06-23 12:14:01,034 Setting OH: ac_Schlafzimmer_online (online) = ON
2019-06-23 12:14:01,059 Setting OH: ac_Schlafzimmer_power_state (power_state) = ON
2019-06-23 12:14:01,082 Setting OH: ac_Schlafzimmer_indoor_temperature (indoor_temperature) = 24.5
2019-06-23 12:14:01,106 Setting OH: ac_Schlafzimmer_outdoor_temperature (outdoor_temperature) = 40.0
2019-06-23 12:14:01,128 Refreshing Wohnzimmer
2019-06-23 12:14:01,129 Sending to 16492674456715: 5a5a01115700200000000000000000000e031214c679000000050a00000000000000000002000000aa1eac00000000000302408100ff03ff00300000000000000000000003bb8100000000000000000000000000000000
2019-06-23 12:14:01,131 API call appliance/transparent/send: {'sessionId': '19f14d2ecf4b453bad31c18cea2e055920190623101348334', 'sign': 'd6ab20d3fecb1495142eed23c6234e8bc1501460dd86a5cdf15313476c1722fa', 'order': '88e60a0fb010761d831fa4b52af2b543cbdf0061e1e5ff8aa8555df3b6e4e3b5069bd80aa0c41d925ebd346403f12a53d927a3b66387799f3ce7822461c2c85abfcab50573f5a312cc0130e45506d8a50467a294fb93fef831c4c7c4a890ce41f2de1bfe84a8a616bd466bacdae4db5ea15953d65c0f8f5c62d6f30dc1695c1348a1a28499fa10b8b51218a556cc10091a38bc661573ce8ab05f53a5523f1258a42023c63c12d1147afffb8bdd504473ae58cfb1a811293393c36904dc80a9615c831153aec75ea0cb46ffdeeef1da4d', 'stamp': '20190623121401', 'language': 'en_US', 'clientType': 1, 'format': 2, 'applianceId': '16492674456715', 'src': 17, 'funId': '0000', 'appId': 1017}
2019-06-23 12:14:02,182 Received from 16492674456715: 5a5a01005b0020800000000000000000000000008b9c0000000f0000000000000000000001000000aa22ac00000000000302c001a1667f7f00300000006473000000000000000000589e6a00000000000000000000000000000000
2019-06-23 12:14:02,183 Appliance response data: c001a1667f7f00300000006473000000000000000000589e6a00000000000000000000000000000000
2019-06-23 12:14:02,184 Setting OH: ac_Wohnzimmer_turbo_mode (turbo_mode) = OFF
2019-06-23 12:14:02,206 Setting OH: ac_Wohnzimmer_active (active) = ON
2019-06-23 12:14:02,227 Setting OH: ac_Wohnzimmer_operational_mode (operational_mode) = 5.0
2019-06-23 12:14:02,260 Setting OH: ac_Wohnzimmer_swing_mode (swing_mode) = 0.0
2019-06-23 12:14:02,288 Setting OH: ac_Wohnzimmer_fan_speed (fan_speed) = 102.0
2019-06-23 12:14:02,327 Setting OH: ac_Wohnzimmer_eco_mode (eco_mode) = OFF
2019-06-23 12:14:02,366 Setting OH: ac_Wohnzimmer_target_temperature (target_temperature) = 17.0
2019-06-23 12:14:02,397 Setting OH: ac_Wohnzimmer_online (online) = ON
2019-06-23 12:14:02,422 Setting OH: ac_Wohnzimmer_power_state (power_state) = ON
2019-06-23 12:14:02,445 Setting OH: ac_Wohnzimmer_indoor_temperature (indoor_temperature) = 25.0
2019-06-23 12:14:02,468 Setting OH: ac_Wohnzimmer_outdoor_temperature (outdoor_temperature) = 32.5

after that i can set the values via OH and the AC receives them correct,
but after refresh (900 secs) it reads again the cloud values and resets to wrong values.

the python funtion in main.py is responsible for it (if i has it out all is working) except the reading from the cloud…

i need to get in touch with the developer.

thanks
Thomas

When the script sets values, do they change in the midea app?

Actually, does the midea app work for you?

1 Like

Hi Bricky,

yes, Midea app is working fine and if i set a value via openhab it is shown on midea app.
but after 900 sec refresh it sets the wrong parameters (17°C and Fan mode)
also the received values are wrong in “Appliance response data”
very strange

any idea ?
thanks
Thomas

I’m not sure I can help much, unfortunately.

The temperature setting is the lower half of the third byte in the response data (that’s the 6th character in from the left), offset by 16 deg C. In your appliance response data, that’s a 1:

c001a1667f7f00300000005f7d000000000000000000581ce700000000000000000000000000000000

so 1+16 = 17, which is what the code thinks your setting is.

Each time you set it, it changes:

c00146667f7f00300000005f7e00000000000000000058b3aa00000000000000000000000000000000

(now 6 + 16 = 22 degrees), which appears to be working correctly (and obviously is, if the a/c and app both think it’s ok), but the next time it reads back the data, it’s back to being 1 (=17 degrees) again.

Maybe check to make sure you don’t have 2 copies of the code running (ps aux | grep python).

Or, if all else fails, you can effectively stop the code from reading back the data (after the first time) by setting MIDEA_POLL_FREQ_SECS to something really big, e.g.

MIDEA_POLL_FREQ_SECS = 60*60*24*365

Edit: also, try it with just one a/c and see if that makes a difference.

Hello boys, thank you for your work.
I use OH with paperui and knx binding and few others things.
I’m able to have the script up and running. It reads the actual values from my AC, but I not have the AC on OH so the scprit cannot update OH.
I get:
Setting OH: ac_LocaleTecnico_active (active) = ON
OH ac_LocaleTecnico_active not found, blacklisting
Setting OH: ac_LocaleTecnico_online (online) = ON
OH ac_LocaleTecnico_online not found, blacklisting
Setting OH: ac_LocaleTecnico_indoor_temperature (indoor_temperature) = 25.5
OH ac_LocaleTecnico_indoor_temperature not found, blacklisting

and so on.
I tried to insert a dummy ac_LocaleTecnico_active channel with no success; blacklisting anyway.

Could you help me to insert into OH the corrects channel/things?

Thank you in advance

Hello, I created a dummy things and items with the correct names.
It is possibile with config file only, not in paper UI web editor config (json file).
Now it is working fine.

Thank you

Hello guys,

I am currently trying to setup my air con to work with the midea openhab script but I am running into a problem right now.
In the settings file i set my setting like this:
AIRCONS = ('Klimaanlage') # tuple of aircons you want to sync
because in the Midea App my Aircon is called “Klimaanlage”.

That is the name I need to put there right ?

This is the error I am getting:

2019-10-29 16:20:40,428 Device list: [{'des': '', 'id': 'IDHERE', 'type': '0xAC', 'modelNumber': '0', 'activeStatus': '1', 'name': 'Klimaanlage', 'sn': 'LONGSNHERE', 'onlineStatus': '1'}]
2019-10-29 16:20:40,429 Refreshing Klimaanlage
2019-10-29 16:20:40,429 Sending to IDHERE: 5a5a01115700200000000000000000000e031214c679000000050a00000000000000000002000000aa1eac00000000000302408100ff03ff00300000000000000000000003bb8100000000000000000000000000000000
2019-10-29 16:20:40,432 API call appliance/transparent/send: {'format': 2, 'order': 'LONGORDERHERE', 'language': 'en_US', 'funId': '0000', 'stamp': '20191029162040', 'clientType': 1, 'appId': 1017, 'sessionId': 'SESSIONIDHERE', 'src': 17, 'sign': 'SIGNIDHERE', 'applianceId': 'APPLIANCEIDHERE'}
2019-10-29 16:20:41,384 Received from IDHERE: 5a5a01005b002080000000000000000000000000d6cc000000100000000000000000000001000000aa22ac00000000000302c001a1667f7f00300000005d460000000000000000005862da00000000000000000000000000000000
2019-10-29 16:20:41,385 Appliance response data: c001a1667f7f00300000005d460000000000000000005862da00000000000000000000000000000000
Exception: KeyError('Klimaanlage',)
2019-10-29 16:20:41,386 Failure in main loop
Traceback (most recent call last):
  File "/etc/openhab2/scripts/midea/main.py", line 335, in main_loop
    midea_to_openhab()
  File "/etc/openhab2/scripts/midea/main.py", line 282, in midea_to_openhab
    changes = update_from_midea(device)
  File "/etc/openhab2/scripts/midea/main.py", line 228, in update_from_midea
    if new_val != _last_midea_values[aircon][prop]:
KeyError: 'Klimaanlage'

I have similar error:

BlockquoteTraceback (most recent call last):
File “main.py”, line 335, in main_loop
midea_to_openhab()
File “main.py”, line 280, in midea_to_openhab
device.refresh()
File “/srv/openhab2-conf/scripts/midea/device.py”, line 145, in refresh
data = self._cloud_service.appliance_transparent_send(self.id, data)
File “/srv/openhab2-conf/scripts/midea/cloud.py”, line 179, in appliance_transparent_send
‘applianceId’: id
File “/srv/openhab2-conf/scripts/midea/cloud.py”, line 93, in api_request
return self.api_request(endpoint, args)
File “/srv/openhab2-conf/scripts/midea/cloud.py”, line 93, in api_request
return self.api_request(endpoint, args)
File “/srv/openhab2-conf/scripts/midea/cloud.py”, line 95, in api_request
raise RecursionError()
RecursionError

Python tuples are funny that way, they need a comma if there’s only one entry in them.

Try something like:

AIRCONS = ('acnamehere',)

Here is full error log. To me it seems like there is a problem with login to midea cloud?
Any idea what could it be?

2020-01-02 15:14:10,395 API call user/login/id/get: {‘clientType’: 1, ‘src’: 17, ‘loginAccount’: ‘user@protonmail.com’, ‘sign’: ‘138b9ba9322aa47582ac8dd9bcb1ffae2012e599c2cb756b5329a64a30ab7b73’, ‘appId’: 1017, ‘format’: 2, ‘stamp’: ‘20200102151410’, ‘language’: ‘en_US’}
2020-01-02 15:14:11,014 Call to login with 4093eaf9-1d73-4675-b4bf-57bdde207ea8 user@protonmail.com password
2020-01-02 15:14:11,016 API call user/login: {‘clientType’: 1, ‘src’: 17, ‘loginAccount’: ‘user@protonmail.com’, ‘sign’: ‘07f412f33462aa69cd40e83377eff8a99694b158795bbd396cd02e0c6677ab85’, ‘password’: ‘ead06347b8cccc4af0bf2a31044e34d8f23fe1de4fe84e5e151f09dcf43b4d68’, ‘appId’: 1017, ‘format’: 2, ‘stamp’: ‘20200102151411’, ‘language’: ‘en_US’}
2020-01-02 15:14:12,545 API call homegroup/list/get: {‘clientType’: 1, ‘src’: 17, ‘sessionId’: ‘452551f0d3c5472680cfbd233d84bf1020200102141411595’, ‘sign’: ‘74b6a71b750ee370a07443033fc0e13ace2d775b9b5dea4a83bc20113b4778f8’, ‘appId’: 1017, ‘format’: 2, ‘stamp’: ‘20200102151412’, ‘language’: ‘en_US’}
2020-01-02 15:14:13,079 API call appliance/list/get: {‘clientType’: 1, ‘src’: 17, ‘sessionId’: ‘452551f0d3c5472680cfbd233d84bf1020200102141411595’, ‘homegroupId’: ‘1249259’, ‘sign’: ‘a32b54a1d3bbcb15be8c5f96dc82df7fb179b1b0621abf249e958f54d4cb54f3’, ‘appId’: 1017, ‘format’: 2, ‘stamp’: ‘20200102151413’, ‘language’: ‘en_US’}
2020-01-02 15:14:13,746 Device list: [{‘mac’: ‘’, ‘onlineStatus’: ‘1’, ‘activeStatus’: ‘1’, ‘des’: ‘’, ‘type’: ‘0xAC’, ‘id’: ‘12094627919834’, ‘name’: ‘Gorenje’, ‘modelNumber’: ‘8’, ‘sn’: ‘4272d52739e47cff967f613fde389fe0486bd49c87946c02e58a5ea64a096e8f4cc9cfcda2190736c7bedb0a1fec4d8c’, ‘tsn’: ‘’, ‘masterId’: ‘’}]
2020-01-02 15:14:13,747 Refreshing Gorenje
2020-01-02 15:14:13,747 Sending to 12094627919834: 5a5a01115700200000000000000000000e031214c679000000050a00000000000000000002000000aa1eac00000000000302408100ff03ff00300000000000000000000003bb8100000000000000000000000000000000
2020-01-02 15:14:13,750 API call appliance/transparent/send: {‘clientType’: 1, ‘src’: 17, ‘funId’: ‘0000’, ‘sign’: ‘c28aced7a9836ebc0fe0a430f30b0fb92b5cb271726418480e5f9096f9e9fdcd’, ‘order’: ‘61e87b524ea9d8fc4c808dfb5eb7ec56270bcc0b0447375aee96b23cb77ffb1b66c8de1a1a4741448cff271d562e90eec360dd3597692d4b29e0109bb59bc7765f0d1593ffb24cab95764136c4e69dc5d55d8196acbc0bfcdce2c1966bb2184d4d59755a38b49f99b5a69e14dec1071faceb5250f0bc0a18f71d2014888204d9b5d9ee60c84510e3e4a1e1e1f67b032c54f5c60e70071109df93e92539e5845920449282ddc6d8db22b590f009757fc9c702050b6a1e9ce51ac3ac5589b33a5e894d835e9aed89e93a8b6a52371b1e0e’, ‘sessionId’: ‘452551f0d3c5472680cfbd233d84bf1020200102141411595’, ‘appId’: 1017, ‘format’: 2, ‘stamp’: ‘20200102151413’, ‘applianceId’: ‘12094627919834’, ‘language’: ‘en_US’}
2020-01-02 15:14:24,407 Error ignored: ‘3176’ - 'The asyn reply does not exist ’
2020-01-02 15:14:24,408 Retrying API call: ‘appliance/transparent/send’
2020-01-02 15:14:24,409 API call appliance/transparent/send: {‘clientType’: 1, ‘src’: 17, ‘funId’: ‘0000’, ‘sign’: ‘96fe7a87ac21b74e1733bcd3bea5f6c95d0921d9ed71183cd97a71827286bf18’, ‘order’: ‘61e87b524ea9d8fc4c808dfb5eb7ec56270bcc0b0447375aee96b23cb77ffb1b66c8de1a1a4741448cff271d562e90eec360dd3597692d4b29e0109bb59bc7765f0d1593ffb24cab95764136c4e69dc5d55d8196acbc0bfcdce2c1966bb2184d4d59755a38b49f99b5a69e14dec1071faceb5250f0bc0a18f71d2014888204d9b5d9ee60c84510e3e4a1e1e1f67b032c54f5c60e70071109df93e92539e5845920449282ddc6d8db22b590f009757fc9c702050b6a1e9ce51ac3ac5589b33a5e894d835e9aed89e93a8b6a52371b1e0e’, ‘sessionId’: ‘452551f0d3c5472680cfbd233d84bf1020200102141411595’, ‘appId’: 1017, ‘format’: 2, ‘stamp’: ‘20200102151424’, ‘applianceId’: ‘12094627919834’, ‘language’: ‘en_US’}
2020-01-02 15:14:35,275 Error ignored: ‘3176’ - 'The asyn reply does not exist ’
2020-01-02 15:14:35,276 Retrying API call: ‘appliance/transparent/send’
2020-01-02 15:14:35,278 API call appliance/transparent/send: {‘clientType’: 1, ‘src’: 17, ‘funId’: ‘0000’, ‘sign’: ‘b42049ed173f5621f224db6b2f7888b547e846502505872b61f198471fc693bc’, ‘order’: ‘61e87b524ea9d8fc4c808dfb5eb7ec56270bcc0b0447375aee96b23cb77ffb1b66c8de1a1a4741448cff271d562e90eec360dd3597692d4b29e0109bb59bc7765f0d1593ffb24cab95764136c4e69dc5d55d8196acbc0bfcdce2c1966bb2184d4d59755a38b49f99b5a69e14dec1071faceb5250f0bc0a18f71d2014888204d9b5d9ee60c84510e3e4a1e1e1f67b032c54f5c60e70071109df93e92539e5845920449282ddc6d8db22b590f009757fc9c702050b6a1e9ce51ac3ac5589b33a5e894d835e9aed89e93a8b6a52371b1e0e’, ‘sessionId’: ‘452551f0d3c5472680cfbd233d84bf1020200102141411595’, ‘appId’: 1017, ‘format’: 2, ‘stamp’: ‘20200102151435’, ‘applianceId’: ‘12094627919834’, ‘language’: ‘en_US’}
2020-01-02 15:14:46,161 Error ignored: ‘3176’ - 'The asyn reply does not exist ’
2020-01-02 15:14:46,161 Retrying API call: ‘appliance/transparent/send’
Exception: RecursionError()
2020-01-02 15:14:46,163 Failure in main loop
Traceback (most recent call last):
File “main.py”, line 335, in main_loop
midea_to_openhab()
File “main.py”, line 280, in midea_to_openhab
device.refresh()
File “/srv/openhab2-conf/scripts/midea/device.py”, line 145, in refresh
data = self._cloud_service.appliance_transparent_send(self.id, data)
File “/srv/openhab2-conf/scripts/midea/cloud.py”, line 179, in appliance_transparent_send
‘applianceId’: id
File “/srv/openhab2-conf/scripts/midea/cloud.py”, line 93, in api_request
return self.api_request(endpoint, args)
File “/srv/openhab2-conf/scripts/midea/cloud.py”, line 93, in api_request
return self.api_request(endpoint, args)
File “/srv/openhab2-conf/scripts/midea/cloud.py”, line 95, in api_request
raise RecursionError()
RecursionError
^CTraceback (most recent call last):
File “main.py”, line 359, in
time.sleep(10.0)
KeyboardInterrupt

Hi guys,

I am trying to understand what has to be done here but I am not familiar with python and not sure I get it.

Can someone describe roughly step by step what has to be done?

Wow got it working! No help needed at the moment!

Hi Tomas. I have the same issue like you. the worst part is that even when the AC is off it will start up with the default values. Did you manage to find a solution for this?

Thanks