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

Expose CX5120 as a Climate device #185

Closed
kitkat270 opened this issue Nov 11, 2024 · 45 comments · Fixed by #226
Closed

Expose CX5120 as a Climate device #185

kitkat270 opened this issue Nov 11, 2024 · 45 comments · Fixed by #226
Assignees
Labels
enhancement New feature or request Thanks for the Coffee A user was so kind to get me a coffee

Comments

@kitkat270
Copy link

Hi, would it be possible to use a climate entity instead of a fan entity for the CX5120? It shares many characteristics as climate device including set temp, current temp, heating mode and align better with other heating devices.

Thank you.

@kongo09
Copy link
Owner

kongo09 commented Nov 11, 2024

Interesting question, I wasn't even aware that this exists. At the moment, the whole integration is built around the assumption that the base entity is a fan.

If someone submits a pull request with a suggestion, I'm happy to check that, but otherwise I'd focus on other stuff right now.

@kongo09 kongo09 closed this as completed Nov 11, 2024
@kongo09 kongo09 added enhancement New feature or request wontfix This will not be worked on labels Nov 11, 2024
@kitkat270
Copy link
Author

No worries, I'm not a dev, so I don't think I'm capable of doing it myself. If anyone else could have a go, im happy to test / debug.

But thanks for all your efforts with the integration as it is, works fine for me.

@kongo09
Copy link
Owner

kongo09 commented Dec 6, 2024

I'd like to reopen and reconsider this. I've just implemented the humidifier entity for the 2-in-1 devices and for some devices then removed the main fan as it was redundant. Maybe I can do something similar for the heaters. It was less effort than I first though. See #198

Would you still be up for testing if I start this?

@kongo09 kongo09 reopened this Dec 6, 2024
@kongo09 kongo09 removed the wontfix This will not be worked on label Dec 6, 2024
@kongo09 kongo09 self-assigned this Dec 6, 2024
@kitkat270
Copy link
Author

Yeah, sure!

@kongo09
Copy link
Owner

kongo09 commented Dec 7, 2024

Can you please check for me what the minimum temperature and the maximum temperature settings are on the device or in the Air+ app? The manual says 1 to 37 °C. Is that correct?

The manual also talks about two heating settings. Right now, we have implemented High and Low but I thought these were fan speeds. Is the fan speed always the same and this is a heating setting?

@kitkat270
Copy link
Author

hi, yeah, so it does go from 1 to 37 in the app.

With modes there are:
Auto - keep to the set temperature
High - which just blows out hot air (no temperature control)
Low - blows out slightly less hot air (no temperature control)
Ventilation - fan only, no heat
Then there's oscilation on/off

@kongo09
Copy link
Owner

kongo09 commented Dec 7, 2024

I've done a first beta but it's a bit of a shot in the dark as I don't have access to a heater and cannot test anything.

Please try v0.33.0-beta.1 and let me know if the climate entity even shows up in addition to the fan entity. If that works and once everything is functional, I'll remove the fan.

I've left the modes now as fan modes, but there is also an option to make them so called preset modes. Not sure what is better. We can try both.

I'd also appreciate a screenshot of how the controls look like, as I have no idea, really.

@kitkat270
Copy link
Author

Screenshot_20241207_103028_Air+
Screenshot_20241207_103049_Air+
Screenshot_20241207_103057_Air+
Screenshot_20241207_103114_Air+

@kitkat270
Copy link
Author

Thanks will try later.

I've got some kid taxiing to do today, back later

@kongo09
Copy link
Owner

kongo09 commented Dec 7, 2024

Thanks for the help. Curious to hear if the climate thing shows or you just get a log full of errors...

@kongo09
Copy link
Owner

kongo09 commented Dec 7, 2024

I realize, I need to take the icons over with the thermometer...

@kongo09
Copy link
Owner

kongo09 commented Dec 7, 2024

I've now included the icons and started translation. Please try v0.33.0-beta.2

@kitkat270
Copy link
Author

Hi, not seeing the climate entity
home-assistant_philips_airpurifier_coap_2024-12-07T17-57-59.948Z.log

@kongo09
Copy link
Owner

kongo09 commented Dec 7, 2024

Stupid bug on my end, please try: v0.33.0-beta.3

@kitkat270
Copy link
Author

Hmmm, still not getting it with beta 3.

@kongo09
Copy link
Owner

kongo09 commented Dec 7, 2024

Next try: v0.33.0-beta.4

I've added some debug logging. If it still doesn't work, please enable logging and share the logs.

@kitkat270
Copy link
Author

@kitkat270
Copy link
Author

Climate entity not showing up. Looks like there could be something useful at the end of the logs there.

@kongo09
Copy link
Owner

kongo09 commented Dec 7, 2024

Very helpful, thanks, will fix tomorrow

@kongo09
Copy link
Owner

kongo09 commented Dec 8, 2024

Next try: v0.33.0-beta.5

I found quite a few bugs and tested more. I still struggle to use the right icons in the HVAC mode, but maybe that's ok. Let me know if it works.

@kitkat270
Copy link
Author

Hi, climate device does appear now.
Modes work fine, except selecting off mode doesn't turn off the device.

Swing button doesn't seem to work either. I'm not in at the moment, but will get logs later on.

Good start!

@kongo09
Copy link
Owner

kongo09 commented Dec 8, 2024

I think I found the bug with the switching off.

