qt-openzwave icon indicating copy to clipboard operation
qt-openzwave copied to clipboard

Buttons not being supported

Open Borcon opened this issue 3 years ago • 1 comments

If i try to send a button command an error appears in the log.

[20200728 20:22:16.303 CEST] [ozw.library] [warning]: Warning - Node: 0 Exception: Manager.cpp:2629 - 102 - ValueID passed to SetValue is not a bool Value [20200728 20:22:16.305 CEST] [ozw.values] [warning]: OZW Exception: ValueID passed to SetValue is not a bool Value at /usr/src/ozw/cpp/src/Manager.cpp : 2629 if i send the mqtt command, i can see in ozw admin under "System Values" that the Reset changed from false to true

I tried to reset the energy meter from a fibaro wall plug. { "ValueIDKey": 72339069078372376, "Value": true/false }

Borcon avatar Jul 28 '20 18:07 Borcon

I think this is because the Button type is being treated as a boolean? https://github.com/OpenZWave/qt-openzwave/blob/89cc0d86c983101aacd89c780bae18bb3dffe9b4/qt-openzwave/source/qtozwmanager_p.cpp#L2206-L2210

Manager::SetValue() for bool only handles ValueType_Bool. There is a special API for button presses and releases. I think it would need to be written as:

    case OpenZWave::ValueID::ValueType_Button:
    {
        if (topLeft.data().toBool())
        {
            this->m_manager->PressButton(vid);
        }
        else
        {
            this->m_manager->ReleaseButton(vid);
        }
        return;
    }

kpine avatar Jul 28 '20 18:07 kpine