After I found the solution to filter implausible sensor values for my MQTT devices by using a JS transformation in a transformation pattern on the channel in my .things file (see https://community.openhab.org/t/mqtt-how-to-filter-implausible-values-on-channel/82833/3?u=vossivossi ) I wonder if I could also implement an equivalent solution for my Z-Wave sensors.
However my Z-Wave things are not managed via a .things file and I am not sure if the binding supports a transformation pattern on the channel (I could not find any reference to this in the docs). So my next idea was to try a JS transformation with a profile on an ItemChannelLink in my Z-Wave .items file. I was using the same JS coding as with MQTT but after I edited my .items file accordingly the values of the items were not updated anymore at all. I read in other posts here that there is a possible restriction with JS transformations for numeric items as they apparently always return a String type. But for the numeric MQTT thing channel the JS tranformation worked fine.
What I did is to append my item with the transformation profile:
Number PO_SPEI_SN "PO_SPEI_SN" <energy> (sumwatt_light_og, gshelly) {channel="zwave:device:ZWOG:node93:meter_watts"[profile="transform:JS", function="filter_ltminus100_gt100.js"]}
The JS function looks like this:
(function(i) {
var val = parseFloat(i);
if (val >= 100 || val <= -100 )
{ return 'UNDEF'; }
else
{ return val; }
})(input)
Any help or hints are highly appreciated!