-
-
Notifications
You must be signed in to change notification settings - Fork 600
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
When a device reports no targetValue, should targetValue be set to currentValue? #895
Comments
This comment has been minimized.
This comment has been minimized.
IMO the correct behavior is to set the target to current when it doesn't automatically report it |
But how do we know if it doesn't automatically report it? |
Depending on the CC version the device supports |
I though that my Qubino had the new CC version but yet it still didn't report the target. |
I didn't take a look at your logs yet but it is entirely possible that it only reports the current value although it supports reporting both. |
@AlCalzone How does ozw handles this? Anyway I'm +1 for the solution you proposed here |
They update the target value if it is included in the report: I have a feeling that exposing |
I think exposing it as undefined is never a good option, when it's undefined it should be set to the current always |
The current behavior is not working as intended (was broken by #1103, will be fixed by #1139). This leaves the synchronization of current and target on old CC versions (a). I don't think (b) is feasibly because this is possible:
If we used currentValue as the targetValue in any of the reports, it would be wrong, because it is not the targetValue. |
@AlCalzone did #1139 end up in 5.5.0? |
It did |
I did not follow the entire conversion, but the current state of this is confusing, could you help clarify? I have a Multilevel V2 Switch, which has no target value support. Here's what I've observed:
How should an application (namely HA), which should support all versions of switches, deal with these values? Currently HA uses the targetValue to report brightness. My switch currently shows a brightness of 100% because it's converting 255 to max brightness. In reality, the 255 was the toggle command from the Set. It cannot simply check for the existence of targetValue, because it seems to always be defined, but invalid for V2 switches. Should it check the version of the CC to determine if it should look at targetValue? Applications should be insulated from knowing these details. Can the targetValue be set to write-only for < V4 switches? An application could check if it's readable, if not use the currentValue. Should it, for now, always use currentValue? Ideally, the application would want to set targetValue if it's available to avoid incorrect state. Some of these questions would be answered based on how this bug is ultimately fixed. But for now, what would be the right guidance? |
If you want to report a state, use
That would be ideal, but currently it is not possible due to how value IDs are defined in zwave-js. It is on the agenda though. |
Technical background (Relevant for all Switch type CCs):
Newer devices have the ability to report a targetValue that is different from the currentValue. E.g. for a multi-second dimming operation (or shutters). This way you can see where the value is going, where it currently is and how long it will take
You don't have that option when blindly merging current and target value.
We could think about how to make this smarter but its not trivial:
a) Old CC version, not distinguishing between target and current
b) New CC version, reporting current but not target version
c) New CC version, reporting both
The current behavior (setting targetValue to undefined when a node does not report it) however causes this:
#1090 (comment)
The text was updated successfully, but these errors were encountered: