Hisense AEH-W4A1 Integration Question

Not a problem at all. I discovered these query status but I don’t know what they report! I included these commands just in case I will understand them sooner or later.

Ok!! Thank you, Davide!!
I keep you updated as soon as HA is updated with version 0.3.4.

Hi Davide! How are you?
Yesterday I saw that a new version of HA was published, the 0.104.
I think it doesn’t include the 0.3.4 improvement, right?

Right, neither in 0.104.1
I suppose it will be released in v. 0.105

1 Like

Davide,

Thank you. I’m going to test it today. I’ve been away and haven’t been near a pc to test it. I’ll let you know soon. Thanks again for your help.

Davide,

Just like eucciferri, all codes are working except for status_(3_0, 3_1, 7_1, and 10_4).

The text string command codes are working well and as expected each time and status_(102_0 and 102_64).

Below are the output of the codes that did not work as mentioned.

Thanks so much for your help once again. This is great stuff!!

(homeassistant) homeassistant@homeassistant:/home/btbutts$ python3.7 -m pyaehw4a1 AC --host 192.168.99.196 --command status_3_0
Traceback (most recent call last):
  File "/usr/lib/python3.7/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/lib/python3.7/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/srv/homeassistant/lib/python3.7/site-packages/pyaehw4a1/__main__.py", line 64, in <module>
    main()
  File "/srv/homeassistant/lib/python3.7/site-packages/pyaehw4a1/__main__.py", line 45, in main
    parsed = asyncio.run(client.command(command))
  File "/usr/lib/python3.7/asyncio/runners.py", line 43, in run
    return loop.run_until_complete(main)
  File "/usr/lib/python3.7/asyncio/base_events.py", line 579, in run_until_complete
    return future.result()
  File "/srv/homeassistant/lib/python3.7/site-packages/pyaehw4a1/aehw4a1.py", line 81, in command
    return await self._read_command(member)
  File "/srv/homeassistant/lib/python3.7/site-packages/pyaehw4a1/aehw4a1.py", line 110, in _read_command
    result = await self._bits_value(packet_type, pure_bytes, data_start_pos)
  File "/srv/homeassistant/lib/python3.7/site-packages/pyaehw4a1/aehw4a1.py", line 140, in _bits_value
    raise UnkDataError(f"Unknown data type {packet_type}: {binary_data}")
pyaehw4a1.exceptions.UnkDataError: Unknown data type 3_0: 00000001
(homeassistant) homeassistant@homeassistant:/home/btbutts$ python3.7 -m pyaehw4a1 AC --host 192.168.99.196 --command status_3_1
Traceback (most recent call last):
  File "/usr/lib/python3.7/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/lib/python3.7/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/srv/homeassistant/lib/python3.7/site-packages/pyaehw4a1/__main__.py", line 64, in <module>
    main()
  File "/srv/homeassistant/lib/python3.7/site-packages/pyaehw4a1/__main__.py", line 45, in main
    parsed = asyncio.run(client.command(command))
  File "/usr/lib/python3.7/asyncio/runners.py", line 43, in run
    return loop.run_until_complete(main)
  File "/usr/lib/python3.7/asyncio/base_events.py", line 579, in run_until_complete
    return future.result()
  File "/srv/homeassistant/lib/python3.7/site-packages/pyaehw4a1/aehw4a1.py", line 81, in command
    return await self._read_command(member)
  File "/srv/homeassistant/lib/python3.7/site-packages/pyaehw4a1/aehw4a1.py", line 110, in _read_command
    result = await self._bits_value(packet_type, pure_bytes, data_start_pos)
  File "/srv/homeassistant/lib/python3.7/site-packages/pyaehw4a1/aehw4a1.py", line 140, in _bits_value
    raise UnkDataError(f"Unknown data type {packet_type}: {binary_data}")
