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
74.17k stars 31.14k forks source link

Action for fan decrease speed only works once #124097

Open smugleafdev opened 3 months ago

smugleafdev commented 3 months ago

The problem

Calling fan.decrease_speed seems to only work once, and subsequent calls do nothing.

I have a fan with three speeds, so the increments are 33%. The options are 0%, 33%, 67%, and 100%. I can call fan.increase_speed 1-3 times and it does what one would expect. If I call fan.decrease_speed a million times in a row, it only decreases once. If I change the fan speed another way, the decrease action works one more time.

Playing with the decrement option on the action, I think I've figured out why. It's probably a rounding error, because calling decrement by 33% doesn't work, but 34% does. I expect it's being told to go from what is actually 33.33333% minus 33% is 0.33333%, which isn't valid, so it just stays where it's at. Or something like that, that only happens after the first call which is successful.

My HA logs say nothing about this. The device logs seem to register a change for each action call, even if no real change occurs.

Steps to reproduce:

  1. Call the action fan.increase_speed a number of times
  2. Call the action fan.decrease_speed twice
  3. Be disappointed it only went down one step rather than two

What version of Home Assistant Core has the issue?

2024.8.2

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant OS

Integration causing the issue

No response

Link to integration documentation on our website

No response

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

mib1185 commented 3 months ago

With which integration did you integrate this fan into HA?

gjohansson-ST commented 3 months ago

Related discussion: https://community.home-assistant.io/t/fan-decrease-speed-should-include-stepping-down-from-the-lowest-on-position-to-off/759911/3

home-assistant[bot] commented 3 months ago

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

Code owner commands Code owners of `fan` 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 fan` 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)


fan documentation fan source (message by IssueLinks)

mib1185 commented 3 months ago

I think we still need to know, which integration provides this fan entity. Further please provide the state details from developer tools states tab of this fan entity. Also you mentioned that "The device logs seem to register a change for each action call, even if no real change occurs", please provide this log, too thx :+1:

issue-triage-workflows[bot] commented 3 months ago

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.

zeekaran commented 3 months ago

I only have one fan to test this with. The fan is part of the Inovelli LZW36 combo Z-Wave fan + light switch. It is integrated via Z-Wave JS 13.1.0.

At the moment I cannot decrease the speed while at 2/3. Here is the dev tools state details:

preset_modes: breeze percentage: 67 percentage_step: 33.333333333333336 preset_mode: null icon: mdi:ceiling-fan friendly_name: Ceiling Fan supported_features: 57

Yet I can if I manually (physical switch or in the HA UI) change the speed to 1/3 or 3/3, and then call the decrease speed action again (to go to 0/3 or 2/3, respectively).

Here is the ZWJSUI logs for turning on the switch to full (through the UI), and then decreasing one step (with the action):

2024-09-01 14:49:10.908 INFO Z-WAVE: [Node 035] Value updated: 38-2-currentValue 0 => 99 2024-09-01 14:49:11.270 INFO Z-WAVE: [Node 035] Value updated: 38-2-targetValue 0 => 99 2024-09-01 14:49:11.272 INFO Z-WAVE: [Node 035] Value updated: 38-2-currentValue 99 => 99 2024-09-01 14:49:12.859 INFO Z-WAVE: [Node 035] Metadata updated: 50-0-value-66049 2024-09-01 14:49:12.861 INFO Z-WAVE: [Node 035] Value updated: 50-0-value-66049 27.8 => 68.2 2024-09-01 14:49:16.143 INFO Z-WAVE: [Node 035] Value updated: 38-2-currentValue 99 => 66 2024-09-01 14:49:16.432 INFO Z-WAVE: [Node 035] Value updated: 38-2-targetValue 99 => 66 2024-09-01 14:49:16.434 INFO Z-WAVE: [Node 035] Value updated: 38-2-currentValue 66 => 66 2024-09-01 14:49:16.496 INFO Z-WAVE: [Node 035] Value updated: 38-2-targetValue 66 => 66 2024-09-01 14:49:16.498 INFO Z-WAVE: [Node 035] Value updated: 38-2-duration 0s => 0s 2024-09-01 14:49:16.500 INFO Z-WAVE: [Node 035] Value updated: 38-2-currentValue 66 => 66 2024-09-01 14:49:18.914 INFO Z-WAVE: [Node 035] Metadata updated: 50-0-value-66049 2024-09-01 14:49:18.916 INFO Z-WAVE: [Node 035] Value updated: 50-0-value-66049 68.2 => 38.3

And here is trying to decrease it one more time from the actions page:

2024-09-01 14:50:22.555 INFO Z-WAVE: [Node 035] Value updated: 38-2-currentValue 66 => 66 2024-09-01 14:50:22.830 INFO Z-WAVE: [Node 035] Value updated: 38-2-targetValue 66 => 66 2024-09-01 14:50:22.832 INFO Z-WAVE: [Node 035] Value updated: 38-2-currentValue 66 => 66

And several seconds later with !!no further input!!:

2024-09-01 14:50:26.380 INFO APP: GET /health/zwave 301 0.692 ms - 191 2024-09-01 14:50:27.881 INFO Z-WAVE: [Node 035] Value updated: 38-2-targetValue 66 => 66 2024-09-01 14:50:27.882 INFO Z-WAVE: [Node 035] Value updated: 38-2-duration 0s => 0s 2024-09-01 14:50:27.884 INFO Z-WAVE: [Node 035] Value updated: 38-2-currentValue 66 => 66

And for comparison, here is what happens when I press down once on the physical switch:

2024-09-01 14:51:30.709 INFO Z-WAVE: [Node 035] Value updated: 38-2-currentValue 66 => 33 2024-09-01 14:51:30.805 INFO Z-WAVE: [Node 035] Value notification: 91-0-scene-006 0 2024-09-01 14:51:32.859 INFO Z-WAVE: [Node 035] Metadata updated: 50-0-value-66049 2024-09-01 14:51:32.861 INFO Z-WAVE: [Node 035] Value updated: 50-0-value-66049 38.3 => 33.7

The percentage in the states tab now shows "percentage: 33".

And lastly, while at 33%, this is what happens if I use the actions tab again to call the decrease speed service action:

2024-09-01 14:52:30.452 INFO Z-WAVE: [Node 035] Value updated: 38-2-currentValue 33 => 0 2024-09-01 14:52:30.817 INFO Z-WAVE: [Node 035] Value updated: 38-2-targetValue 66 => 0 2024-09-01 14:52:30.819 INFO Z-WAVE: [Node 035] Value updated: 38-2-currentValue 0 => 0 2024-09-01 14:52:33.225 INFO Z-WAVE: [Node 035] Metadata updated: 50-0-value-66049 2024-09-01 14:52:33.229 INFO Z-WAVE: [Node 035] Value updated: 50-0-value-66049 33.7 => 27.3 2024-09-01 14:52:35.869 INFO Z-WAVE: [Node 035] Value updated: 38-2-targetValue 0 => 0 2024-09-01 14:52:35.871 INFO Z-WAVE: [Node 035] Value updated: 38-2-duration 0s => 0s 2024-09-01 14:52:35.873 INFO Z-WAVE: [Node 035] Value updated: 38-2-currentValue 0 => 0

The logbook section from the device page is probably not what anyone is asking for:

image

@mib1185 Let me know if there are more detailed logs I can provide than this.

home-assistant[bot] commented 3 months ago

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

Code owner commands Code owners of `zwave_js` 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 zwave_js` 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)


zwave_js documentation zwave_js source (message by IssueLinks)

issue-triage-workflows[bot] commented 2 days ago

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.