ikalchev / HAP-python

A python implementation of the HomeKit Accessory Protocol (HAP)
Other
619 stars 119 forks source link

HeaterCooler:Ues Siri , Can not increase the temperature in cooling mode #340

Open Hcreak opened 3 years ago

Hcreak commented 3 years ago

In the cooling mode, use Chinese to command Siri to adjust the temperature. There is no problem to decrease it, but increase it does not work, although the siri answer has been adjusted.

In the home APP, the temperature value has not changed, but I accidentally found that the heating temperature has been changed to 25 degrees Celsius.

So I changed the log level of the program to DEBUG. I saw that Siri actually modulated HeatingThresholdTemperature instead of CoolingThresholdTemperature. And because HeatingThresholdTemperature is set at maximum of 25 degrees Celsius, I saw this weird situation in the home app.

Is this a siri problem or HAP_Python problem? I hope it will be resolved. Post my log below:


[hap_protocol] ('10.10.10.109', 49194): Recv decrypted: b'PUT /characteristics HTTP/1.1\r\nHost: MyAcPartner\\0321FEB39._hap._tcp.local\r\nContent-Length: 49\r\nContent-Type: application/hap+json\r\n\r\n{"characteristics":[{"aid":1,"iid":9,"value":1}]}'
[hap_protocol] ('10.10.10.109', 49194): h11 Event: PAUSED
[hap_protocol] ('10.10.10.109', 49194): h11 Event: Request(method=b'PUT', target=b'/characteristics', headers=<Headers([(b'host', b'MyAcPartner\\0321FEB39._hap._tcp.local'), (b'content-length', b'49'), (b'content-type', b'application/hap+json')])>, http_version=b'1.1')
[hap_protocol] ('10.10.10.109', 49194): h11 Event: Data(data=bytearray(b'{"characteristics":[{"aid":1,"iid":9,"value":1}]}'), chunk_start=False, chunk_end=False)
[hap_protocol] ('10.10.10.109', 49194): h11 Event: EndOfMessage(headers=<Headers([])>)
[hap_handler] ('10.10.10.109', 49194): Request PUT for path '/characteristics': {'host': 'MyAcPartner\\0321FEB39._hap._tcp.local', 'content-length': '49', 'content-type': 'application/hap+json'}
[hap_handler] ('10.10.10.109', 49194): Set characteristics content: {'characteristics': [{'aid': 1, 'iid': 9, 'value': 1}]}
[characteristic] client_update_value: Active to 1 from client: ('10.10.10.109', 49194)
[miioprotocol] 10.10.10.134:54321 >>: {'id': 358, 'method': 'get_prop', 'params': ['power']}
[miioprotocol] 10.10.10.134:54321 (ts: 1970-01-12 21:15:00, id: 358) << {'id': 358, 'result': ['on'], 'exe_time': 0}
[hap_protocol] ('10.10.10.109', 49194): Send encrypted: b'HTTP/1.1 204 No Content\r\n\r\n'
[hap_protocol] ('10.10.10.109', 49194): h11 Event: NEED_DATA
[hap_protocol] ('10.10.10.109', 49194): Recv decrypted: b'GET /characteristics?id=1.11 HTTP/1.1\r\nHost: MyAcPartner\\0321FEB39._hap._tcp.local\r\n\r\n'
[hap_protocol] ('10.10.10.109', 49194): h11 Event: PAUSED
[hap_protocol] ('10.10.10.109', 49194): h11 Event: Request(method=b'GET', target=b'/characteristics?id=1.11', headers=<Headers([(b'host', b'MyAcPartner\\0321FEB39._hap._tcp.local')])>, http_version=b'1.1')
[hap_protocol] ('10.10.10.109', 49194): h11 Event: EndOfMessage(headers=<Headers([])>)
[hap_handler] ('10.10.10.109', 49194): Request GET for path '/characteristics?id=1.11': {'host': 'MyAcPartner\\0321FEB39._hap._tcp.local'}
[accessory_driver] Get chars response: [{'aid': 1, 'iid': 11, 'status': 0, 'value': 2}]
[hap_protocol] ('10.10.10.109', 49194): Send encrypted: b'HTTP/1.1 200 OK\r\nContent-Type: application/hap+json\r\nContent-Length: 56\r\n\r\n{"characteristics": [{"aid": 1, "iid": 11, "value": 2}]}'
[hap_protocol] ('10.10.10.109', 49194): h11 Event: NEED_DATA
[hap_protocol] ('10.10.10.109', 49194): Recv decrypted: b'GET /characteristics?id=1.12,1.9,1.10,1.14,1.15 HTTP/1.1\r\nHost: MyAcPartner\\0321FEB39._hap._tcp.local\r\n\r\n'
[hap_protocol] ('10.10.10.109', 49194): h11 Event: PAUSED
[hap_protocol] ('10.10.10.109', 49194): h11 Event: Request(method=b'GET', target=b'/characteristics?id=1.12,1.9,1.10,1.14,1.15', headers=<Headers([(b'host', b'MyAcPartner\\0321FEB39._hap._tcp.local')])>, http_version=b'1.1')
[hap_protocol] ('10.10.10.109', 49194): h11 Event: EndOfMessage(headers=<Headers([])>)
[hap_handler] ('10.10.10.109', 49194): Request GET for path '/characteristics?id=1.12,1.9,1.10,1.14,1.15': {'host': 'MyAcPartner\\0321FEB39._hap._tcp.local'}
[accessory_driver] Get chars response: [{'aid': 1, 'iid': 12, 'status': 0, 'value': 25}, {'aid': 1, 'iid': 9, 'status': 0, 'value': 1}, {'aid': 1, 'iid': 10, 'status': 0, 'value': 3}, {'aid': 1, 'iid': 14, 'status': 0, 'value': 25}, {'aid': 1, 'iid': 15, 'status': 0, 'value': 18}]
[hap_protocol] ('10.10.10.109', 49194): Send encrypted: b'HTTP/1.1 200 OK\r\nContent-Type: application/hap+json\r\nContent-Length: 198\r\n\r\n{"characteristics": [{"aid": 1, "iid": 12, "value": 25}, {"aid": 1, "iid": 9, "value": 1}, {"aid": 1, "iid": 10, "value": 3}, {"aid": 1, "iid": 14, "value": 25}, {"aid": 1, "iid": 15, "value": 18}]}'
[hap_protocol] ('10.10.10.109', 49194): h11 Event: NEED_DATA
[hap_protocol] ('10.10.10.109', 49194): Recv decrypted: b'PUT /characteristics HTTP/1.1\r\nHost: MyAcPartner\\0321FEB39._hap._tcp.local\r\nContent-Length: 51\r\nContent-Type: application/hap+json\r\n\r\n{"characteristics":[{"aid":1,"iid":15,"value":25}]}'
[hap_protocol] ('10.10.10.109', 49194): h11 Event: PAUSED
[hap_protocol] ('10.10.10.109', 49194): h11 Event: Request(method=b'PUT', target=b'/characteristics', headers=<Headers([(b'host', b'MyAcPartner\\0321FEB39._hap._tcp.local'), (b'content-length', b'51'), (b'content-type', b'application/hap+json')])>, http_version=b'1.1')
[hap_protocol] ('10.10.10.109', 49194): h11 Event: Data(data=bytearray(b'{"characteristics":[{"aid":1,"iid":15,"value":25}]}'), chunk_start=False, chunk_end=False)
[hap_protocol] ('10.10.10.109', 49194): h11 Event: EndOfMessage(headers=<Headers([])>)
[hap_handler] ('10.10.10.109', 49194): Request PUT for path '/characteristics': {'host': 'MyAcPartner\\0321FEB39._hap._tcp.local', 'content-length': '51', 'content-type': 'application/hap+json'}
[hap_handler] ('10.10.10.109', 49194): Set characteristics content: {'characteristics': [{'aid': 1, 'iid': 15, 'value': 25}]}
[characteristic] client_update_value: HeatingThresholdTemperature to 25 from client: ('10.10.10.109', 49194)
[hap_protocol] ('10.10.10.109', 49194): Send encrypted: b'HTTP/1.1 204 No Content\r\n\r\n'
[hap_protocol] ('10.10.10.109', 49194): h11 Event: NEED_DATA
Hcreak commented 3 years ago

I found a temporary solution. I now use Thermostat Serivce to control the air conditioner, but this way I lose the function of adjusting RotationSpeed ​​and SwingMode: https://github.com/Hcreak/HomeKit-MiAcPartnerMcn02/commit/4f76ac93942d68b06eff2a1df76ec5f347e5a134

I found some have the same problem, Many people think this is a problem with Siri, But I didn’t understand if they solved this problem at the protocol library level. If it can, that’s the best.