You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Preface: This issue may not be specifically related to MQTT items, but that's where I've noticed it and what's probably the easiest way to reproduce..
I have several MQTT things with channels of type "dimmer", annotated with min, max, and step values, usually ranging from 0-254. These channels are linked to OH items of type Dimmer.
Main UI shows a slider for these dimmer items, but mixes up the display of raw min/max values and calculated dimmer percentages. The following Dimmer is e.g. set to 100%:
(Channel: min=0, max=254, step=1; Item: state=100%)
The slider in the UI is set to be between min and max of the channel
The position of the slider is however the percentage value.
Setting the slider to a value outside of 0-100 will not update the item state at all
This especially gets worse when the min-value is not equal to 0, then the slider dot may even appear outside of the slider bar:
(Channel: min=137, max=370, step=1 ; Item: state=11%)
Expected behavior
The MQTT documentation states in Section “Channel Type “dimmer””, that:
Defining a channel of type dimmer with min/max/step definition leads to an automatic calculation of a percentage value, that should be linked to to an item of type Rollershutter or Dimmer.
Dimmer items are defined to be in the range of 0-100.
Therefore:
For all dimmer items, the UI should by default (=without having to change the state representation every time) display a slider ranging from 0 to 100, with the dot representing the current percentage value.
Steps to reproduce
Create a MQTT Thing with a channel of type dimmer, e.g.:
e.g. for the second example with the colortemp channel, when setting the slider to a value of 333:
Browser network traffic
e.g. for the second example with the colortemp channel, when setting the slider to a value of 333:
Additional information
If the channel and item would have been of type number, the current behavior would most likely be correct.
I know that you can currently work around this, by setting the state representation for every item manually to min=0, max=100, but this should already be the default for all items of type dimmer, as other values cannot be represented in such an item anyways.
Since I also want to use MQTT with OH3, I've had a closer look at this. As it seems to me, the fault is not within the UI, but more in the core/binding. The core (REST API) returns the stateDescription of that item with the minimum and maximum values set in the channel. Perhaps that's also what the channel reports to OH. I don't know if it's possible, but I think the channel should keep those min and max values to its own and always report 0-100 to OH, because these are the values the channel actually accepts.
So, I'd suggest to open an issue in the binding/addons repository.
The problem
Preface: This issue may not be specifically related to MQTT items, but that's where I've noticed it and what's probably the easiest way to reproduce..
I have several MQTT things with channels of type "dimmer", annotated with min, max, and step values, usually ranging from 0-254. These channels are linked to OH items of type Dimmer.
Main UI shows a slider for these dimmer items, but mixes up the display of raw min/max values and calculated dimmer percentages. The following Dimmer is e.g. set to 100%:
(Channel: min=0, max=254, step=1; Item: state=100%)
This especially gets worse when the min-value is not equal to 0, then the slider dot may even appear outside of the slider bar:
(Channel: min=137, max=370, step=1 ; Item: state=11%)
Expected behavior
The MQTT documentation states in Section “Channel Type “dimmer””, that:
Defining a channel of type dimmer with min/max/step definition leads to an automatic calculation of a percentage value, that should be linked to to an item of type Rollershutter or Dimmer.
Dimmer items are defined to be in the range of 0-100.
Therefore:
For all dimmer items, the UI should by default (=without having to change the state representation every time) display a slider ranging from 0 to 100, with the dot representing the current percentage value.
Steps to reproduce
Your environment
Browser console
e.g. for the second example with the colortemp channel, when setting the slider to a value of 333:
Browser network traffic
e.g. for the second example with the colortemp channel, when setting the slider to a value of 333:
Additional information
The text was updated successfully, but these errors were encountered: