-
-
Notifications
You must be signed in to change notification settings - Fork 591
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
allow setting of duration/transition #1321
Comments
What is the expected behavior here?
Which duration (if any) gets used for the set command? |
Why should this happen? Does a trigger also report a DUration? |
Yes, some newer devices report current and target value as well as the remaining duration. |
I think that the device should always use the user selected duration |
Currently, there's only one |
I think it would be nice to be able to retrieve the current configured transitionDuration and must-have to set a transitionDuration. maybe adjust it the same so you'll have currentDuration and targetDuration ? |
I'm wondering if it is desirable not to have an extra value to set the transition duration and instead pass it somehow along with the set command? |
This could be good but also setting a default value should be possible |
@marcelveldt we've been thinking - what's your take on adding another argument to setValue(/* targetValue ID */, 99, { duration: "2m" }); // transition to 99 over 2 minutes
setValue(/* thermostat setpoint ID */, 23, { scale: 1 }); // turn setpoint to 23 °C These additional properties would be discoverable via I'd prefer something like this, because it avoids littering applications with tons of single-purpose values. It would also allow you to define the transition duration, setpoint scale, etc. in a single location (e.g. once per node). The remaining duration would still be reported as a value like now. |
That sounds nice!
So calls 4 and 5 could actually be combined and perhaps the check done at 3 too ? |
Z-Wave does not have a concept of saving transition duration on a device. It can either get sent as part of the I'm guessing you're doing it that way because OZW had a settable duration parameter? In that case, the new process would be:
If no duration was given, zwave-js automatically sends a command with the default duration. |
Would changing the default duration be a separate setting, controllable through the API? |
@AlCalzone that sounds like a very valid approach and even an improvement over what we have now. |
Nothing defined in the specs. If there's an option to do that for a device, it is a device-specific configuration value. |
What does "default duration" mean in this context? |
It omits the duration field (so it sends a V1 command), which means a device should use the factory default duration - whatever that is. Alternatively we could think about explicitly including the duration field and setting it to 255 (=default) if that is necessary. |
Give me a ping once this is implemented so we can adjust our code. We will only send the duration if the user explicitly defines it and we'll not send it otherwise. |
Interesting, I hadn't thought of doing it that way. I suppose that will work as long as there are not any new versions of the Set command. Thanks for the clarification. |
There are. But the specs say (I know, who cares about specs - not the device manufacturers at least) to treat a V1 command (for Multilevel Switch at least) without duration the same as a V2+ command with a "default" duration. |
I meant the Set command itself, no new version since V2. If a V5 comes along with a new field, you would be required to set duration in addition with the new field. The specs say devices "should" (recommend) support V1. I wouldn't be surprised if there's some device that actually does take it as a "should" (or maybe the SDK handles it)! 😄 |
My Eaton dimmers are a great example of "should" taken literally. If no duration is set (i.e. they get a V1 set), then they use "0" instead of "default". Which mostly works (snaps instead of dims are a bit jarring), except when turning off. When told to turn off, they drop to about 8% and just stay there, instead of turning off. |
And if it's a V2 set with duration 0xFF, they function as expected? |
yup! 🤦 |
That seems like a good argument for generally using the V2 Set command for V2 devices. 😁 |
Is there a workaround to this issue at the moment (maybe settings some raw z-wave value through mqtt)? |
https://zwave-js.github.io/zwavejs2mqtt/#/guide/mqtt?id=send-command |
Yeah it does not appear so 😞 From what I can see, Duration class is just a class with one field, {
"args": [
{
"nodeId": 16,
"commandClass": 38,
"property": ""
},
"set",
[
50,
{
"_value": 5
}
]
]
} But second parameter is ignored (value is set to 50% with the default duration). |
If it helps any, even setting the "duration" via the ZWaveJS2MQTT Control Panel doesn't work. It results in this error in the logs:
This is for |
This is because the API expects a duration instance with the serializeSet method existing |
Would you be okay with accepting PR with little if in the |
Is your feature request related to a problem? Please describe.
Looks like setting the light transition duration is not implemented yet.
Describe the solution you'd like
Be able to set transition duration value.
Explaining your use-case will go a long way in helping us understand.
Home Assistant integration
Thanks!
The text was updated successfully, but these errors were encountered: