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

Fibaro FGRM-222 roller shutter position command incorrectly processed

Open balk77 opened this issue 4 years ago • 3 comments

Hi, I am using QT-Openzwave 109 (see below) with a Fibaro FGRM 222 roller shutter. It does not accept values from 0-100 but only from 0-99. The Min and Max values are 0 and 100. See topic below. ~~The Value in OpenZWave/1/node/24/instance/1/commandclass/145/value/409223185/ does not change at all in both cases (remains 0).~~ I just found out that I was using the wrong topic. Interestingly both topics respond to the position command, and both do not accept 100. The correct topic is OpenZWave/1/node/24/instance/1/commandclass/38/value/407470097/.

There are two issues here: ~~1) The value does not get updated which means that Home Assistant does not receive back the actual position. I will set it to optimistic mode~~ 2) The value of 100 is not accepted but the code suggests it should.

Is this a bug or a feature? Am I using the position topic wrong?

QT Openzwave logs:

When I send a command 100, the following shows up in the logs, and it does not move:

[20200530 12:02:05.236 UTC] [ozw.mqtt.commands] [debug]: Got  "OpenZWave/1/command/setvalue/"  Message:  "{ \"ValueIDKey\":409223185, \"Value\": 100 }"
[20200530 12:02:05.239 UTC] [ozw.mqtt.commands.setValue] [info]: Setting  409223185  to Value  QVariant(uint, 100)
[20200530 12:02:05.240 UTC] [ozw.mqtt.commands] [info]: Processed Message for  "setvalue" :  "{ \"ValueIDKey\":409223185, \"Value\": 100 }"

When I issue a value of 99, it moves:

[20200530 12:02:21.882 UTC] [ozw.mqtt.commands] [debug]: Got  "OpenZWave/1/command/setvalue/"  Message:  "{ \"ValueIDKey\":409223185, \"Value\": 99 }"
[20200530 12:02:21.884 UTC] [ozw.mqtt.commands.setValue] [info]: Setting  409223185  to Value  QVariant(uint, 99)
[20200530 12:02:21.885 UTC] [ozw.values] [debug]: setData Called for Row 715  With Value QVariant(uint, 99)
[20200530 12:02:21.885 UTC] [ozw.values] [debug]: valueModel Changed! QTOZW_ValueIds::Value - 715 :  QVariant(uint, 99)
[20200530 12:02:21.886 UTC] [ozw.values] [debug]: valueModel Changed! vidKey: 409223185 QVariant(uint, 99)
[20200530 12:02:21.886 UTC] [ozw.library] [info]: Info - Node: 24 Value::Set - COMMAND_CLASS_MANUFACTURER_PROPRIETARY - Venetian Blind slat position - 0 - 1 - 99
[20200530 12:02:21.886 UTC] [ozw.library] [debug]: Detail - Node: 24 Queuing (Send) ManufacturerProprietary_SetValue (Node=24): 0x01, 0x0f, 0x00, 0x13, 0x18, 0x09, 0x91, 0x01, 0x0f, 0x26, 0x01, 0x02, 0x63, 0x00, 0x25, 0xa3, 0xad
[20200530 12:02:21.886 UTC] [ozw.library] [debug]: Detail - Node: 24 Queuing (Send) ManufacturerProprietary_RequestValue (Node=24): 0x01, 0x0f, 0x00, 0x13, 0x18, 0x08, 0x91, 0x01, 0x0f, 0x26, 0x02, 0x02, 0x00, 0x00, 0x25, 0xa4, 0xcb
[20200530 12:02:21.887 UTC] [ozw.library] [debug]: Detail - Node: 0 
[20200530 12:02:21.887 UTC] [ozw.library] [info]: Info - Node: 24 Sending (Send) message (Callback ID=0xa3, Expected Reply=0x04) - ManufacturerProprietary_SetValue (Node=24): 0x01, 0x0f, 0x00, 0x13, 0x18, 0x09, 0x91, 0x01, 0x0f, 0x26, 0x01, 0x02, 0x63, 0x00, 0x25, 0xa3, 0xad
[20200530 12:02:21.887 UTC] [ozw.mqtt.commands] [info]: Processed Message for  "setvalue" :  "{ \"ValueIDKey\":409223185, \"Value\": 99 }"
[20200530 12:02:21.888 UTC] [ozw.library] [info]: Info - Node: 24 Encrypted Flag is 0
[20200530 12:02:21.897 UTC] [ozw.library] [debug]: Detail - Node: 24   Received: 0x01, 0x04, 0x01, 0x13, 0x01, 0xe8
[20200530 12:02:21.897 UTC] [ozw.library] [debug]: Detail - Node: 24   ZW_SEND_DATA delivered to Z-Wave stack
[20200530 12:02:21.947 UTC] [ozw.library] [debug]: Detail - Node: 24   Received: 0x01, 0x07, 0x00, 0x13, 0x77, 0x00, 0x00, 0x05, 0x99
[20200530 12:02:21.949 UTC] [ozw.library] [debug]: Detail - Node: 24   ZW_SEND_DATA Request with callback ID 0x77 received (expected 0xa3)
[20200530 12:02:21.950 UTC] [ozw.library] [warning]: Warning - Node: 24 WARNING: Unexpected Callback ID received
[20200530 12:02:23.087 UTC] [ozw.library] [debug]: Detail - Node: 24   Received: 0x01, 0x0c, 0x00, 0x04, 0x00, 0x18, 0x06, 0x31, 0x05, 0x04, 0x22, 0x04, 0x7b, 0x84

Device topic

