MQTT dimmer configuration

Hello together,
I’ve been dealing with 2 problems for a while now which are the most important main functions for me. I really need to get that to work now,to turn off my old SmartHome System.
I can produce from my Wago Industrial PLC MQTT Topics.
For example when the brightness value of the Kitchen changes, i send the value per Topic “modbus/LightActualLevel/state/Kueche” to HA. It works, i can see it in HA.
When i send per HA (the MQTT config page, listen/send package) i can see it in Wago too.
I tried it for example with this value template:

- light:
      name: "Kueche"
      unique_id: "Kueche"
      state_topic: "modbus/LightActualLevel/state/Kueche"
      command_topic: "modbus/dimmValue/set/Kueche"
      payload_off: "0"
      payload_on: "100"
      brightness_state_topic: "modbus/LightActualLevel/state/Kueche"
      brightness_command_topic: "modbus/dimmValue/set/Kueche"
      brightness_scale: 100
      on_command_type: "brightness"
      optimistic: false
      state_value_template: "{{ '100' if value == 100.0 else '0' }}"

and others like

"{{ 'True' if value == '100.0' else 'False' }}"
"{{ 'On' if value == '100.0' else 'Off' }}"

And i dont get it… I don’t even can explain all the weird stuff that happens when i try it like this.
Sure i get a entity like:

supported_color_modes:
  - brightness
color_mode: null
brightness: null
friendly_name: Kueche
supported_features: 0

But when i move the brightness slider to zero, nothing happens. when i move the slider to 50, he set the value to 50. when i hit the button of the light card, nothing happens, and so on.

When it is neccesary to customize something in my WagoPLC with the Topics, Please tell me! Maybe i need a stop, up, down topic or whatever, i can do!

Please maybe can help me with this. It looks like my knowledge about templates and jinja2 is absolutely useless.
Greetings Patrick.

i got stuck with a problem similar to:Mqtt Light, how to change icon or background?

Please forgive me for being so rude and ignoring the forum rules. But maybe @LiQuid_cOOled or @tom_l can help me out again with this problem.

Because once I have solved the problem with shutter and light (my “core” functions) communication via MQTT, I can finally switch completely to Home Assistant, and I have enough time and patience for the rest of the “luxuries”.

Greetings Patrick

Biggest fault was the dot notation in my topic. Values from brightness where: “100.0” or “55.3”
With stuff like this: state_value_template: "{{ value | float | int }}" brightness_value_template: "{{ value | float | int }}"
it works.


- light:
      name: "Kueche"
      state_topic: "modbus/LightActualLevel/state/Kueche" 
      command_topic: "modbus/dimmValue/set/Kueche"
      payload_off: "0"
      payload_on: "100"
      brightness_state_topic: "modbus/LightActualLevel/state/Kueche" 
      brightness_command_topic: "modbus/dimmValue/set/Kueche"
      brightness_scale: 100
      on_command_type: 'first' 
      optimistic: false
      state_value_template: "{{ value | float | int }}"
      brightness_value_template: "{{ value | float | int }}"

Lights,check…dimmable light, check. next stop cover`s