Some zwave_js parameters are partial parameters that require a bitmask, some arent. But for the ones that arent, I dont want to have to make a completely separate call service node. Is there anyway I can use the same call service node and have it ignore the bitmask argument if its not present in the preceding change node.
To explain better…
here is the complete flow…
[{"id":"f1ca98b1.b2e218","type":"tab","label":"Flow 1","disabled":false,"info":""},{"id":"c680b90b.8415c8","type":"inject","z":"f1ca98b1.b2e218","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":862,"y":90,"wires":[["231cca39.5a2706"]]},{"id":"f76c7b80.5516d8","type":"change","z":"f1ca98b1.b2e218","name":"Without bitmask","rules":[{"t":"set","p":"parameter","pt":"msg","to":"17","tot":"str"},{"t":"set","p":"value","pt":"msg","to":"0","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1061,"y":152,"wires":[["4a887e0.efc6d84"]]},{"id":"231cca39.5a2706","type":"change","z":"f1ca98b1.b2e218","name":"With bitmask","rules":[{"t":"set","p":"parameter","pt":"msg","to":"16","tot":"num"},{"t":"set","p":"bitmask","pt":"msg","to":"255","tot":"str"},{"t":"set","p":"value","pt":"msg","to":"0","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1051,"y":89,"wires":[["4a887e0.efc6d84"]]},{"id":"4a887e0.efc6d84","type":"api-call-service","z":"f1ca98b1.b2e218","name":"Office","server":"456659de.370498","version":1,"debugenabled":false,"service_domain":"zwave_js","service":"set_config_parameter","entityId":"light.office","data":"{\"bitmask\":\"{{bitmask}}\",\"parameter\":\"{{parameter}}\",\"value\":\"{{value}}\"}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":1283,"y":117,"wires":[[]]},{"id":"466ae424.089fdc","type":"inject","z":"f1ca98b1.b2e218","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":862,"y":153,"wires":[["f76c7b80.5516d8"]]},{"id":"456659de.370498","type":"server","name":"AvilaSmartHome","legacy":false,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true}]
With bitmask looks like this…
Without bitmask looks like this…
Change node looks like this…
The current flow will only work when triggering ‘With bitmask’. If I try ‘Without bitmask’, I get the following error…
Is there anything I can add into the change node json to have it ignore bitmask if there isnt a bitmask payload?