OpenZWave/1/node/24/
{
    "NodeID": 24,
    "NodeQueryStage": "Complete",
    "isListening": true,
    "isFlirs": false,
    "isBeaming": true,
    "isRouting": true,
    "isSecurityv1": false,
    "isZWavePlus": false,
    "isNIFRecieved": true,
    "isAwake": true,
    "isFailed": false,
    "MetaData": {
        "OZWInfoURL": "",
        "ZWAProductURL": "",
        "ProductPic": "",
        "Description": "",
        "ProductManualURL": "",
        "ProductPageURL": "",
        "InclusionHelp": "",
        "ExclusionHelp": "",
        "ResetHelp": "",
        "WakeupHelp": "",
        "ProductSupportURL": "",
        "Frequency": "",
        "Name": "",
        "ProductPicBase64": ""
    },
    "Event": "nodeQueriesComplete",
    "TimeStamp": 1590610872,
    "NodeManufacturerName": "FIBARO System",
    "NodeProductName": "FGRM222 Roller Shutter Controller 2",
    "NodeBasicString": "Routing Slave",
    "NodeBasic": 4,
    "NodeGenericString": "Multilevel Switch",
    "NodeGeneric": 17,
    "NodeSpecificString": "Motor Control Class B",
    "NodeSpecific": 6,
    "NodeManufacturerID": "0x010f",
    "NodeProductType": "0x0302",
    "NodeProductID": "0x1000",
    "NodeBaudRate": 40000,
    "NodeVersion": 4,
    "NodeGroups": 3,
    "NodeName": "",
    "NodeLocation": "",
    "NodeDeviceTypeString": "Unknown Type (0x0000)",
    "NodeDeviceType": 0,
    "NodeRole": 0,
    "NodeRoleString": "Central Controller",
    "NodePlusType": 0,
    "NodePlusTypeString": "Z-Wave+ node",
    "Neighbors": [
        1,
        9,
        13,
        14,
        15,
        20,
        21
    ]
}

Position topic (wrong)

OpenZWave/1/node/24/instance/1/commandclass/145/value/409223185/
{
    "Label": "Venetian Blind slat position",
    "Value": 0,
    "Units": "%",
    "ValueSet": false,
    "ValuePolled": false,
    "ChangeVerified": false,
    "Min": 0,
    "Max": 100,
    "Type": "Byte",
    "Instance": 1,
    "CommandClass": "COMMAND_CLASS_MANUFACTURER_PROPRIETARY",
    "Index": 0,
    "Node": 24,
    "Genre": "User",
    "Help": "",
    "ValueIDKey": 409223185,
    "ReadOnly": false,
    "WriteOnly": false,
    "Event": "valueAdded",
    "TimeStamp": 1590610812
}

Position topic (correct)

OpenZWave/1/node/24/instance/1/commandclass/38/value/407470097/
{
    "Label": "Level",
    "Value": 97,
    "Units": "",
    "ValueSet": false,
    "ValuePolled": false,
    "ChangeVerified": false,
    "Min": 0,
    "Max": 255,
    "Type": "Byte",
    "Instance": 1,
    "CommandClass": "COMMAND_CLASS_SWITCH_MULTILEVEL",
    "Index": 0,
    "Node": 24,
    "Genre": "User",
    "Help": "The Current Level of the Device",
    "ValueIDKey": 407470097,
    "ReadOnly": false,
    "WriteOnly": false,
    "Event": "valueChanged",
    "TimeStamp": 1590841099
}

Version QT-Openzwave

OpenZWave/1/status/
{
    "OpenZWave_Version": "1.6.1133",
    "OZWDaemon_Version": "0.1.109",
    "QTOpenZWave_Version": "1.1.0",
    "QT_Version": "5.12.5",
    "Status": "driverAllNodesQueried",
    "TimeStamp": 1590610872,
    "ManufacturerSpecificDBReady": true,
    "homeID": 3319801868,
    "getControllerNodeId": 1,
    "getSUCNodeId": 1,
    "isPrimaryController": true,
    "isBridgeController": false,
    "hasExtendedTXStatistics": false,
    "getControllerLibraryVersion": "Z-Wave 3.95",
    "getControllerLibraryType": "Static Controller",
    "getControllerPath": "/dev/ttyACM0"
}

balk77 avatar May 30 '20 12:05 balk77

For COMMAND_CLASS_SWITCH_MULTILEVEL Set command, a value of 100 is not valid. 0 is off and 99 is 100%. Anything in-between 100 and 255 is reserved.

image

kpine avatar May 30 '20 19:05 kpine

Thanks, clear. I was first looking at the wrong topic which also accepts commands to move the blinds. And it has "Min": 0 and "Max": 100 as limits. Still I do not understand why the 145 and 38 topics both accept commands to move the blind.

OpenZWave/1/node/24/instance/1/commandclass/145/value/409223185/
{
    "Label": "Venetian Blind slat position",
    "Value": 0,
    "Units": "%",
    "ValueSet": false,
    "ValuePolled": false,
    "ChangeVerified": false,
    "Min": 0,
    "Max": 100,
    "Type": "Byte",
    "Instance": 1,
    "CommandClass": "COMMAND_CLASS_MANUFACTURER_PROPRIETARY",
    "Index": 0,
    "Node": 24,
    "Genre": "User",
    "Help": "",
    "ValueIDKey": 409223185,
    "ReadOnly": false,
    "WriteOnly": false,
    "Event": "valueAdded",
    "TimeStamp": 1590610812
}

balk77 avatar May 30 '20 20:05 balk77

I don't have the device so I can't say why the COMMAND_CLASS_MANUFACTURER_PROPRIETARY value is moving the blinds. As the label says, it appears to be for changing Venetian blind slat positions. Maybe it also happens to provide the same functionality as COMMAND_CLASS_SWITCH_MULTILEVEL depending on the configuration?

The SWITCH_MULTILEVEL command class is the standard one specified for window coverings.

kpine avatar May 30 '20 20:05 kpine