Version
Build/Run method
zwavejs2mqtt version: master branch (zwave-js from branch fix-ztrm2 - now merged into master)
Describe the bug
In Home Assistant my Thermofloor z-trm2fx aka Heatit Thermostat TF 056 is not properly identified on the climate plattform. I see all the sensors and switches, but no climate controll. Might this be related to this?
To Reproduce
It's consistent with all 6 of my thermostats, I did also try to exclude and include but no change in HASS.
However I do notice an error in the logs:
zwavejs2mqtt_1 | 2021-01-11 09:38:23.350 ERROR GATEWAY: Error while discovering device climate_thermostat of node 49: Cannot read property 'id' of undefined Cannot read property 'id' of undefined
zwavejs2mqtt_1 | TypeError: Cannot read property 'id' of undefined
zwavejs2mqtt_1 | at Gateway.valueTopic (/usr/src/app/lib/Gateway.js:868:23)
zwavejs2mqtt_1 | at Gateway.discoverDevice (/usr/src/app/lib/Gateway.js:1126:16)
zwavejs2mqtt_1 | at /usr/src/app/lib/Gateway.js:360:40
zwavejs2mqtt_1 | at Array.forEach (<anonymous>)
zwavejs2mqtt_1 | at Gateway.onNodeStatus (/usr/src/app/lib/Gateway.js:360:17)
zwavejs2mqtt_1 | at ZwaveClient.emit (events.js:314:20)
zwavejs2mqtt_1 | at ZwaveClient.EventEmitter.emit (domain.js:483:12)
zwavejs2mqtt_1 | at ZwaveClient.onNodeStatus (/usr/src/app/lib/ZwaveClient.js:247:10)
zwavejs2mqtt_1 | at ZwaveClient.onNodeReady (/usr/src/app/lib/ZwaveClient.js:275:16)
zwavejs2mqtt_1 | at ZWaveNode.emit (events.js:326:22)
zwavejs2mqtt_1 | at ZWaveNode.EventEmitter.emit (domain.js:483:12)
zwavejs2mqtt_1 | at ZWaveNode.onReadyChange (/usr/src/app/node_modules/zwave-js/src/lib/node/Node.ts:441:19)
zwavejs2mqtt_1 | at /usr/src/app/node_modules/zwave-js/src/lib/node/Node.ts:227:10
zwavejs2mqtt_1 | at Interpreter.update (/usr/src/app/node_modules/xstate/lib/interpreter.js:255:17)
zwavejs2mqtt_1 | at /usr/src/app/node_modules/xstate/lib/interpreter.js:125:23
zwavejs2mqtt_1 | at Scheduler.process (/usr/src/app/node_modules/xstate/lib/scheduler.js:60:13)
zwavejs2mqtt_1 | 2021-01-11 09:38:23.352 INFO ZWAVE: Node 49 ready: ThermoFloor - Z-TRM2fx (Floor thermostat)
zwavejs2mqtt_1 | 2021-01-11 09:38:23.353 INFO ZWAVE: Node 49: interview completed, all values are updated
zwavejs2mqtt_1 | 2021-01-11 09:38:23.353 ERROR GATEWAY: Error while discovering device climate_thermostat of node 49: Cannot read property 'id' of undefined Cannot read property 'id' of undefined
zwavejs2mqtt_1 | TypeError: Cannot read property 'id' of undefined
zwavejs2mqtt_1 | at Gateway.valueTopic (/usr/src/app/lib/Gateway.js:868:23)
zwavejs2mqtt_1 | at Gateway.discoverDevice (/usr/src/app/lib/Gateway.js:1126:16)
zwavejs2mqtt_1 | at /usr/src/app/lib/Gateway.js:360:40
zwavejs2mqtt_1 | at Array.forEach (<anonymous>)
zwavejs2mqtt_1 | at Gateway.onNodeStatus (/usr/src/app/lib/Gateway.js:360:17)
zwavejs2mqtt_1 | at ZwaveClient.emit (events.js:314:20)
zwavejs2mqtt_1 | at ZwaveClient.EventEmitter.emit (domain.js:483:12)
zwavejs2mqtt_1 | at ZwaveClient.onNodeStatus (/usr/src/app/lib/ZwaveClient.js:247:10)
zwavejs2mqtt_1 | at ZwaveClient.onNodeInterviewCompleted (/usr/src/app/lib/ZwaveClient.js:314:16)
zwavejs2mqtt_1 | at ZWaveNode.emit (events.js:326:22)
zwavejs2mqtt_1 | at ZWaveNode.EventEmitter.emit (domain.js:483:12)
zwavejs2mqtt_1 | at ZWaveNode.interview (/usr/src/app/node_modules/zwave-js/src/lib/node/Node.ts:989:8)
zwavejs2mqtt_1 | at Driver.interviewNode (/usr/src/app/node_modules/zwave-js/src/lib/driver/Driver.ts:860:10)
Expected behavior
An climate entity for each thermostat in HASS
Let me know how I can help! As this device already is present in hass/devices.js I'm all out of clues?
@jkaberg Could you try removing it from devices.js?
@robertsLando I tried that just now, and when I do zwavejs2mqtt hangs on the first Thermostat it tries to interview. Adding it back lets z2m start like normal
There where no errors: it just stops logging and the UI is none-responsive
@jkaberg Are you using dev tag?
@robertsLando No, I'm building the container myself using Dockerfile.contrib:
DOCKER_BUILDKIT=1 docker build --build-arg SRC=git-clone-src --build-arg Z2M_BRANCH=master --build-arg ZWJ_BRANCH=fix-ztrm2fx --no-cache -t zwavejs2mqtt .
@jkaberg COuld you try to rebuild it now? Because I submitted a fix an hour ago about climate discovery that caused an infinite loop in some cases. So it may work now :)
Sure, built now with (as the fix-ztrm2fx was merged to zwave-js master):
DOCKER_BUILDKIT=1 docker build --build-arg SRC=git-clone-src --build-arg Z2M_BRANCH=master --build-arg ZWJ_BRANCH=master --no-cache -t zwavejs2mqtt .
with compose:
zwavejs2mqtt:
image: zwavejs2mqtt
restart: unless-stopped
depends_on:
- mosquitto
security_opt:
- seccomp:unconfined
devices:
- /dev/serial/by-id/usb-0658_0200-if00:/dev/ttyACM0
volumes:
- ${STORAGE_DIR}/zwavejs2mqtt:/usr/src/app/store
- ./devices.js:/usr/src/app/hass/devices.js
and:
zwavejs2mqtt_1 | 2021-01-11 11:18:56.488 INFO GATEWAY: New climate device discovered: {"type":"climate","object_id":"climate","discovery_payload":{"min_temp":5,"max_temp":40,"temp_step":0.5,"modes":["off","heat","cool","auto"],"mode_state_topic":"64-1-mode","mode_state_template":"{{ value_json.value }}","mode_command_topic":"64-1-mode/set","current_temperature_topic":"49-2-Air temperature","current_temperature_template":"{{ value_json.value }}","temperature_state_topic":true,"temperature_state_template":"{{ value_json.value }}","temperature_command_topic":true},"values":["49-2-Air temperature","64-1-mode","67-1-setpoint-1","67-1-setpoint-2","67-1-setpoint-11"],"mode_map":{"off":0,"heat":1,"cool":2},"setpoint_topic":{"1":"67-1-setpoint-1","2":"67-1-setpoint-2","11":"67-1-setpoint-11"},"default_setpoint":"67-1-setpoint-1"}
And now they all exist in HASS 馃槃
So my local changes to hass/devices.js consists of removing these lines. This with master of both zjs and z2m makes my Thermostats finaly work 馃槃
Perfect! Thanks :)