home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
73.62k stars 30.77k forks source link

Fan Template Set Percentage Error #126667

Open GitHubGoody opened 1 month ago

GitHubGoody commented 1 month ago

The problem

I templated a fan for direct control of an AC Infinity exhaust fan that has power level settings 0-10. I don’t know why a fan entity isn’t just provided by the integration, but it isn’t.

I can turn the fan on and off and the speed level in HA updates when I change the speed on the AC Infinity controller.

When I change the speed in HA, it changes successfully on the AC Infinity controller. But, in HA, the percentage changes to reflect the setting (e.g. “90”) but the level bar does not move to the set position.

image

I also receive the following error ~20 seconds after making the change:

image

I’ve tried with and without switching the set_value to an integer.

What version of Home Assistant Core has the issue?

2024.9.3

What was the last working version of Home Assistant Core?

N/A

What type of installation are you running?

Home Assistant OS

Integration causing the issue

Template fan

Link to integration documentation on our website

https://www.home-assistant.io/integrations/fan.template/

Diagnostics information

See above

Example YAML snippet

Here is the template:

  - platform: template
      test_exhaust:
        friendly_name: "Test Exhaust"
        unique_id: "switch_exhaust_test"
        value_template: "{{ is_state('binary_sensor.acinfinitycontroller_port_1_state', 'on') }}"
        percentage_template: "{{ (states('number.acinfinitycontroller_port_1_on_power')|float/0.1)|round(0) }}"
        turn_on:
          action: select.select_option
          target:
            entity_id: select.acinfinitycontroller_port_1_active_mode
          data:
            option: "On"
        turn_off:
          action: select.select_option
          target:
            entity_id: select.acinfinitycontroller_port_1_active_mode
          data:
            option: "Off"
        set_percentage:
          action: number.set_value
          target:
            entity_id: number.acinfinitycontroller_port_1_on_power
          data:
            value: "{{ (percentage/10)|int }}"
        speed_count: 10


### Anything in the logs that might be useful for us?

_No response_

### Additional information

_No response_
home-assistant[bot] commented 1 month ago

Hey there @phracturedblue, @tetienne, @home-assistant/core, mind taking a look at this issue as it has been labeled with an integration (template) you are listed as a code owner for? Thanks!

Code owner commands Code owners of `template` can trigger bot actions by commenting: - `@home-assistant close` Closes the issue. - `@home-assistant rename Awesome new title` Renames the issue. - `@home-assistant reopen` Reopen the issue. - `@home-assistant unassign template` Removes the current integration label and assignees on the issue, add the integration domain after the command. - `@home-assistant add-label needs-more-information` Add a label (needs-more-information, problem in dependency, problem in custom component) to the issue. - `@home-assistant remove-label needs-more-information` Remove a label (needs-more-information, problem in dependency, problem in custom component) on the issue.

(message by CodeOwnersMention)


template documentation template source (message by IssueLinks)