Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[main ui] Dimmer item doesn't send value between 1-100 #3079

Open
dalgwen opened this issue Feb 27, 2025 · 0 comments
Open

[main ui] Dimmer item doesn't send value between 1-100 #3079

dalgwen opened this issue Feb 27, 2025 · 0 comments
Labels
bug Something isn't working main ui Main UI

Comments

@dalgwen
Copy link
Contributor

dalgwen commented Feb 27, 2025

The problem

A Dimmer item linked to a channel with unusual min and max value will send a wrong value to the openHAB API.

When linking and item to a channel with unusual low or high values (here, a number channel from a mqtt.homeassistant thing, with a script profile to transform between), the min and max will be shown like this :
Image
The issue is that the main UI will send this value between 200 and 254.
But the value accepted by the openHAB API for a dimmer item is between 0 and 100.

Expected behavior

The UI should send a value between 0 and 100, calculated from the gui_dimmer_value and the min max boundaries.
percent_value_sent_to_api = 100 * (gui_dimmer_value - min) / (max - min)

Steps to reproduce

  1. A thing with a number channel with boundaries other than 0 and 100.
  2. Linking the number channel to a dimmer item (with the help of a transform script, because the default profile not available for this kind of configuration)
  3. Trying to set the dimmer value from the GUI
  4. error message and browser dev console show http bad request.

Tried in firefox and chrome

Browser console

Image

Browser network traffic

Image

Additional information

  1. retrying to send the same message, with a POST value between 0 and 100 is OK.
@dalgwen dalgwen added bug Something isn't working main ui Main UI labels Feb 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working main ui Main UI
Projects
None yet
Development

No branches or pull requests

1 participant