pyaehw4a1.exceptions.UnkDataError: Unknown data type 3_1: 00000001
(homeassistant) homeassistant@homeassistant:/home/btbutts$ python3.7 -m pyaehw4a1 AC --host 192.168.99.196 --command status_7_1
Traceback (most recent call last):
  File "/usr/lib/python3.7/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/lib/python3.7/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/srv/homeassistant/lib/python3.7/site-packages/pyaehw4a1/__main__.py", line 64, in <module>
    main()
  File "/srv/homeassistant/lib/python3.7/site-packages/pyaehw4a1/__main__.py", line 45, in main
    parsed = asyncio.run(client.command(command))
  File "/usr/lib/python3.7/asyncio/runners.py", line 43, in run
    return loop.run_until_complete(main)
  File "/usr/lib/python3.7/asyncio/base_events.py", line 579, in run_until_complete
    return future.result()
  File "/srv/homeassistant/lib/python3.7/site-packages/pyaehw4a1/aehw4a1.py", line 81, in command
    return await self._read_command(member)
  File "/srv/homeassistant/lib/python3.7/site-packages/pyaehw4a1/aehw4a1.py", line 110, in _read_command
    result = await self._bits_value(packet_type, pure_bytes, data_start_pos)
  File "/srv/homeassistant/lib/python3.7/site-packages/pyaehw4a1/aehw4a1.py", line 140, in _bits_value
    raise UnkDataError(f"Unknown data type {packet_type}: {binary_data}")
pyaehw4a1.exceptions.UnkDataError: Unknown data type 7_1: 0000000100010000000000100001010100000001
(homeassistant) homeassistant@homeassistant:/home/btbutts$ python3.7 -m pyaehw4a1 AC --host 192.168.99.196 --command status_10_4
Traceback (most recent call last):
  File "/usr/lib/python3.7/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/lib/python3.7/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/srv/homeassistant/lib/python3.7/site-packages/pyaehw4a1/__main__.py", line 64, in <module>
    main()
  File "/srv/homeassistant/lib/python3.7/site-packages/pyaehw4a1/__main__.py", line 45, in main
    parsed = asyncio.run(client.command(command))
  File "/usr/lib/python3.7/asyncio/runners.py", line 43, in run
    return loop.run_until_complete(main)
  File "/usr/lib/python3.7/asyncio/base_events.py", line 579, in run_until_complete
    return future.result()
  File "/srv/homeassistant/lib/python3.7/site-packages/pyaehw4a1/aehw4a1.py", line 81, in command
    return await self._read_command(member)
  File "/srv/homeassistant/lib/python3.7/site-packages/pyaehw4a1/aehw4a1.py", line 110, in _read_command
    result = await self._bits_value(packet_type, pure_bytes, data_start_pos)
  File "/srv/homeassistant/lib/python3.7/site-packages/pyaehw4a1/aehw4a1.py", line 140, in _bits_value
    raise UnkDataError(f"Unknown data type {packet_type}: {binary_data}")
pyaehw4a1.exceptions.UnkDataError: Unknown data type 10_4: 000000010000000100000001

I have updated the library, we will have to wait until it is released on HA

Dear, good news. The Davide update was already included in the recent release of HA 0.105!! :star_struck:

Once I update I will perform the tests and tell you how it went.

image

Hi,
After the update i made some test with my Hisense multispit (1 model TG35VE10G and 2 models TG25VE00G) and here are my results:
Now all the commands works pretty well.
Heat,cold,dry,on,off have a fast response without command errors of any kind,split reacts as they should.
My only issue is about the 2 models TG25VE00G and their thermostat card in HA.
If i click on dry icon the splits turn on as they should and dry the room but in the card they remain in off state.
1

Other icons seem to work better and,for example,if i change heat to dry,finally dry icon lights on in the card.
2
3

This is an example of my log:

2020-02-08 17:12:52 ERROR (MainThread) [homeassistant.helpers.entity] Update for climate.192_168_1_70 fails
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 279, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 459, in async_device_update
    await self.async_update()
  File "/usr/src/homeassistant/homeassistant/components/hisense_aehw4a1/climate.py", line 196, in async_update
    self._fan_mode = AC_TO_HA_FAN_MODES[fan_mode]
