OpenZWave / qt-openzwave

QT5 Wrapper for OpenZWave
GNU Lesser General Public License v3.0
104 stars 30 forks source link

Unchanging scene controller values in Home Assistant #73

Closed aav7fl closed 4 years ago

aav7fl commented 4 years ago

Hi. I'm having an issue with scenes between HA (0.109.5) and qt-openzwave:latest. I'm using a Hank 1-Button Scene Controller to control a device in Home Assistant.

This is likely similar to https://github.com/OpenZWave/qt-openzwave/issues/28, but it was closed and I wasn't sure if this was a different issue.

Previously when I was using the native Z-Wave controller in HA, I was detecting scene changes to trigger an event on my Hank 1-Button Scene Controller. I was planning to do the same with the qt-openzwave wrapper, but it's behaving a little differently than I expected.

I can see that my button sends both COMMAND_CLASS_BATTERY and COMMAND_CLASS_CENTRAL_SCENE over MQTT.

I can also confirm that both entities are visible in HA.

image

My problem is that when I push the button, qt-openzwave sends the COMMAND_CLASS_CENTRAL_SCENE but it's either being mis-interpreted or incorrect.

HA only ever interprets the COMMAND_CLASS_CENTRAL_SCENE value as 0 so I'm unable to detect scene changes (button presses)

Here are possible explanations I can come up with, but I'm not sure which are true.

I'm not sure if the problem lies in qt-openzwave, Home Assistant, or OpenZWave. Here are the logs for each command type send through qt-openzwave.