For the swing mode, I've added quite some debugging. How does the swing mode look like in the HA interface?

Please try: v0.33.0-beta.6

@kitkat270
Copy link
Author

Switching off seems good now - thanks!

home-assistant_philips_airpurifier_coap_2024-12-08T17-49-59.541Z.log
Screenshot 2024-12-08 174613

@kongo09
Copy link
Owner

kongo09 commented Dec 8, 2024

Oh, the preset mode has no icons?

@kitkat270
Copy link
Author

It does have icons. Maybe I forgot to refresh the browser after reboot.
Screenshot 2024-12-08 180048

@kongo09
Copy link
Owner

kongo09 commented Dec 8, 2024

Ah, good. Now what exactly happens with the swing mode? I don't see any errors in the log

@kongo09
Copy link
Owner

kongo09 commented Dec 8, 2024

And does setting the target temperature work?

@kitkat270
Copy link
Author

Setting temp is all good.

The swing mode...
If state (as shown in app) OFF - HA shows as off. Switching on in HA has no effect, it stays off.
If state (as shown in app) ON - HA shows as off. Switching on in HA turns it off.

@kongo09
Copy link
Owner

kongo09 commented Dec 8, 2024

The separate switch still works?

@kitkat270
Copy link
Author

Sorry, I meant the swing state, not the power state.
If swing state is off, HA shows off, switching it on in HA has no effect
If switch state is on, HA shows it as off, switching it on in HA then turns swing off.

@kongo09
Copy link
Owner

kongo09 commented Dec 8, 2024

Yes, but I had a separate switch outside the climate entity before. Does that still work?

@kongo09
Copy link
Owner

kongo09 commented Dec 8, 2024

I've added even more debugging output. In the last log I didn't see how the oscillation values are setup. Can you remove the integration and setup fresh?

New beta is: v0.33.0-beta.7

@kitkat270
Copy link
Author

Hi, OK, so the swing control operates almost the same as it does on the fan entity.
Fan:
Swing off command from HA turns off swing mode.
Swing on command from HA doesn't appear to do anything

Climate:
Swing off command doesn't do anything
Swing on command doesn't do anything unless its currently on and in which case, it turns it off.
home-assistant_philips_airpurifier_coap_2024-12-08T19-46-44.540Z.log

@kongo09
Copy link
Owner

kongo09 commented Dec 8, 2024

Ok, that sounds like a general problem as I thought the swing with the fan worked before, but apparently not?

@kongo09
Copy link
Owner

kongo09 commented Dec 8, 2024

Can you please share the output of aioairctrl again with swing on and with swing off

@kongo09
Copy link
Owner

kongo09 commented Dec 8, 2024

The log still doesn't show the setup of oscillation. Strange.

@kitkat270
Copy link
Author

home-assistant_philips_airpurifier_coap_2024-12-08T20-27-53.636Z.log

Does this contain what you need? Do I need to get output of aioairctl from somewhere else? Thanks

@kongo09
Copy link
Owner

kongo09 commented Dec 8, 2024

The log shows that the oscillation values arrive properly inside the climate entity, so that's cool. Thanks.

I now went back to the original issue #95 where I added the CX5120 in the first place. It turns out, that we never got the oscillation to work properly. Turning on doesn't work.

I've changed now one more thing but if that doesn't do the trick either, we might have a problem. But please try v0.33.0-beta.8 first before I propose something else.

@kitkat270
Copy link
Author

Hi, just tried beta8, same issue with the swing. Everything else looks good though - fab! :-)

@kongo09
Copy link
Owner

kongo09 commented Dec 8, 2024

Is turning off command now turning off?

@kongo09
Copy link
Owner

kongo09 commented Dec 8, 2024

Anyhow, I've seen another swing device that had a similar problem. It shows a certain control value when the swing is on, but setting that value via the commands doesn't turn it on. The solution was, that a different value needs to be set to activate the swing. Question is just: which one?

0 is for off, so that should definitely work.

To find out the value for on, the owner of that other fan used a trick. They sent a range of control values manually to the device until one of them started the fan. You can read about it here: #137 (comment)

Maybe the number they found for the CX3550 works here as well? I'll do a beta with it: v0.33.0-beta.9

But if not, you might want to familiarize yourself with aioairctrl. It is described in the README and it allows you to send control values to the device manually from the command line.

@kitkat270
Copy link
Author

Hi, yes, on beta 9, swing off turns it off, but the on isn't working.

Just noticed one other thing, the temperature setpoint needs to be a whole number, the climate entity has 0.5 degree granularity.

I'll take a look at aioairctrl and see if I can get the correct value, but that will be another day.

Huge thanks with the climate entity, brilliant!!!

@kongo09
Copy link
Owner

kongo09 commented Dec 9, 2024

In v0.33.0-beta.10 I've now added a temperature step of 1 degree. So the only thing that's missing is the oscillation switch on, correct?

@kitkat270
Copy link
Author

Hi, yes. All looks good with beta 10, except the oscillation.

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

kongo09 commented Dec 9, 2024

I've now released the work. Thanks so much for all your help and testing. For now, I've left the fan entity in to help other users transition over to climate but I'll remove this in v0.35.0

For the challenge of finding the correct value for oscillation, I'll open a separate issue #227 . Maybe others can help.

If you like my work, you can get me a coffee.

@kongo09 kongo09 added the Thanks for the Coffee A user was so kind to get me a coffee label Dec 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request 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