KeyError: '00001010'
2020-02-08 17:13:17 ERROR (SyncWorker_5) [homeassistant.components.command_line.sensor] Command failed: grep -c 'Login attempt' /home/homeassistant/.homeassistant/home-assistant.log
2020-02-08 17:13:18 WARNING (MainThread) [homeassistant.components.climate] Updating hisense_aehw4a1 climate took longer than the scheduled update interval 0:01:00
2020-02-08 17:13:27 WARNING (ArloBackgroundWorker) [pyaarlo] error in response={'data': {'error': '2059', 'message': 'Device is offline.', 'reason': 'Device is offline.'}, 'success': False}
2020-02-08 17:14:15 ERROR (MainThread) [homeassistant.helpers.entity] Update for climate.192_168_1_70 fails
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 279, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 459, in async_device_update
    await self.async_update()
  File "/usr/src/homeassistant/homeassistant/components/hisense_aehw4a1/climate.py", line 196, in async_update
    self._fan_mode = AC_TO_HA_FAN_MODES[fan_mode]
KeyError: '00001010'

Instead, model TG35VE10G interface perfectly in thermostat card.

To sum up,now integration works pretty well,my issue is about the card interface,i think.
Any suggestion is welcome…
Thanks to Davide and the people that contribute
Gabriele

Hello. I have two Hisense New Comfort air conditioners with AEH-W4A1 wifi cards. After the update to HA 0.105 everything was done correctly.
However from the register I see that cyclically the air conditioners become unavailable and then reconnect after a few tens of seconds.
What could be the problem? Both are a few meters from the wifi router.

Well, after trying it for a while with this new update, the commands work well for me too.

The only problem I see is that it is very unstable. On many occasions it “disappears” and is placed as “unavailable”, sometimes it comes back alone and on others I have to restart HA to use it again. I do not know why this happens, WiFi signal problem with security is not the case.

@Davide_Varricchio, how can we help you solve these instability failures?

Thanks a lot!!

I have the same problem: often after a long period of running time the updating of the status in lovelace stops, but if a command is sent the ac receives it.

I have analyzed the problem but I have not found any issue in my library; in fact, while the problem occurs in ha, I can continue to query the status and send commands to the air conditioner via direct calls to the library. Something in HA stops working when the air conditioner temporarily becomes unreachable.

Maybe opening an issue on github ha/core some developers might take a look.

Hi Davide!! How are you?
It is a pleasure to read your comments, because I understand that you are fine despite the COVID-19 crisis.

It is very sad how this virus is spreading in Italy and I pray that it will end soon. I love your country. My grandparents are Italian (but they are currently living in Argentina).

Regarding the integration of the Hisense module, it is good news what you are saying, I had not tried it. I think I’m going to put together my own buttons on the interface and then run those commands.

Thanks again!!

1 Like

Hi Davide,
i’m having the same issue somebody has, after a while my ACs became “Unavailable”. Sometimes after a while they get back to normal state but then they goes unavailable again.

Is there a way to solve this?

Thanks,
Guido

Hi guys!

Look what I found in the log of my UniFi Access Point … the Hisense module connects and disconnects recurrently (Even being at 1.5 meters from the AP).

I don’t know if this will be a behavior of all AEH-W4A1 modules.

Perhaps this is one of the reasons why this failure occurs within HA.

Bye!

Hello Davide,
i played around a little with your library on my installation. I found that raising calls timeout (timeout = 2 in timeout = 10 in aehw4a1.py and timeout=0.1 to timeout=10 in aehw4a1_async.py) seems to solve my problem. Is it possible to make timeout on calls a “parameter” in integration?

Thanks.

Guido

1 Like

@baconlive I fear that making timeouts user-settable can lead to unexpected behavior within Home Assistant.
The solution of copying the integration into the custom folder remains viable so that the changes to the timeouts are not lost due to a HA update.

Those timeouts are however already very conservative, in fact in previous versions of the library they were significantly lower. In the development installation of HA everything worked perfectly, but once installed in an HA with many other integrations it started to give instability problems.

Since the problem of unreachability after a certain time is also common to other integrations - developed in a totally different way from this - I believe that the problem lies within HA. I have opened a report in github hoping that they will consider the problem and investigate.

P.S. All timeouts are implemented in the library’s aehw4a1.py file, set to 2 seconds. I didn’t write the aehw4a1_async.py file, where did you find it?

@Davide_Varricchio thank you for your explaination, how can i copy the integration to custom folder?

You can find instructions here.

Hi @Davide_Varricchio and @baconlive,

If I copy the folder of this integration into “custom_components”, and modify the timeout from 2 to 10 on “aehw4a1.py”, could everything be solved?