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

For Humidifier, target % in HomeKit differs from actual target %. #84535

Closed
Snuffy2 opened this issue Dec 24, 2022 · 7 comments · Fixed by #90854
Closed

For Humidifier, target % in HomeKit differs from actual target %. #84535

Snuffy2 opened this issue Dec 24, 2022 · 7 comments · Fixed by #90854

Comments

@Snuffy2
Copy link

Snuffy2 commented Dec 24, 2022

The problem

I believe this is the same as #55173

It makes it hard/impossible to set the desired Humidity in Homekit as the % you choose on the slider is not the actual % that is set.

Would it be possible to ignore the min/max attribute in the slider and allow setting the target humidity from 0-100%. Then if the number selected is < Min or > Max, override the value to the min/max attribute.

That way the slider will accurately reflect the desired target humidity but also respect the min/max.

What version of Home Assistant Core has the issue?

2022.12.8

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant Supervised

Integration causing the issue

HomeKit

Link to integration documentation on our website

https://www.home-assistant.io/integrations/homekit/

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

@home-assistant
Copy link

Hey there @bdraco, mind taking a look at this issue as it has been labeled with an integration (homekit) you are listed as a code owner for? Thanks!

Code owner commands

Code owners of homekit can trigger bot actions by commenting:

  • @home-assistant close Closes the issue.
  • @home-assistant rename Awesome new title Change the title of the issue.
  • @home-assistant reopen Reopen the issue.
  • @home-assistant unassign homekit Removes the current integration label and assignees on the issue, add the integration domain after the command.

(message by CodeOwnersMention)


homekit documentation
homekit source
(message by IssueLinks)

@bdraco
Copy link
Member

bdraco commented Dec 24, 2022

HomeKit represents the value as the percentage of the available range. It's not expected to match the value in Home Assistant when the range differs. Changing this would be a breaking change

@Snuffy2
Copy link
Author

Snuffy2 commented Dec 24, 2022

But then how you explain to a family member who uses the Home app how to set the desired humidity? They set the slider to 40% and expect the target humidity to be set to 40%. I can just picture the eye-roll that would come if I explained that: "no, you need to look up the max and min (which my family doesn't actually have any way to look up) and then take 40% of that range and that is what the target humidity will be set to."

@bdraco
Copy link
Member

bdraco commented Dec 24, 2022

That seems like a question for Apple as that's how it's designed

@Snuffy2
Copy link
Author

Snuffy2 commented Dec 25, 2022

Ok. Well then I put together a fan template to work around it. I'll use this to reflect the actual target percentages even though it is called speed as it is now a fan.

#fan:
- platform: template
  fans:
    master_bedroom_humidifier:
      friendly_name: "Master Bedroom Humidifier"
      unique_id: master_bedroom_humidifier_fan_template
      value_template: "{{ states('humidifier.master_bedroom_humidifier') }}"
      turn_on:
        - service: humidifier.turn_on
          target:
            entity_id: humidifier.master_bedroom_humidifier
      turn_off:
        - service: humidifier.turn_off
          target:
            entity_id: humidifier.master_bedroom_humidifier
      percentage_template: >
        {{ state_attr('humidifier.master_bedroom_humidifier','humidity') }}
      set_percentage:
        - service: humidifier.set_humidity
          target:
            entity_id: humidifier.master_bedroom_humidifier
          data:
            humidity: >
              {% set percent_bound=percentage|int(default=0) %}
              {% if state_attr('humidifier.master_bedroom_humidifier','min_humidity') is not none and percent_bound < state_attr('humidifier.master_bedroom_humidifier','min_humidity') %}
                {% set percent_bound=state_attr('humidifier.master_bedroom_humidifier','min_humidity')|int(default=0) %}
              {% endif %}
              {% if state_attr('humidifier.master_bedroom_humidifier','max_humidity') is not none and percent_bound > state_attr('humidifier.master_bedroom_humidifier','max_humidity') %}
                {% set percent_bound=state_attr('humidifier.master_bedroom_humidifier','max_humidity')|int(default=0) %}
              {% endif %}
              {{ percent_bound|int(default=0) }}
      preset_modes:
        - "auto"
        - "sleep"
        - "manual low"
        - "manual mid"
        - "manual high"
      preset_mode_template: >
        {{ state_attr('humidifier.master_bedroom_humidifier','mode') }}
      set_preset_mode:
        - service: humidifier.set_mode
          target:
            entity_id: humidifier.master_bedroom_humidifier
          data:
            mode: "{{ preset_mode }}"

@bdraco
Copy link
Member

bdraco commented Dec 25, 2022

That sounds like a good solution 👍

@issue-triage-workflows
Copy link

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates.
Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍
This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

@issue-triage-workflows issue-triage-workflows bot closed this as not planned Won't fix, can't repro, duplicate, stale Apr 1, 2023
@github-actions github-actions bot locked and limited conversation to collaborators May 5, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants