Hi there! I’m on openHAB 2.5.1. There’s something i need to understand and I wonder if someone is willing to explain what I’m doing wrong.
On my MQTT bridge thing, I’m defining an OH Item with the channel type dimmer
/////////////////////////////////////////
// ZMNHDA2 Flush Dimmer (Qubino (Goap) //
/////////////////////////////////////////
Thing topic Rum3_Takbelysning "Z-Wave Node 005: ZMNHDA2 Flush Dimmer (Qubino (Goap)" @ "Rum 3" {
Channels:
Type dimmer : Dimlevel "Level (38-1-0)" [ stateTopic="zwave/rum-3/takbelysning/level", transformationPattern="JSONPATH:$.value", commandTopic="zwave/rum-3/takbelysning/level/set", min=3, max=100, step=1 ]
Type switch : SensorBinary1 "Instance 1: Sensor (48-1-0)" [ stateTopic="zwave/rum-3/takbelysning/sensor_binary1", transformationPattern="JSONPATH:$.value∩MAP:bool2onoff.map"]
Type switch : SensorBinary2 "Instance 2: Sensor (48-1-0)" [ stateTopic="zwave/rum-3/takbelysning/sensor_binary2", transformationPattern="JSONPATH:$.value∩MAP:bool2onoff.map"]
}
When I save the things file I get the error message:
Command '0' not supported by type 'PercentageValue': Value must be between 0 and 100
If I change the channel type to number, the error won’t show.
It feels that JSONPATH is returning a string value for a dimmer type channel.
My Json data looks like this:
zwave/rum-3/takbelysning/level {"time":1583054505111,"value":0}
I have tried to chain the transformation like:
Type dimmer : Dimlevel "Level (38-1-0)" [ stateTopic="zwave/rum-3/takbelysning/level", transformationPattern="JSONPATH:$.value∩JS:parseInt.js", commandTopic="zwave/rum-3/takbelysning/level/set", min=3, max=100, step=1 ]
That doesn’t help though … same error message.
parseInt.js:
(function(b) {
return parseInt(b);
})(input)
Any ideas?