-
-
Notifications
You must be signed in to change notification settings - Fork 31.6k
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
zwaveJS: Closed status applied twice to cover when sending close command (on starting and completing the command) #47950
Comments
Hey there @home-assistant/z-wave, mind taking a look at this issue as its been labeled with an integration ( |
Please attach a dump of your device so we can look into this. |
Hello Chris,
Attached the requested dump.
The problem in a quick scan (not all of it, does not fit in one screen):
The light sensor starts an automation that closes the cover.
When the cover is closed another automation turns on the lights, to avoid light when the cover is not fully closed.
After the change to zwaveJS the cover is immediately closed by the cover automation.
This triggers the lights on.
During the close of the cover the status is, correctly, reset to opened.
Which turns the lights off again.
And after the real close the cover sets its status to closed and the lights are turned on a second time.
The original behaviour (with zwave 1.4) worked OK with manual use of the cover.
It is temporarily patched by turning the automation off before closing the cover, and turning it on after a couple of seconds.
Like to see the original behaviour, or an alternate way to do something after the cover is closed.
Regards,
Bert
Van: Chris ***@***.***>
Verzonden: maandag 22 maart 2021 16:13
Aan: home-assistant/core ***@***.***>
CC: hauserbv ***@***.***>; Author ***@***.***>
Onderwerp: Re: [home-assistant/core] zwaveJS: Closed status applied twice to cover when sending close command (on starting and completing the command) (#47950)
Please attach a dump of your device <https://www.home-assistant.io/integrations/zwave_js/#get-a-dump-of-the-current-network-state> so we can look into this.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub <#47950 (comment)> , or unsubscribe <https://github.com/notifications/unsubscribe-auth/ATHWNKCTZI5VUSR3DTPNE4TTE5NADANCNFSM4ZGZAN2A> . <https://github.com/notifications/beacon/ATHWNKEF2TONJPWEOWV3TSDTE5NADA5CNFSM4ZGZAN2KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOF7XDKIQ.gif>
|
Your file did not attach, please drag and drop it into your reply on github. |
As requested (it is a zip file)
Van: Chris ***@***.***>
Verzonden: maandag 22 maart 2021 17:41
Aan: home-assistant/core ***@***.***>
CC: hauserbv ***@***.***>; Author ***@***.***>
Onderwerp: Re: [home-assistant/core] zwaveJS: Closed status applied twice to cover when sending close command (on starting and completing the command) (#47950)
Your file did not attach, please drag and drop it into your reply on github.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub <#47950 (comment)> , or unsubscribe <https://github.com/notifications/unsubscribe-auth/ATHWNKA6F2YVOWZ4NWY4ZI3TE5XKHANCNFSM4ZGZAN2A> . <https://github.com/notifications/beacon/ATHWNKE6XOV6SFNJKWCLMTTTE5XKHA5CNFSM4ZGZAN2KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOF7XV72Y.gif>
|
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. |
We are not at home the next two weeks. Latest 2021-05 did not solve the problem. Still two times a close status, the first one premature (just starting the close action, not ending it).
…On June 20, 2021 5:12:42 PM UTC, "github-actions[bot]" ***@***.***> wrote:
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.>
>
-- >
You are receiving this because you authored the thread.>
Reply to this email directly or view it on GitHub:>
#47950 (comment)
--
Sent from my Android device with K-9 Mail. Please excuse my brevity.
|
thanks @hauserbv - unfortunately the attachment still hasn't worked. It looks like you are using email, perhaps email attachments don't get logged in GitHub. Can you try attaching your state dump directly to a comment on the GH website? Thanks! |
HI,
I am not at home. So it is at the moment not possible to resend the status.
Will be back home in 2 weeks.
The problem is simple.
* With old zwave 1.4 a cover sents its closed status only after being closed.
* With zwavejs the closed status is sent twice:
* 1. When requesting the close (by the automation)
* 2. When the cover is actually closed and the device sents its status (as the old zwave did)
* The first status is new to me and in my opinion redundant. This is especially true as between points 1 and 2 the device itself corrects its status by sending an open status (after point 1).
It all confuses my current set of automations (these turn the lights on after the close of a cover etc).
The cover is a Fibaro FGRM222 roller/shutter controller.
With regards.
Van: Raman Gupta ***@***.***>
Verzonden: maandag 21 juni 2021 20:59
Aan: home-assistant/core ***@***.***>
CC: hauserbv ***@***.***>; Mention ***@***.***>
Onderwerp: Re: [home-assistant/core] zwaveJS: Closed status applied twice to cover when sending close command (on starting and completing the command) (#47950)
thanks @hauserbv <https://github.com/hauserbv> - unfortunately the attachment still hasn't worked. It looks like you are using email, perhaps email attachments don't get logged in GitHub. Can you try attaching your state dump directly to a comment on the GH website? Thanks!
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub <#47950 (comment)> , or unsubscribe <https://github.com/notifications/unsubscribe-auth/ATHWNKAUYMWOJ3O2L3YYHLDTT6DW3ANCNFSM4ZGZAN2A> . <https://github.com/notifications/beacon/ATHWNKA3QUR4TGJKPWISKALTT6DW3A5CNFSM4ZGZAN2KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOGOJPN7Q.gif>
|
Now, in core2021.6.6 and zwavejs 0.1.28 the problem is still present. I noticed that in a situation where covers are embedded in groups the problem gets worse. Automation scripts and group are setting the status of the cover device. The device reacts by resetting its status every time until the device itself finds its status is closed. I have a temporarily fix by disabling/enabling the effected automations before and while the cover is physically closing. It may be possible to let the trigger check which component issued the status of the cover. But that seems insane as the only one who can say something about the status of a device is the device itself. The new dump: zwave_js_dump 2021-07-02 core2021.6.6 zwavejs0.1.28.json.zip |
This behavior you are observing is by design. It is implemented by the driver, node-zwave-js. I don't have a great solution for you, but I can explain what is happening. Maybe some answer will come of that. HA uses the Multilevel Switch CC to control shutters. When you open a cover in HA, you send a Multilevel Switch Set command with level 99, and to close you set level 0. These commands are the same when dimming a light switch (level 1-99) or turning it off (level 0). With Z-Wave, a roller shutter and a dimming light switch look the same from the driver and application point of view. They both use the Multilevel Switch CC. For a light the command adjusts the brightness. Because of numerous complaints by HA users, at some point node-zwave-js changed its design to optimistically report the current value of the multilevel switch CC based on the value just set target value. After a fixed time interval it will then perform a Get and refresh the actual value. By returning that optimistic value immediately, it avoids the "flip-flopping" of the light toggle element in the UI for slow dimming light switches, which was the chief complaint. In your case, what you are seeing is:
OpenZwave does the following:
So the different is the optimistic fake value issued by node-zwave-js. You cannot get the same behavior as OZW without a change in the driver. Via a configuration option you can disable this optimistic value update behavior ( I'll note there's actually a comment regarding this and window covers specifically in the docs for the config setting:
So a possible solution for you would be to disable this option in the driver configuration, but you could only do that with a non-addon installation. Another workaround I was thinking of would be to try and use Basic Set, but according to your dump, no Basic values are exposed to HA by node-zwave-js (I don't know why), so that cannot be used. The idea would have been to use Basic Set to control the devices, which would avoid the optimistic value refresh, and you'd get the expected behavior. (Basic Set is an alternative to Multilevel Switch Set) I don't know why node-zwave-js doesn't expose the Basic values, maybe it hides them in some cases. If these values were available, you could use them in your automation instead, at least that's my theory. A third solution would be to invoke the Basic CC Set command explicitly without using values, which is something not yet implemented in HA, but I think it is in the works. Sorry if some of that doesn't make sense, it's hard to detail if you don't know how the driver works. |
Hi,
Thank you for the detailed explanation how HA/zwavejs operate. As I have worked with an optimistic approach in database locking it sounds familiar. But my databases offered finer control to enable/disable optimistic behaviour during the program and support for handling things when optimistic did not work. For the time being my solution in HA by disable/enable the automations involved is OK. Only manual handling of the blind (does not disable/enable involved automations) gives the unwanted behaviour, but that is hardly used.
Another HA instance is under my supervision. That instance has 6 blinds that are controlled with a nested set of groups (All_blinds, Front_blinds etc). Last week the zwave 1.4 was migrated to zwavejs. Now every group announces the status of the underlying blinds. With the nested groups it is done more than two times. And every time the blinds are opened again after 5 seconds. That’s a lot of traffic, multiple statuses that roll over each other.
I can see possible solutions (outside changing the global setting):
* Separate the common logic between blind and dimmer
* The log shows what entity sets the status, if that data can be used in the trigger so only the status change by the device itself can start it.
* Local setting in the automation of the optimistic/pessimistic approach (only local effective for the automation using it).
* A new device setting that shows if optimistic/pessimistic approach can be used for the device (if the device itself is the only source for status changes).
I will request a change for the last option.
Regards,
Bert Verdonk (hauserbv)
Van: kpine ***@***.***>
Verzonden: donderdag 8 juli 2021 03:01
Aan: home-assistant/core ***@***.***>
CC: hauserbv ***@***.***>; Mention ***@***.***>
Onderwerp: Re: [home-assistant/core] zwaveJS: Closed status applied twice to cover when sending close command (on starting and completing the command) (#47950)
This behavior you are observing is by design. It is implemented by the driver, node-zwave-js. I don't have a great solution for you, but I can explain what is happening. Maybe some answer will come of that.
HA uses the Multilevel Switch CC to control shutters. When you open a cover in HA, you send a Multilevel Switch Set command with level 99, and to close you set level 0. These commands are the same when dimming a light switch (level 1-99) or turning it off (level 0).
With Z-Wave, a roller shutter and a dimming light switch look the same from the driver and application point of view. They both use the Multilevel Switch CC. For a light the command adjusts the brightness. Because of numerous complaints by HA users, at some point node-zwave-js changed its design to optimistically report the current value of the multilevel switch CC based on the value just set target value. After a fixed time interval it will then perform a Get and refresh the actual value. By returning that optimistic value immediately, it avoids the "flip-flopping" of the light toggle element in the UI for slow dimming light switches, which was the chief complaint.
In your case, what you are seeing is:
1. HA sets multilevel cc target value to 0 to close it
2. node-zwave-js sends the command to the node
3. node-zwave-js immediately returns the optimistic fake current value of 0 (closed) to the application (this confuses your automation)
4. The device may update the status on its own with different values, the current value will be updated in HA
5. If the device does not update the status, after 5 seconds node-zwave-js will issue a manual refresh
OpenZwave does the following:
1. HA sets multilevel cc target value to 0 to close it
2. OZW sends the command to the node
3. OZW issues a refresh (GET) immediately
4. Because it's still closing, the device returns a value that is not closed (not 0), either in response to the GET or on its own.
5. OZW returns the refreshed value to the application
6. The device may update the status on its own later, the current value will be updated in HA
So the different is the optimistic fake value issued by node-zwave-js. You cannot get the same behavior as OZW without a change in the driver. Via a configuration option <https://zwave-js.github.io/node-zwave-js/#/api/driver?id=zwaveoptions> you can disable this optimistic value update behavior (disableOptimisticValueUpdate). However, this setting is not accessible if you are using either of the addons, and a downside is that it is a global option, affecting all nodes and values. So if you did have some slow dimming light switches, their behavior would be worse.
I'll note there's actually a comment regarding this and window covers specifically in the docs for the config setting:
Some SET-type commands optimistically update the current value to match the target value when the device acknowledges the command.
While this generally makes UIs feel more responsive, it is not necessary for devices which report their status on their own and can lead to confusing behavior when dealing with slow devices like blinds.
So a possible solution for you would be to disable this option in the driver configuration, but you could only do that with a non-addon installation.
Another workaround I was thinking of would be to try and use Basic Set, but according to your dump, no Basic values are exposed to HA by node-zwave-js (I don't know why), so that cannot be used. The idea would have been to use Basic Set to control the devices, which would avoid the optimistic value refresh, and you'd get the expected behavior. (Basic Set is an alternative to Multilevel Switch Set)
I don't know why node-zwave-js doesn't expose the Basic values, maybe it hides them in some cases. If these values were available, you could use them in your automation instead, at least that's my theory.
A third solution would be to invoke the Basic CC Set command explicitly without using values, which is something not yet implemented in HA, but I think it is in the works.
Sorry if some of that doesn't make sense, it's hard to detail if you don't know how the driver works.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub <#47950 (comment)> , or unsubscribe <https://github.com/notifications/unsubscribe-auth/ATHWNKCUGRZGXCVETMJFYIDTWT2FNANCNFSM4ZGZAN2A> . <https://github.com/notifications/beacon/ATHWNKEF6UELTLZOUAWKK6DTWT2FNA5CNFSM4ZGZAN2KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOGQ3T45Y.gif>
|
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. |
If it is by design, it is in my opinion not the best design. There are in zwaveJS multiple sources that set the status of an object, including the best (and for me only) source: the object itself. Second there is a time constraint with covers (it takes time to close, so the actual status is postponed until the cover is closed.). |
The problem
After the change from Zwave 1.4 to zwaveJS I noticed a change in behaviour.
When a cover (= Fibaro FGR222) is closed, the close status comes twice.
in between it is detected that the cover is not closed and it is reopened again.
There are automations starting when the cover reaches the ´closed´ or ´open´ status. So there is unnneeded traffic.
What is version of Home Assistant Core has the issue?
2021.3.4 with zwaveJS
What was the last working version of Home Assistant Core?
2021.3.3 with Zwave 1.4
What type of installation are you running?
Home Assistant OS
Integration causing the issue
zwaeJS
Link to integration documentation on our website
No response
Example YAML snippet
# Put your YAML below this line
Anything in the logs that might be useful for us?
# Put your logs below this line
The text was updated successfully, but these errors were encountered: