OH3 MQTT Dimmer Channel


I am trying to setup a dimmer using a mqtt generic thing. Basicly it works, changing the duty cycle (values between 0…100) are logged in the log files. When inspecting the mqtt traffic the value is divided by 100, so 50% results in a mqtt command to 0.5.
My thing code looks like:

UID: mqtt:topic:abcd
label: MQTT Bench
thingTypeUID: mqtt:topic
  payloadNotAvailable: Offline
  availabilityTopic: tele/bench/LWT
  payloadAvailable: Online
bridgeUID: mqtt:broker:ad84a2b039
  - id: Switch
    channelTypeUID: mqtt:switch
    label: Bechn Switch
    description: ""
      commandTopic: cmnd/bench/POWER
      stateTopic: stat/bench/POWER
      off: OFF
      on: ON
  - id: Dimmer
    channelTypeUID: mqtt:dimmer
    label: BenchDimmer
    description: ""
      commandTopic: cmnd/bench/Dimmer
      min: 0
      stateTopic: stat/bench/RESULT
      transformationPattern: JSONPATH:$.Dimmer
      max: 100
      on: "100"


cmnd/bench/Dimmer 0.55


2021-09-29 20:55:27.364 [INFO ] [openhab.event.ItemCommandEvent      ] - Item 'MQTTBechn_BenchDimmer' received command 55
2021-09-29 20:55:27.376 [INFO ] [penhab.event.ItemStatePredictedEvent] - Item 'MQTTBechn_BenchDimmer' predicted to become 55
2021-09-29 20:55:27.389 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'MQTTBechn_BenchDimmer' changed from 0 to 55
2021-09-29 20:55:27.522 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'MQTTBechn_BenchDimmer' changed from 55 to 0

So min and max in the yaml code should be used to scale the input(?!) but it doesn’t.

What type of Item have you linked your dimmer channel to?

The item is also dimmer…

For some reason you need to do this same thing for your Item too. Skip to the section which starts

We have to make one small adjustment to the Item created for the Dimmer Channel:

in this tutorial:

great with this hint it works.

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.