COMMAND_CLASS_BATTERY event log ```bash 2020-05-08T12:25:01.859536582Z [20200508 12:25:01.859 UTC] [ozw.library] [debug]: Detail - Node: 23 Received: 0x01, 0x09, 0x00, 0x04, 0x00, 0x17, 0x03, 0x80, 0x03, 0x64, 0x01, 2020-05-08T12:25:01.862608480Z [20200508 12:25:01.862 UTC] [ozw.library] [debug]: Detail - Node: 0 , 2020-05-08T12:25:01.865046683Z [20200508 12:25:01.864 UTC] [ozw.library] [info]: Info - Node: 23 Received Battery report from node 23: level=100, 2020-05-08T12:25:01.867250465Z [20200508 12:25:01.867 UTC] [ozw.library] [debug]: Detail - Node: 23 Refreshed Value: old value=27, new value=100, type=byte, 2020-05-08T12:25:01.869497157Z [20200508 12:25:01.869 UTC] [ozw.library] [debug]: Detail - Node: 23 Changes to this value are not verified, 2020-05-08T12:25:01.871652182Z [20200508 12:25:01.871 UTC] [ozw.library] [debug]: Detail - Node: 23 Notification: ValueChanged CC: COMMAND_CLASS_BATTERY Instance: 1 Index: 0, 2020-05-08T12:25:01.874135242Z [20200508 12:25:01.874 UTC] [ozw.notifications] [debug]: Notification pvt_valueChanged: 392167441, 2020-05-08T12:25:01.874349592Z [20200508 12:25:01.874 UTC] [ozw.mqtt.publisher] [debug]: Publishing Event valueChanged: 392167441, 2020-05-08T12:25:01.874441732Z [20200508 12:25:01.874 UTC] [ozw.mqtt.qt2js] [debug]: Field is Unchanged: "Event" Value: "valueChanged", 2020-05-08T12:25:01.874572748Z [20200508 12:25:01.874 UTC] [qt.mqtt.connection] [debug]: qint32 QMqttConnection::sendControlPublish(const QMqttTopicName&, const QByteArray&, quint8, bool, const QMqttPublishProperties&) QMqttTopicName("OpenZWave/1/node/23/instance/1/commandclass/128/value/392167441/") Size: 484 bytes. QoS: 0 Retain: true, 2020-05-08T12:25:01.874596164Z [20200508 12:25:01.874 UTC] [qt.mqtt.connection.verbose] [debug]: bool QMqttConnection::writePacketToTransport(const QMqttControlPacket&) DataSize: 553, 2020-05-08T12:25:01.874818358Z [20200508 12:25:01.874 UTC] [qt.mqtt.connection.verbose] [debug]: void QMqttConnection::transportReadReady(), 2020-05-08T12:25:01.874841843Z [20200508 12:25:01.874 UTC] [qt.mqtt.connection.verbose] [debug]: Received PUBLISH, 2020-05-08T12:25:01.874876036Z [20200508 12:25:01.874 UTC] [qt.mqtt.connection.verbose] [debug]: Finalize PUBLISH: topic: QMqttTopicName("OpenZWave/1/node/23/instance/1/commandclass/128/value/392167441/") payloadLength: 484, ```
COMMAND_CLASS_CENTRAL_SCENE event log ```bash 2020-05-08T12:25:03.539978936Z [20200508 12:25:03.539 UTC] [ozw.library] [debug]: Detail - Node: 23 Received: 0x01, 0x0b, 0x00, 0x04, 0x00, 0x17, 0x05, 0x5b, 0x03, 0x96, 0x00, 0x01, 0x2d, 2020-05-08T12:25:03.542706966Z [20200508 12:25:03.542 UTC] [ozw.library] [debug]: Detail - Node: 0 , 2020-05-08T12:25:03.544606486Z [20200508 12:25:03.544 UTC] [ozw.library] [info]: Info - Node: 23 Received Central Scene set from node 23: scene id=1 with key Attribute 0. Sending event notification., 2020-05-08T12:25:03.546487916Z [20200508 12:25:03.546 UTC] [ozw.library] [debug]: Detail - Node: 23 Refreshed Value: old value=0, new value=1, type=list, 2020-05-08T12:25:03.548345924Z [20200508 12:25:03.548 UTC] [ozw.library] [debug]: Detail - Node: 23 Changes to this value are not verified, 2020-05-08T12:25:03.550217592Z [20200508 12:25:03.550 UTC] [ozw.library] [info]: Info - Node: 23 Automatically Clearing Scene 1 in 1000ms, 2020-05-08T12:25:03.552096381Z [20200508 12:25:03.551 UTC] [ozw.library] [info]: Info - Node: 0 Timer: adding event in 1000 ms, 2020-05-08T12:25:03.554450649Z [20200508 12:25:03.554 UTC] [ozw.library] [debug]: Detail - Node: 0 Timer: waiting with timeout 1000 ms, 2020-05-08T12:25:03.557093892Z [20200508 12:25:03.556 UTC] [ozw.library] [debug]: Detail - Node: 23 Notification: ValueChanged CC: COMMAND_CLASS_CENTRAL_SCENE Instance: 1 Index: 1, 2020-05-08T12:25:03.559290631Z [20200508 12:25:03.559 UTC] [ozw.notifications] [debug]: Notification pvt_valueChanged: 281475368271892, 2020-05-08T12:25:03.559554241Z [20200508 12:25:03.559 UTC] [ozw.mqtt.publisher] [debug]: Publishing Event valueChanged: 281475368271892, 2020-05-08T12:25:03.559614327Z [20200508 12:25:03.559 UTC] [ozw.mqtt.qt2js] [debug]: Field is Unchanged: "Event" Value: "valueChanged", 2020-05-08T12:25:03.559798474Z [20200508 12:25:03.559 UTC] [qt.mqtt.connection] [debug]: qint32 QMqttConnection::sendControlPublish(const QMqttTopicName&, const QByteArray&, quint8, bool, const QMqttPublishProperties&) QMqttTopicName("OpenZWave/1/node/23/instance/1/commandclass/91/value/281475368271892/") Size: 967 bytes. QoS: 0 Retain: true, 2020-05-08T12:25:03.559806298Z [20200508 12:25:03.559 UTC] [qt.mqtt.connection.verbose] [debug]: bool QMqttConnection::writePacketToTransport(const QMqttControlPacket&) DataSize: 1041, 2020-05-08T12:25:03.559935975Z [20200508 12:25:03.559 UTC] [qt.mqtt.connection.verbose] [debug]: void QMqttConnection::transportReadReady(), 2020-05-08T12:25:03.559954041Z [20200508 12:25:03.559 UTC] [qt.mqtt.connection.verbose] [debug]: Received PUBLISH, 2020-05-08T12:25:03.559977803Z [20200508 12:25:03.559 UTC] [qt.mqtt.connection.verbose] [debug]: Finalize PUBLISH: topic: QMqttTopicName("OpenZWave/1/node/23/instance/1/commandclass/91/value/281475368271892/") payloadLength: 967, ```
Fishwaldo commented 4 years ago

You need to open a ticket on the HASS integration. Scenes will work differently in the new integration (in OZW 1.4 it wasn’t fully supported).

Based on the logs provided, ozwdaemon is sending the correct MQTT topic.