MQTT dimmer values with using zingbee2MQTT

Hello,
I using the stable release OH 2.4.0-1 together with the zingbee2MQTT from Koenkk (https://www.zigbee2mqtt.io/). I followed the instruction on the web page, it is running succecfully.
I have three Zigbee devices, 2 Lamps (IKEA Trådfri LED transformators) and 1 Xiaomi Smart Door Windows Sensor.
All Devices are running well. So for mee is the communication way from zigbee and MQTT to OH running.
Here my example for items:

Dimmer KuecheInsel                "Insel" (gLicht)          {channel="mqtt:topic:mosquitto:kuechelichtinsel:KuecheInsel"}
Number KuecheInselRSSI            "Rssi"                    {channel="mqtt:topic:mosquitto:kuechelichtinsel:KuecheInselRSSI"}
String KuecheInselSate            "Status"                  {channel="mqtt:topic:mosquitto:kuechelichtinsel:KuecheInselSate"}
Number KuecheArbeitsplatteRSSI    "Rssi"                    {channel="mqtt:topic:mosquitto:kuechelichtarbeitsplatte:KuecheArbeitsplatteRSSI"}
String KuecheArbeitsplatteSate    "Status"                  {channel="mqtt:topic:mosquitto:kuechelichtarbeitsplatte:KuecheArbeitsplatteSate"}
Dimmer KuecheArbeitsplatte        "Arbeitsplatte" (gLicht)  {channel="mqtt:topic:mosquitto:kuechelichtarbeitsplatte:KuecheArbeitsplatte"}

Here the a part of my MQTT.things:

    Thing topic kuechelichtinsel "Küche Licht Insel"  {
        Channels:
            Type number : KuecheInselRSSI   "RSSI"      [stateTopic="zigbee2mqtt/0x90fd9ffffe75105c", transformationPattern="JSONPATH:$.linkquality"]
            Type string : KuecheInselSate   "Status"    [stateTopic="zigbee2mqtt/0x90fd9ffffe75105c", transformationPattern="JSONPATH:$.state"]
            Type dimmer : KuecheInsel       "Insel"     [stateTopic="zigbee2mqtt/0x90fd9ffffe75105c", commandTopic="zigbee2mqtt/0x90fd9ffffe75105c/set", formatBeforePublish="{   \"brightness\": %s }" ]
/*
    OK        Type dimmer : KuecheInsel3      "Test Lamp"     [stateTopic="zigbee2mqtt/0x90fd9ffffe75105c", commandTopic="zigbee2mqtt/0x90fd9ffffe75105c/set", min=1, max=254, step=1, transformationPattern="JSONPATH:$.brightness", formatBeforePublish="{   \"brightness\": %s }" ]    
    NG        Type dimmer : KuecheInsel3      "Insel"         [stateTopic="zigbee2mqtt/0x90fd9ffffe75105c", commandTopic="zigbee2mqtt/0x90fd9ffffe75105c/set", min=1, max=254, step=1, transformationPattern="JSONPATH:$.brightness", formatBeforePublish="{ \"brightness\": %s }" ]
    NG      Type dimmer : KuecheInsel3 "Led strip dimmer"   [stateTopic="zigbee2mqtt/0x90fd9ffffe75105c", commandTopic="zigbee2mqtt/0x90fd9ffffe75105c", min=0, max=100, step=1]
  */
    }

    Thing topic kuechelichtarbeitsplatte "Küche Licht Arbeitsplatte"  {
        Channels:
            Type number : KuecheArbeitsplatteRSSI   "RSSI"          [stateTopic="zigbee2mqtt/0x000b57fffea3c341", transformationPattern="JSONPATH:$.linkquality"]
            Type string : KuecheArbeitsplatteSate   "Status"        [stateTopic="zigbee2mqtt/0x000b57fffea3c341", transformationPattern="JSONPATH:$.state"]
            Type dimmer : KuecheArbeitsplatte       "Arbeitsplatte" [stateTopic="zigbee2mqtt/0x000b57fffea3c341", commandTopic="zigbee2mqtt/0x000b57fffea3c341/set", formatBeforePublish="{   \"brightness\": %s }" ]
    }

My Problem is, that I get the following warning on every change of light brightness:
2019-10-20 01:43:05.966 [WARN ] [eneric.internal.generic.ChannelState] - Incoming payload ‘{“state”:“ON”,“linkquality”:0,“brightness”:72}’ not supported by type ‘PercentageValue’

and sometimes the following Error message:
2019-10-20 01:42:30.993 [ERROR] [nal.common.AbstractInvocationHandler] - An error occurred while calling method ‘ThingHandler.handleCommand()’ on ‘org.eclipse.smarthome.binding.mqtt.generic.internal.handler.GenericThingHandler@f0c2b3’: null

java.lang.NumberFormatException: null

at java.math.BigDecimal.<init>(BigDecimal.java:494) ~[?:?]

at java.math.BigDecimal.<init>(BigDecimal.java:383) ~[?:?]

at java.math.BigDecimal.<init>(BigDecimal.java:806) ~[?:?]

at org.eclipse.smarthome.core.library.types.DecimalType.<init>(DecimalType.java:57) ~[102:org.eclipse.smarthome.core:0.10.0.oh240]

at org.eclipse.smarthome.core.library.types.PercentType.<init>(PercentType.java:47) ~[102:org.eclipse.smarthome.core:0.10.0.oh240]

at org.eclipse.smarthome.core.library.types.PercentType.valueOf(PercentType.java:63) ~[102:org.eclipse.smarthome.core:0.10.0.oh240]

at org.eclipse.smarthome.binding.mqtt.generic.internal.values.PercentageValue.update(PercentageValue.java:87) ~[?:?]

at org.eclipse.smarthome.binding.mqtt.generic.internal.generic.ChannelState.publishValue(ChannelState.java:302) ~[?:?]

at org.eclipse.smarthome.binding.mqtt.generic.internal.handler.AbstractMQTTThingHandler.handleCommand(AbstractMQTTThingHandler.java:119) ~[?:?]

at sun.reflect.GeneratedMethodAccessor82.invoke(Unknown Source) ~[?:?]

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]

