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

Fan speed control is exposed via HomeKit but does not change fan speed #563

Closed
bjeanes opened this issue Jun 14, 2023 · 26 comments
Closed
Labels

Comments

@bjeanes
Copy link

bjeanes commented Jun 14, 2023

Describe the bug

I have had my WH21SL-18 wired up with Home Assistant for about 6 months now and working well.

However, the "fan speed" control exposed to HomeKit (using the below configuration.yml snippet) doesn't do anything.

I can change the slider in HomeKit (even all the way down to 0%), but this change is not reflected in Home Assistant nor propagated to the air conditioner.

IMG_CB9B4565BEF2-1

homekit:
  - name: Living room
    filter:
      include_entities:
        - climate.living_room_a_c
        - switch.living_room_a_c_jet_mode
        # ...

device.json

Expected behavior
Changing the fan speed in HomeKit should change the fan speed of the device (HomeKit uses a fan speed %, but other climate integrations will map these percentage rages to discrete Low/mid/high etc modes).

To handle Auto ("NATURE") fan speed, a boolean switch might need to be exposed, as I am not aware of any way for Apple's slider interface to expose this.

Screenshots
If applicable, add screenshots to help explain your problem.

Environment details:

  • Environment (HASSIO, Raspbian, etc): HassOS
  • Home Assistant version installed: 2023.5.4
  • Component version installed: latest
  • Last know working version: never noticed it working, but I haven't always tried to use set fan speed via HomeKit
  • LG device type and model with issue: split system WH21SL-18
  • LG devices connected (list): none other

Output of HA logs

The ThinQ logs which show up when changing fan mode seem to indicate that it is using lowercase speed names:

