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
70.48k stars 29.41k forks source link

core_zwave_js crashes when adding climate node & general unreliability in setting temperature setpoint #46324

Closed StyxyDog closed 3 years ago

StyxyDog commented 3 years ago

The problem

I have a number of Thermostatic radiator valves POPP 010101. They work correctly and well in OpenZwave. After moving to Zwave-JS I have found them to be unreliable - very problematic to set a temperature from Home Assistant. Today after updating to Z-Wave JS 0.1.6 I thought I would try adding a brand new device - same as the ones above that are already included in the network. On adding the addon crashes and has to be restorarted. I thought that perhaps whatever issue is preventing this device being successfully added might also be causing the reliability issues.

What is version of Home Assistant Core has the issue?

2021.2.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

Z-Wave JS

Link to integration documentation on our website

https://www.home-assistant.io/integrations/zwave_js/

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
11:12:54.106 CNTRLR   [Node 059] Node 59 did not respond after 3 attempts, it is presumed dead
This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason:
ZWaveError: Failed to send the command after 3 attempts (Status NoAck)
    at Object.sendDataErrorToZWaveError (/usr/lib/node_modules/@zwave-js/server/node_modules/zwave-js/src/lib/driver/StateMachineShared.ts:112:12)
    at /usr/lib/node_modules/@zwave-js/server/node_modules/zwave-js/src/lib/driver/SendThreadMachine.ts:437:4
    at /usr/lib/node_modules/@zwave-js/server/node_modules/xstate/lib/utils.js:410:33
    at Array.reduce (<anonymous>)
    at Object.updateContext (/usr/lib/node_modules/@zwave-js/server/node_modules/xstate/lib/utils.js:400:25)
    at Object.resolveActions (/usr/lib/node_modules/@zwave-js/server/node_modules/xstate/lib/actions.js:409:19)
    at StateNode.resolveTransition (/usr/lib/node_modules/@zwave-js/server/node_modules/xstate/lib/StateNode.js:787:35)
    at StateNode.transition (/usr/lib/node_modules/@zwave-js/server/node_modules/xstate/lib/StateNode.js:733:21)
    at StateNode.resolveRaisedTransition (/usr/lib/node_modules/@zwave-js/server/node_modules/xstate/lib/StateNode.js:738:22)
    at StateNode.resolveTransition (/usr/lib/node_modules/@zwave-js/server/node_modules/xstate/lib/StateNode.js:873:39)
This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason:
ZWaveError: Node 59 did not respond after 3 attempts, it is presumed dead
    at reduceTransaction (/usr/lib/node_modules/@zwave-js/server/node_modules/zwave-js/src/lib/driver/SendThreadMachine.ts:600:8)
    at queue (/usr/lib/node_modules/@zwave-js/server/node_modules/zwave-js/src/lib/driver/SendThreadMachine.ts:616:5)
    at /usr/lib/node_modules/@zwave-js/server/node_modules/xstate/lib/utils.js:418:31
    at Array.reduce (<anonymous>)
    at Object.updateContext (/usr/lib/node_modules/@zwave-js/server/node_modules/xstate/lib/utils.js:400:25)
    at Object.resolveActions (/usr/lib/node_modules/@zwave-js/server/node_modules/xstate/lib/actions.js:409:19)
    at StateNode.resolveTransition (/usr/lib/node_modules/@zwave-js/server/node_modules/xstate/lib/StateNode.js:787:35)
    at StateNode.transition (/usr/lib/node_modules/@zwave-js/server/node_modules/xstate/lib/StateNode.js:733:21)
    at /usr/lib/node_modules/@zwave-js/server/node_modules/xstate/lib/interpreter.js:606:34
    at Object.provide (/usr/lib/node_modules/@zwave-js/server/node_modules/xstate/lib/serviceScope.js:11:18)
11:12:54.454 DRIVER   unexpected response, discarding...
11:12:54.461 CNTRLR   Failed to execute controller command after 1/3 attempts. Scheduling next try i
                      n 100 ms.
[cont-finish.d] executing container finish scripts...
[cont-finish.d] done.
[s6-finish] waiting for services.
[s6-finish] sending all processes the TERM signal.
[s6-finish] sending all processes the KILL signal and exiting.

This is a Raspberry Pi 4 running the 64 bit image. The Zwave stick reports as HUSBZB-1 by Sigma Designs (Former Zensys). However its an unbranded device I've used for a long time in HA. I am currently swapping SD cards on the PI to go between running stable OpenZwave (beta) and experimenting with Zwave JS.

probot-home-assistant[bot] commented 3 years ago

Hey there @home-assistant/z-wave, mind taking a look at this issue as its been labeled with an integration (zwave_js) you are listed as a codeowner for? Thanks! (message by CodeOwnersMention)

StyxyDog commented 3 years ago

zwave_js_dump.jsonl.txt After restarting Zwave JS addon and waking the node It seems to be added and reporting correctly. However setting the temperature from HA is still not possible. Or at least not reliable.

Chaotic commented 3 years ago

I'm running into similar issues with the stand alone docker images and not being able to reliably control my thermostat from HA.

I have the same HUSBZB-1 stick and have a CT101 thermostat. I can control other zwave devices fine just not the thermostat.

paszczaq commented 3 years ago

Related to climate but different behavior - Eurotronic Spirit-Z - very slow respond to temperature change in UI - and crash of zwavejs integration after setting Energy Heat or Full Power. Using ZWaveJSMQTT (w/o mqtt).

MartinHjelmare commented 3 years ago

Please don't report different behavior in the same issue. Open a separate issue so we can track each behavior separately. If the behavior is different, it's usually a different cause.

Beiri22 commented 3 years ago

I've got some new insights:

When setting multiple values for the temperature in a row, the old zwave-integration submitted the last value to my thermostat. The new zwave-js is submitting every value, which is not as intended. See the example.

I use a manual control device. Today I did a swipe from 20 to 15 to 20 (in steps of 0.5°C). I would expect the system to transmit the final value 20°C to my thermostats on next wakeup. But it's submitting one value per wakeup. So the temperature will be changing for a few hours until it reaches 20°C again.

Do you observe a similar behaviour?

marcelveldt commented 3 years ago

There are 2 issues here:

1) HA is waiting for the command to set a new target temperature while it shouldn't (because this is a battery powered device).

2) If you send multiple commands to a battery powered node, all commands are queued instead of only processing the last one. This is a feature request: https://github.com/zwave-js/node-zwave-js/issues/1482

If we fix 1, it will at least be a little bit more reliable (because now it gets stuck waiting for the command to succeed) and if 2 gets fixed at some point in zwavejs, it will be perfect.

marcelveldt commented 3 years ago

This issue is fixed in HA 2021.3 (beta2 and up). Please reopen if you still have issues. Thanks!