at java.lang.reflect.Method.invoke(Method.java:498) ~[?:?]

at org.eclipse.smarthome.core.internal.common.AbstractInvocationHandler.invokeDirect(AbstractInvocationHandler.java:153) [102:org.eclipse.smarthome.core:0.10.0.oh240]

at org.eclipse.smarthome.core.internal.common.InvocationHandlerSync.invoke(InvocationHandlerSync.java:59) [102:org.eclipse.smarthome.core:0.10.0.oh240]

at com.sun.proxy.$Proxy158.handleCommand(Unknown Source) [232:org.eclipse.smarthome.binding.mqtt.generic:0.10.0.oh240]

at org.eclipse.smarthome.core.thing.internal.profiles.ProfileCallbackImpl.handleCommand(ProfileCallbackImpl.java:75) [109:org.eclipse.smarthome.core.thing:0.10.0.oh240]

at org.eclipse.smarthome.core.thing.internal.profiles.SystemDefaultProfile.onCommandFromItem(SystemDefaultProfile.java:49) [109:org.eclipse.smarthome.core.thing:0.10.0.oh240]

at sun.reflect.GeneratedMethodAccessor81.invoke(Unknown Source) ~[?:?]

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]

at java.lang.reflect.Method.invoke(Method.java:498) ~[?:?]

at org.eclipse.smarthome.core.internal.common.AbstractInvocationHandler.invokeDirect(AbstractInvocationHandler.java:153) [102:org.eclipse.smarthome.core:0.10.0.oh240]

at org.eclipse.smarthome.core.internal.common.Invocation.call(Invocation.java:53) [102:org.eclipse.smarthome.core:0.10.0.oh240]

at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:?]

at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:?]

at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:?]

at java.lang.Thread.run(Thread.java:748) [?:?]

The next thing is, that the lamps goes not to brightness level of 254 only 100.

I read several topics here but I did not understand the releation between the several MQTT version etc.
I found no topic which can solve my problem.
It this currently a bug in the MQTT part or not? And if not how can I solve this.

Thank you very much
Holgus

You have a Dimmer Item. A Dimmer Item can only accept numbers between 0 and 100. They sender is publishing a full JSON string to the topic. A JSON Stein is not a number between 0 and 100.

It looks like you need to extract the brightness element from the JSON, which you can do using the JSONPATH transform.

Again, a JSON String is not a number. You need to extract the number from the message.

Dimmers only support values from 0 to 100 so you are fine. You would need a JS transform it a rule if it did report numbers from 0 to 255.