Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for HU5710 #187

Closed
merquel opened this issue Nov 13, 2024 · 12 comments · Fixed by #197
Closed

Support for HU5710 #187

merquel opened this issue Nov 13, 2024 · 12 comments · Fixed by #197
Assignees
Labels
support model Support a new model Thanks for the Coffee A user was so kind to get me a coffee

Comments

@merquel
Copy link

merquel commented Nov 13, 2024

This is a humidifier but I think it should be pretty similar to AC3421 and possibly AC4221, which are supported.

On:

{"D01102":` 1, "D01S03": "Vardagsrum", "D01S04": "Stargazer", "D01S05": "HU5710/00", "D01107": 0, "D01108": 3, "D01109": 3, "D0110A": 0, "D0110C": 1, "D01S0D": "688001002120", "D0110F": 3, "D01S12": "0.4.7", "D01213": 0, "ProductId": "ca2f87f42a1411efa23c0217247a73aa", "DeviceId": "5eda85d4a13e11efa7de1fd7c8c1f34e", "otacheck": false, "Runtime": 2050616, "rssi": -48, "wifilog": false, "blelog": -1, "free_memory": 145888, "WifiVersion": "[email protected]", "StatusType": "status", "ConnectType": "Online", "D03102": 1, "D03103": 0, "D03104": 123, "D03105": 123, "D0310A": 4, "D0310C": 0, "D0310D": 3, "D03110": 0, "D03211": 0, "D03224": 200, "D03125": 39, "D03128": 60, "D0312A": 6, "D0312B": 6, "D03130": 1, "D03134": 1, "D03135": 1, "D03137": 0, "D03138": 1, "D03139": 0, "D0313A": 0, "D0313B": 20, "D03240": 0, "D05207": 360, "D05408": 1800, "D0520D": 360, "D0540E": 1800}

Off:

{"D01102": 1, "D01S03": "Vardagsrum", "D01S04": "Stargazer", "D01S05": "HU5710/00", "D01107": 0, "D01108": 3, "D01109": 3, "D0110A": 0, "D0110C": 1, "D01S0D": "688001002120", "D0110F": 3, "D01S12": "0.4.7", "D01213": 0, "ProductId": "ca2f87f42a1411efa23c0217247a73aa", "DeviceId": "5eda85d4a13e11efa7de1fd7c8c1f34e", "otacheck": false, "Runtime": 1968686, "rssi": -48, "wifilog": false, "blelog": -1, "free_memory": 146080, "WifiVersion": "[email protected]", "StatusType": "connect", "ConnectType": "Online", "D03102": 0, "D03103": 0, "D03104": 0, "D03105": 0, "D0310A": 4, "D0310C": 0, "D0310D": 3, "D03110": 0, "D03211": 0, "D03224": 200, "D03125": 43, "D03128": 60, "D0312A": 6, "D0312B": 6, "D03130": 1, "D03134": 1, "D03135": 0, "D03137": 0, "D03138": 1, "D03139": 0, "D0313A": 0, "D0313B": 20, "D03240": 0, "D05207": 360, "D05408": 1800, "D0520D": 360, "D0540E": 1800}

Auto:

{"D01102": 1, "D01S03": "Vardagsrum", "D01S04": "Stargazer", "D01S05": "HU5710/00", "D01107": 0, "D01108": 3, "D01109": 3, "D0110A": 0, "D0110C": 1, "D01S0D": "688001002120", "D0110F": 3, "D01S12": "0.4.7", "D01213": 0, "ProductId": "ca2f87f42a1411efa23c0217247a73aa", "DeviceId": "5eda85d4a13e11efa7de1fd7c8c1f34e", "otacheck": false, "Runtime": 2500678, "rssi": -48, "wifilog": false, "blelog": -1, "free_memory": 147968, "WifiVersion": "[email protected]", "StatusType": "control", "ConnectType": "Online", "D03102": 1, "D03103": 0, "D03104": 123, "D03105": 123, "D0310A": 4, "D0310C": 0, "D0310D": 3, "D03110": 0, "D03211": 0, "D03224": 210, "D03125": 38, "D03128": 60, "D0312A": 6, "D0312B": 6, "D03130": 1, "D03134": 1, "D03135": 1, "D03137": 0, "D03138": 1, "D03139": 0, "D0313A": 0, "D0313B": 20, "D03240": 0, "D05207": 360, "D05408": 1800, "D0520D": 360, "D0540E": 1800}

High:

{"D01102": 1, "D01S03": "Vardagsrum", "D01S04": "Stargazer", "D01S05": "HU5710/00", "D01107": 0, "D01108": 3, "D01109": 3, "D0110A": 0, "D0110C": 1, "D01S0D": "688001002120", "D0110F": 3, "D01S12": "0.4.7", "D01213": 0, "ProductId": "ca2f87f42a1411efa23c0217247a73aa", "DeviceId": "5eda85d4a13e11efa7de1fd7c8c1f34e", "otacheck": false, "Runtime": 2358278, "rssi": -48, "wifilog": false, "blelog": -1, "free_memory": 145888, "WifiVersion": "[email protected]", "StatusType": "status", "ConnectType": "Online", "D03102": 1, "D03103": 0, "D03104": 123, "D03105": 123, "D0310A": 4, "D0310C": 65, "D0310D": 3, "D03110": 0, "D03211": 0, "D03224": 210, "D03125": 37, "D03128": 70, "D0312A": 6, "D0312B": 6, "D03130": 1, "D03134": 1, "D03135": 1, "D03137": 0, "D03138": 1, "D03139": 0, "D0313A": 0, "D0313B": 20, "D03240": 0, "D05207": 360, "D05408": 1800, "D0520D": 360, "D0540E": 1800}

Medium:

{"D01102": 1, "D01S03": "Vardagsrum", "D01S04": "Stargazer", "D01S05": "HU5710/00", "D01107": 0, "D01108": 3, "D01109": 3, "D0110A": 0, "D0110C": 1, "D01S0D": "688001002120", "D0110F": 3, "D01S12": "0.4.7", "D01213": 0, "ProductId": "ca2f87f42a1411efa23c0217247a73aa", "DeviceId": "5eda85d4a13e11efa7de1fd7c8c1f34e", "otacheck": false, "Runtime": 2320000, "rssi": -48, "wifilog": false, "blelog": -1, "free_memory": 145888, "WifiVersion": "[email protected]", "StatusType": "status", "ConnectType": "Online", "D03102": 1, "D03103": 0, "D03104": 123, "D03105": 123, "D0310A": 4, "D0310C": 19, "D0310D": 2, "D03110": 0, "D03211": 0, "D03224": 200, "D03125": 38, "D03128": 70, "D0312A": 6, "D0312B": 6, "D03130": 1, "D03134": 1, "D03135": 1, "D03137": 0, "D03138": 1, "D03139": 0, "D0313A": 0, "D0313B": 20, "D03240": 0, "D05207": 360, "D05408": 1800, "D0520D": 360, "D0540E": 1800}

Sleep:

{"D01102": 1, "D01S03": "Vardagsrum", "D01S04": "Stargazer", "D01S05": "HU5710/00", "D01107": 0, "D01108": 3, "D01109": 3, "D0110A": 0, "D0110C": 1, "D01S0D": "688001002120", "D0110F": 3, "D01S12": "0.4.7", "D01213": 0, "ProductId": "ca2f87f42a1411efa23c0217247a73aa", "DeviceId": "5eda85d4a13e11efa7de1fd7c8c1f34e", "otacheck": false, "Runtime": 2203392, "rssi": -48, "wifilog": false, "blelog": -1, "free_memory": 145888, "WifiVersion": "[email protected]", "StatusType": "status", "ConnectType": "Online", "D03102": 1, "D03103": 0, "D03104": 115, "D03105": 115, "D0310A": 4, "D0310C": 17, "D0310D": 1, "D03110": 0, "D03211": 0, "D03224": 200, "D03125": 37, "D03128": 70, "D0312A": 6, "D0312B": 6, "D03130": 1, "D03134": 1, "D03135": 1, "D03137": 0, "D03138": 1, "D03139": 0, "D0313A": 0, "D0313B": 20, "D03240": 0, "D05207": 360, "D05408": 1800, "D0520D": 360, "D0540E": 1800}

Here's the rest of my findings:

Humidity sensor:
"D03125": 38
Temperature sensor:
"D0313B": 20

Power (D03102):
On: "D03102": 1
Off: "D03102": 0

Mode (D0310C):
Auto: "D0310C": 0
Sleep: "D0310C": 17
Medium: "D0310C": 19
High: "D0310C": 65

Target Humidity (D03128):
30% Humidity: "D03128": 30
...in 5% increments up to 70%...
70% Humidity: "D03128": 70

Light Mode (D03135):
Off: "D03135": 0
Humidity: "D03135": 1
Ambient : "D03135": 2

Ambient Light Mode (D03137):
Warm: "D03137": 1
Dawn: "D03137": 2
Calm: "D03137": 3
Breath: "D03137": 4

Brightness Control (D03104 and D03105):
Off: "D03104": 0 and "D03105": 0
Low: "D03104": 115 and "D03105": 115
Bright: "D03104": 123 and "D03105": 123

Timer (D03110 and D03211):
D03110: Initial timer setting in hours (2 for 1 hour, 3 for 2 hours, etc.).
D03211: Remaining time in minutes
1-Hour: "D03110": 2, "D03211": 60
...1h increments to 12h...
12-Hour: "D03110": 13, "D03211": 720

Auto QuickDry Mode (D03138):
On: "D03138": 1
Off: "D03138": 0

Sensors Monitor in Standby (D03134):
On: "D03134": 1
Off: "D03134": 0

Beep Sound (D03130):
On: "D03103": 100
Off: "D03103": 0

Child Lock (D03103):
On: "D03103": 1
Off: "D03103": 0

These I'm not 100% sure about:
Possibly filter clean: "D0520D": 360 (was at 359 when I reset the filter cleaning at 99%)
Possibly filter lifespan: "D03224": 210 (was at 200 when I reset the filter lifespan at 99%)

Any support would be greatly appreciated :)

@kongo09
Copy link
Owner

kongo09 commented Nov 13, 2024

Thanks for all the data, that should be plenty to get me going. I'll certainly ask you to test some beta once I have something prepared.

@kongo09 kongo09 self-assigned this Nov 13, 2024
@kongo09 kongo09 added the support model Support a new model label Nov 13, 2024
@kongo09
Copy link
Owner

kongo09 commented Nov 16, 2024

does brightness control also have an auto setting? I'd guess it is 101

@kongo09
Copy link
Owner

kongo09 commented Nov 16, 2024

"D03224" is potentially the temperature and not the filter. At least, that's what it is with other devices. Please observe it.

I've attempted a first implementation in beta version v0.24.0-beta.1

Please check if this works for you and implements everything correctly. A screenshot of your device dashboard would be appreciated as well.

@kongo09 kongo09 added the Thanks for the Coffee A user was so kind to get me a coffee label Nov 17, 2024
@merquel
Copy link
Author

merquel commented Nov 17, 2024

Thanks for the implementation. I did some quick testing and most of the things seem to be working well so far.

image

One bug I came across is an error initializing the integration when HA is restarted

Log output 2024-11-17 04:38:26.182 WARNING (MainThread) [homeassistant.util.loop] Detected blocking call to scandir with args ('/config/custom_components/philips_airpurifier_coap/icons/pap',) inside the event loop by custom integration 'philips_airpurifier_coap' at custom_components/philips_airpurifier_coap/__init__.py, line 65: for dirpath, _dirnames, filenames in walk(self.iconpath): (offender: , line 366: ?), please create a bug report at https://github.com/kongo09/philips-airpurifier-coap/issues For developers, please see https://developers.home-assistant.io/docs/asyncio_blocking_operations/#scandir Traceback (most recent call last): File "", line 198, in _run_module_as_main File "", line 88, in _run_code File "/usr/src/homeassistant/homeassistant/__main__.py", line 223, in sys.exit(main()) File "/usr/src/homeassistant/homeassistant/__main__.py", line 209, in main exit_code = runner.run(runtime_conf) File "/usr/src/homeassistant/homeassistant/runner.py", line 189, in run return loop.run_until_complete(setup_and_run_hass(runtime_config)) File "/usr/local/lib/python3.12/asyncio/base_events.py", line 674, in run_until_complete self.run_forever() File "/usr/local/lib/python3.12/asyncio/base_events.py", line 641, in run_forever self._run_once() File "/usr/local/lib/python3.12/asyncio/base_events.py", line 1990, in _run_once handle._run() File "/usr/local/lib/python3.12/asyncio/events.py", line 88, in _run self._context.run(self._callback, *self._args) File "/usr/local/lib/python3.12/site-packages/aiohttp/web_protocol.py", line 556, in start task = asyncio.Task(coro, loop=loop, eager_start=True) File "/usr/local/lib/python3.12/site-packages/aiohttp/web_protocol.py", line 477, in _handle_request resp = await request_handler(request) File "/usr/local/lib/python3.12/site-packages/aiohttp/web_app.py", line 567, in _handle return await handler(request) File "/usr/local/lib/python3.12/site-packages/aiohttp/web_middlewares.py", line 117, in impl return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/security_filter.py", line 92, in security_filter_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/forwarded.py", line 83, in forwarded_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/request_context.py", line 26, in request_context_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 86, in ban_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 242, in auth_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/headers.py", line 32, in headers_middleware response = await handler(request) File "/usr/src/homeassistant/homeassistant/helpers/http.py", line 73, in handle result = await handler(request, **request.match_info) File "/config/custom_components/philips_airpurifier_coap/__init__.py", line 65, in get for dirpath, _dirnames, filenames in walk(self.iconpath):

2024-11-17 04:39:23.186 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved (None)
Traceback (most recent call last):
File "/usr/local/lib/python3.12/site-packages/aiocoap/tokenmanager.py", line 65, in shutdown
await self.token_interface.shutdown()
File "/usr/local/lib/python3.12/site-packages/aiocoap/messagemanager.py", line 78, in shutdown
for messageerror_monitor, cancellable in self._active_exchanges.values():
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'values'
2024-11-17 04:39:23.219 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved (None)
Traceback (most recent call last):
File "/usr/local/lib/python3.12/site-packages/aiocoap/tokenmanager.py", line 65, in shutdown
await self.token_interface.shutdown()
File "/usr/local/lib/python3.12/site-packages/aiocoap/messagemanager.py", line 78, in shutdown
for messageerror_monitor, cancellable in self._active_exchanges.values():
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'values'
2024-11-17 04:40:07.963 ERROR (MainThread) [custom_components.philips_airpurifier_coap.coordinator] Config not ready, first refresh failed for host 192.168.1.14

Some other findings:

  • D03224 is indeed the temperature, nothing else :)

  • Brightness Control (D03105), only has three states (off, low and bright) in the app. Setting it to auto has no effect. I’m unsure whether the light or input select entity would be the best here.

  • The off (0) option for AMBIENT_LIGHT_MODE_MAP isn’t valid, it could be removed.

  • I think NEW2_GAS_PREFERRED_INDEX isn’t used by humidifiers and could be safe to remove.

  • Also observed D03240 returns error code -16128 when water tank is empty so it seems like NEW2_ERROR_CODE is valid for this device.

  • In addition to the auto quickdry mode, there's also an option to manually activate it. On: D03139=1, off: D03139=0

I realize this integration is primarily made for air purifiers but it could be interesting to dive deeper into the humidifier entity at some point. But so far the fan entity has been working well too. Thanks again for the support, I’ve sent some coffee your way! ☕

@kongo09
Copy link
Owner

kongo09 commented Nov 17, 2024

Thanks for the coffee and the detailed feedback. It feels like this device is the one with the most options so far. I'll take a look at the points you mentioned.

@kongo09
Copy link
Owner

kongo09 commented Nov 17, 2024

Changing the base entity to humidifier is a bit of work and I've shied away from it so far.

The error at startup of HA should be resolved.

All the other feedback is incorporated. Please give it a spin in the latest beta.

@merquel
Copy link
Author

merquel commented Nov 19, 2024

It works great now. Only thing I noticed is the list of the integrations custom icons don't load in the UI but that's not really a big issue since it's still possible to set the custom icon if you know it's name.

Speaking of icons I have one for the ambient light mode if you want to add it to the custom icons. It's based on the one from the Air+ app so it should be very close to official.

IMG_7517

<?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" version="1.1">
 <style>path{fill:#000}@media (prefers-color-scheme:dark){path{fill:#fff}}</style>
 <path d="M6.7 16.91h10.55l.29.01c.72.01 1.02.27 1.01.85 0 .57-.32.85-1.03.85H6.92c-.26 0-.53-.03-.8-.07a.82.82 0 0 1-.76-.78c0-.36.38-.8.77-.84.17-.02.35-.01.57-.02Zm9.16-5.3c-.55-.37-.7-.68-.45-1.17a76 76 0 0 1 1.84-3.45c.3-.5.78-.56 1.23-.26.41.29.4.67.21 1.06-.43.85-.87 1.7-1.33 2.53-.18.35-.4.69-.63 1.01-.2.3-.48.4-.87.27Zm5.32-.47c.16-.12.3-.23.45-.32.46-.28.84-.2 1.21.26.31.4.16.74-.17 1a85.75 85.75 0 0 1-3.15 2.39c-.48.34-.85.23-1.2-.23-.27-.34-.23-.72.21-1.08.86-.69 1.74-1.34 2.65-2.02ZM5.77 14.36c-.33.38-.7.4-1.05.15-1.05-.77-2.1-1.53-3.12-2.35-.55-.45-.5-.87.03-1.32.28-.23.57-.28.87-.06 1.07.79 2.14 1.56 3.18 2.36.47.36.47.65.09 1.22Zm-.23-6.42c-.26-.6-.14-1.04.33-1.3.4-.21.84-.06 1.15.47.59 1.05 1.17 2.1 1.74 3.18.28.54.17 1-.26 1.25-.4.23-.87.1-1.17-.4-.62-1.05-1.18-2.11-1.79-3.2Zm6.83-2.4c.4.12.54.39.54.74v4.05c-.01.45-.32.7-.79.7-.43 0-.82-.28-.82-.68-.03-1.37-.04-2.73-.02-4.1.01-.56.29-.72 1.1-.7Zm0 0"/>
</svg>

@kongo09
Copy link
Owner

kongo09 commented Nov 19, 2024

Thanks for the icon, I'm happy to add that.

The icons should load once you reload the UI in the browser - and then they should stay. Not sure why that is.

@merquel
Copy link
Author

merquel commented Nov 20, 2024

Not a big issue. Everything else seems solid so should be good to close.

I'm currently looking at the humidifier entity so I might come back with that if I get it working.

@kongo09
Copy link
Owner

kongo09 commented Nov 20, 2024

I've seen your PR.

Ideally, you do it generic enough that all humidifiers can be setup this way while avoiding code duplication. That might require some refactoring of the base classes

@kongo09 kongo09 linked a pull request Nov 20, 2024 that will close this issue
@kongo09
Copy link
Owner

kongo09 commented Nov 20, 2024

If just released with the new model included.

Let's move the whole question around the humidifier entity to a separate issue #198

@merquel
Copy link
Author

merquel commented Nov 23, 2024

I've seen your PR.

Ideally, you do it generic enough that all humidifiers can be setup this way while avoiding code duplication. That might require some refactoring of the base classes

Yes I did not intend to create a PR, misclicked when messing around in my fork :)

Nice work with the humidifying entity! I'll take a look at it right away.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
support model Support a new model Thanks for the Coffee A user was so kind to get me a coffee
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants