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
Add transition support to zwave_js lights #52160
Add transition support to zwave_js lights #52160
Conversation
Hey there @home-assistant/z-wave, mind taking a look at this pull request as its been labeled with an integration ( |
Waiting for library update. |
Assuming this PR goes through: zwave-js/node-zwave-js#2906 we should also update the logic to determine whether or not to add |
This comment has been minimized.
This comment has been minimized.
d4aef43
to
17b46e8
Compare
We've bumped client library in core so we should be able to address this comment now: |
That won't prevent a float from being passed in, it's just used in typechecking. |
This comment has been minimized.
This comment has been minimized.
This PR has not been merged yet, which means it is not part of the 2021.07 release. You have to manually download the zwave_js component, copy it to your custom_components folder and add a version number in the |
Ya, in other languages it'd convert them last I checked (ie: PHP, C++) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks!
One last question - do we definitely want to use a default transition when transitions are supported and one isn't specified? I don't know enough to make a determination on that, so will trust your judgement
When you don't specify a transition, node-zwave-js will use the V1 Set command, which doesn't use a duration, it's only the target value. When you specify transition, node-zwave-js will use the V2 Set command, which includes the duration. If you specify "default", it will set duration to 0x255. Using the V1 Set on some switches seems to be problematic. Forcing node-zwave-js to set the transition to the default is a workaround for those devices. I would prefer that node-zwave-js just does it instead, but it doesn't. It seemed like an easy workaround though. However, @jcam were you able to confirm that the change to use "default" actually solves your problem? It wasn't clear if the problem was actually in regards to default transitions in HA in general, or if it was about these particular switches not working. If it doesn't fix the problem, I would just remove setting of the default and let node-zwave-js handle things. Besides these particular switches, no similar issues have been reported from what I've seen. |
Does this means this will be part of 2021.8 ? |
Highly likely, depends on if/when it get's merged. |
yes EDIT: first's statement is more accurate |
@@ -44,6 +44,8 @@ | |||
ColorComponent.PURPLE: "purple", | |||
} | |||
|
|||
TRANSITION_DURATION = "transitionDuration" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Side note: This constant should be moved to the client library in the future.
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! Just needs to run black.
Apologies I have not been able to re-test with sending v2 set with default to see if that resolves everything with the eaton switches. |
Using: With the current rel zwave-js component:
With the custom component in dev (this PR):
So, @kpine looks like sending 'default' for the transition does work for this switch. This matches how smartthings functions (or at least how i remember it working, i binned it as soon as I got zjs working at all), which was the only other hub on the market that worked properly with these switches. |
Proposed change
Add transition support to zwave_js lights
Type of change
Additional information
fixes Service data attribute "Transition" which is part of Service "Light.turn_on" does not work anymore #46234
fixes Zwave JS: the transition parameter used within light.turn_on / light.turn_off seem to be ignored #48470
Checklist
black --fast homeassistant tests
)If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
Updated and included derived files by running:
python3 -m script.hassfest
.requirements_all.txt
.Updated by running
python3 -m script.gen_requirements_all
..coveragerc
.The integration reached or maintains the following Integration Quality Scale:
To help with the load of incoming pull requests: