Zwave understanding

I could really do with a bit of guidance please
I have a Fibaro-101 push button
When i press it twice i get the following

msg.payload : Object
object
event: "VALUE_NOTIFICATION"
timestamp: 20/04/2026, 13:53:45 [UTC+1]
nodeId: 24
nodeName: "Push Button"
nodeLocation: undefined
eventBody: object
valueId: object
commandClassName: "Central Scene"
commandClass: 91
property: "scene": "001"
propertyName: "scene"
propertyKeyName: "001"
value: 3

I have written a if statement to capture the value:3 but it doesn’t seem to work.

Any help would be appreciated

Many thanks
Andrew

What happens if you use a switch node to compare msg.payload.value and (numeric) 3, the output connected to a debug node?

Hard to help with limited info, showing us the if statement, and a proper output from the debug sidebar copy value, would make it clearer.

But guessing the value 3 would be in
msg.payload.eventBody.value

There’s a great page in the docs (Working with messages : Node-RED) that will explain how to use the debug panel to find the right path/value for any data item.

Pay particular attention to the part about the buttons that appear under your mouse pointer when you over hover a debug message property in the sidebar.

BX00Cy7yHi

For value_notification
It’s msg.payload.eventBody.value

See below manual

As its value is only good at time of event for this event type. hence its neither prevValue or newValue :grin:

Ie its not stateful

Hi
I used the switch node which help me understand the concept.

Thank you for you help

Andrew

Hi
I did not know the trick of the side bar it help me greatly

Thank you Andrew

Hi Marcus
Yet again you helped me so thank you
I do try and resolve issues but after a few hours of getting anywhere its time to call for help

Thanks again
Andrew

I recommend watching this playlist: Node-RED Essentials. The videos are done by the developers of node-red. They're nice & short and to the point. You may well learn more useful stuff.

Thank you


This is my attempt
Dependent off the number of presses from the Fibaro switch (2 for on - 3 for off)
The function then calls the Shelly power plug and turns on/off

Function

Thank you for your help

if (msg.payload.eventBody.value == '3') {
    msg.payload = true;
}
else if (msg.payload.eventBody.value == '4'){
    msg.payload = false;

}

var onoff = msg.payload /*trigger*/

const _nodeId = 23;             /* Target Node */
const _value = onoff;            /* Value */

const _valueId = {
    "commandClassname": "Binary Switch",
    "commandClass": 37,         /* Binary Class */
    "endpoint": 0,              /* Target End point - The device might have 2 binary switches */
    "property": "targetValue",  /* Property */
}

const Message = {
    payload: {
        cmd: {
            api: 'VALUE',
            method: 'setValue'
        },
        cmdProperties: {
            nodeId: _nodeId,
            valueId: _valueId,
            value: _value
        }
    }
}

return Message;

Sorry - ignore the above (now deleted)
Yes that will work :ok_hand:

(I’m in work - so little chaotic :grin:)

But the minimum for a Value ID only needs

  • endpoint
  • commandClass
  • property
  • propertyKey (sometimes - CC Dependant)

The other bits is just metadata

Hi Marcus
Thank you for your help, It took me a while but i got there in the end

When you get a minute could you strip out what is unnecessary in my function?

Thank Andrew

Hi @fogmajor

What you have will work, but V11 aims to adhere to the "low code" nature of Node RED, so I should be a good teacher here really :smiley:

You can achieve the above with No Function Node in site, and making use of the new features.

Just Select your Controller in the Device Nodes (might need to reselect the Fibaro Node)

[{"id":"8019ba233b043ced","type":"zwavejs-device","z":"42a07040073c9b0e","name":"Fibaro-101","runtimeId":"","nodeMode":"Multiple","filteredNodeId":"24","dataMode":"R","outputs":1,"inputs":0,"x":230,"y":330,"wires":[["f51bf59441a7d8f0"]]},{"id":"f51bf59441a7d8f0","type":"zwavejs-splitter","z":"42a07040073c9b0e","name":"Filter To Central Scene Event","splits":[{"valueId":{"commandClassName":"Central Scene","commandClass":91,"endpoint":0,"property":"scene","propertyKey":"001","propertyName":"scene","propertyKeyName":"001"},"index":0,"name":"CENTRAL_SCENE.SCENE.001"}],"outputs":1,"x":320,"y":380,"wires":[["cf3e9bf0adc814a6"]]},{"id":"575db43b94cdf478","type":"zwavejs-factory","z":"42a07040073c9b0e","valueSetOptionsType":"json","valueSetOptions":"{}","valueType":"jsonata","value":"payload.eventBody.value = 3 ? true : false","valueIdType":"json","valueId":"{\"commandClass\":37,\"endpoint\":0,\"property\":\"targetValue\"}","argsType":"json","args":"[]","endpointType":"num","endpoint":0,"nodeIdType":"num","nodeId":"23","trackingIdType":"msg","trackingId":"id","name":"Create Binary Command","api":"VALUE","method":"setValue","commandClass":"","x":420,"y":470,"wires":[["917ae72f4947e849"]]},{"id":"cf3e9bf0adc814a6","type":"switch","z":"42a07040073c9b0e","name":"Value Between Between 3-4","property":"payload.eventBody.value","propertyType":"msg","rules":[{"t":"btwn","v":"3","vt":"num","v2":"4","v2t":"num"}],"checkall":"true","repair":false,"outputs":1,"x":370,"y":430,"wires":[["575db43b94cdf478"]]},{"id":"917ae72f4947e849","type":"zwavejs-device","z":"42a07040073c9b0e","name":"Sonos-Kitchen-Power","runtimeId":"","nodeMode":"All","filteredNodeId":"","dataMode":"S","outputs":0,"inputs":1,"x":650,"y":470,"wires":[]}]

This uses the power of the Event Splitter, Switch and CMD Factory Nodes (using JSONata)