Logger: homeassistant.core
Source: custom_components/smartthinq_sensors/climate.py:361
Integration: SmartThinQ LGE Sensors ([documentation](https://github.com/ollo69/ha-smartthinq-sensors), [issues](https://github.com/ollo69/ha-smartthinq-sensors/issues))
First occurred: 12:42:55 PM (3 occurrences)
Last logged: 12:43:02 PM

Error executing service: <ServiceCall climate.set_fan_mode (c:01H2VWHRS08GTE6HZYEEE51BTM): entity_id=['climate.living_room_a_c'], fan_mode=low>
Error executing service: <ServiceCall climate.set_fan_mode (c:01H2VWHXK8378GV4K94VZ0H62T): entity_id=['climate.living_room_a_c'], fan_mode=low>
Error executing service: <ServiceCall climate.set_fan_mode (c:01H2VWHZKEM6KMB6A9HDSJHC43): entity_id=['climate.living_room_a_c'], fan_mode=high>
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/core.py", line 1867, in catch_exceptions
    await coro_or_task
  File "/usr/src/homeassistant/homeassistant/core.py", line 1889, in _execute_service
    await cast(Callable[[ServiceCall], Awaitable[None]], handler.job.target)(
  File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 226, in handle_service
    await service.entity_service_call(
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 798, in entity_service_call
    future.result()  # pop exception if have
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 980, in async_request_call
    await coro
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 838, in _handle_entity_call
    await result
  File "/config/custom_components/smartthinq_sensors/climate.py", line 361, in async_set_fan_mode
    raise ValueError(f"Invalid fan mode [{fan_mode}]")
ValueError: Invalid fan mode [low]

Additional context

I'm not sure if the high/low/etc is statically defined within HomeKit, are the expected standard names in Home Assistant, or something that each climate integration has to define in a way that HomeKit can find. I couldn't get it to trigger a mid but my old climate system did, so that makes me think it is some kind of changeable mapping.

@icces
Copy link

icces commented Jun 17, 2023

i have the same issue

@AngelMonky
Copy link

Same issue for me as well

@kparmun
Copy link

kparmun commented Jun 26, 2023

@bjeanes so I followed your great comment about them being lower case and made some changes to ac.py and now it works

in class ACFanSpeed(Enum) changed all of LOW-MID-HIGH words to lower case

still needs some work to do (homekit doesn't have mid, 50% is low, anything higher is high)
Screenshot 2023-06-26 090826

**Update
Now works almost perfect
a

@icces
Copy link

icces commented Jun 27, 2023

@kparmun how you changed this on home assistant ?

@kparmun
Copy link

kparmun commented Jun 27, 2023

@icces you need an add-on like "Studio Code Server" to access these files and edit them
after installing the add-on you need to find ac.py which is located in "custom_components/smartthinq_sensors/wideq/devices/"
Edit and save it, then restart the home assistant

homekit integration does't accept "Mid", so our three speeds would be off (low) low (mid) high (high)

@icces
Copy link

icces commented Jun 27, 2023

@kparmun Okay and then what exactly should I change there?
is it possible that you provide me with the configuration and I copy and paste it?

@kparmun
Copy link

kparmun commented Jun 27, 2023

@icces just replace Class ACFanSpeed with this:

class ACFanSpeed(Enum):
"""The fan speed for an AC/HVAC device."""

slow = "@AC_MAIN_WIND_STRENGTH_SLOW_W"
slow_LOW = "@AC_MAIN_WIND_STRENGTH_SLOW_LOW_W"
off = "@AC_MAIN_WIND_STRENGTH_LOW_W"
LOW_MID = "@AC_MAIN_WIND_STRENGTH_LOW_MID_W"
low = "@AC_MAIN_WIND_STRENGTH_MID_W"
MID_HIGH = "@AC_MAIN_WIND_STRENGTH_MID_HIGH_W"
high = "@AC_MAIN_WIND_STRENGTH_HIGH_W"
POWER = "@AC_MAIN_WIND_STRENGTH_POWER_W"
AUTO = "@AC_MAIN_WIND_STRENGTH_AUTO_W"
NATURE = "@AC_MAIN_WIND_STRENGTH_NATURE_W"
R_LOW = "@AC_MAIN_WIND_STRENGTH_LOW_RIGHT_W"
R_MID = "@AC_MAIN_WIND_STRENGTH_MID_RIGHT_W"
R_HIGH = "@AC_MAIN_WIND_STRENGTH_HIGH_RIGHT_W"
L_LOW = "@AC_MAIN_WIND_STRENGTH_LOW_LEFT_W"
L_MID = "@AC_MAIN_WIND_STRENGTH_MID_LEFT_W"
L_HIGH = "@AC_MAIN_WIND_STRENGTH_HIGH_LEFT_W"

@icces
Copy link

icces commented Jun 27, 2023

@kparmun Okay now I have changed to your config. but now Im not able to see the fan speed control in my apple home app. I can only change the temperature and the ac starts MID

@kparmun
Copy link

kparmun commented Jun 27, 2023

@icces maybe this config is not compatible with your model, it's working for me on LW8017ERSM

@icces
Copy link

icces commented Jun 27, 2023

@kparmun thank you very much!!!! now it works for me!!! I needed the dots in the config file and now it works!!

if I now select the smallest level in HomeKit, it is incorrectly displayed to me as "Off". is it possible to display maybe 10%?

@kparmun
Copy link

kparmun commented Jun 27, 2023

@icces that is a "HomeKit Bridge" limitation, the documents says that bridge only understands "off,low,high"
Screenshot 2023-06-27 143331
it only has 3 modes

I'm new to home assistant so I'm not sure, but I think unless there's a way that we can tinker with Homekit Bridge code, there's nothing we can do about this

@bjeanes
Copy link
Author

bjeanes commented Jun 27, 2023

I think the example there is just what happens if speed_list has 3 values. I think it can have more, but the first one should always be a sentinel for "off". I think it could have [off, low, mid, high, jet], for instance.

@kparmun
Copy link

kparmun commented Jun 27, 2023

@bjeanes I thought so too, and by that logic [off,mid,high] should work but it doesn't
It only works with these three words [off,low,high], I tested it and it doesn't matter that you start with [off]
you can only use [low,high] and it still works
No matter what I do it only accepts those 3 words, nothing else

@kparmun
Copy link

kparmun commented Jun 29, 2023

Found out that homekit keys are [off, low, middle, medium, high] but it didn't change much
But at least it doesn't show Off in home app anymore
This is what I got now:

class ACFanSpeed(Enum):
"""The fan speed for an AC/HVAC device."""

slow = "@AC_MAIN_WIND_STRENGTH_SLOW_W"
slow_low = "@AC_MAIN_WIND_STRENGTH_SLOW_LOW_W"
low = "@AC_MAIN_WIND_STRENGTH_LOW_W"
LOW_MID = "@AC_MAIN_WIND_STRENGTH_LOW_MID_W"
middle = "@AC_MAIN_WIND_STRENGTH_MID_W"
MID_HIGH = "@AC_MAIN_WIND_STRENGTH_MID_HIGH_W"
high = "@AC_MAIN_WIND_STRENGTH_HIGH_W"
POWER = "@AC_MAIN_WIND_STRENGTH_POWER_W"
AUTO = "@AC_MAIN_WIND_STRENGTH_AUTO_W"
NATURE = "@AC_MAIN_WIND_STRENGTH_NATURE_W"
R_LOW = "@AC_MAIN_WIND_STRENGTH_LOW_RIGHT_W"
R_MID = "@AC_MAIN_WIND_STRENGTH_MID_RIGHT_W"
R_HIGH = "@AC_MAIN_WIND_STRENGTH_HIGH_RIGHT_W"
L_LOW = "@AC_MAIN_WIND_STRENGTH_LOW_LEFT_W"
L_MID = "@AC_MAIN_WIND_STRENGTH_MID_LEFT_W"
L_HIGH = "@AC_MAIN_WIND_STRENGTH_HIGH_LEFT_W"

@github-actions
Copy link

This issue is stale because it has been open 45 days with no activity. Remove stale label or comment or this will be closed in 7 days.

@github-actions github-actions bot added the Stale label Aug 13, 2023
@bjeanes
Copy link
Author

bjeanes commented Aug 13, 2023

This is still an issue.

@github-actions github-actions bot removed the Stale label Aug 14, 2023
@github-actions
Copy link

This issue is stale because it has been open 45 days with no activity. Remove stale label or comment or this will be closed in 7 days.

@github-actions github-actions bot added the Stale label Sep 28, 2023
@dacohenii
Copy link

Still an issue

@github-actions github-actions bot removed the Stale label Sep 29, 2023
Copy link

This issue is stale because it has been open 45 days with no activity. Remove stale label or comment or this will be closed in 7 days.

@github-actions github-actions bot added the Stale label Nov 13, 2023
@bjeanes
Copy link
Author

bjeanes commented Nov 17, 2023

Still an issue, bot

@github-actions github-actions bot removed the Stale label Nov 18, 2023
Copy link

github-actions bot commented Jan 2, 2024

This issue is stale because it has been open 45 days with no activity. Remove stale label or comment or this will be closed in 7 days.

@github-actions github-actions bot added the Stale label Jan 2, 2024
@bjeanes
Copy link
Author

bjeanes commented Jan 2, 2024

Still an issue

@github-actions github-actions bot removed the Stale label Jan 3, 2024
Copy link

This issue is stale because it has been open 45 days with no activity. Remove stale label or comment or this will be closed in 7 days.

@github-actions github-actions bot added the Stale label Feb 18, 2024
@bjeanes
Copy link
Author

bjeanes commented Feb 18, 2024

this is still an issue for me

@github-actions github-actions bot removed the Stale label Feb 19, 2024
diegocjorge added a commit to diegocjorge/ha-smartthinq-sensors that referenced this issue Feb 20, 2024
Copy link

github-actions bot commented Apr 4, 2024

This issue is stale because it has been open 45 days with no activity. Remove stale label or comment or this will be closed in 7 days.

@github-actions github-actions bot added the Stale label Apr 4, 2024
Copy link

This issue was closed because it has been stalled for 7 days with no activity.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Apr 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants