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

[http] autorefesh after sending command to update… #17271

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

constambeys
Copy link
Contributor

Hello,

In my openhab configuration I have multiple items bound to the same channel and when sending command only one item gets updated and the rest are updated after the refresh timeout passes.

I have modified the code to force update after sending command

Thanks
Timotheos Constambeys

@constambeys constambeys requested a review from a team as a code owner August 17, 2024 10:08
Signed-off-by: Timotheos Constambeys <[email protected]>
@lolodomo lolodomo added the enhancement An enhancement or new feature for an existing add-on label Aug 18, 2024
@J-N-K
Copy link
Member

J-N-K commented Aug 18, 2024

I don't think a general "refresh after command" is a desired function. Depending on the attached device it may also fail (e.g. when updating the internal state in the device takes longer than it takes the binding to issue the state request).

Can you show describe what exactly you are doing? What items are connected to the channel, why are there several items, do you send commands to all items (or only one) and what exactly do you expect to happen? At best, show the thing or at least the channel configuration.

@J-N-K J-N-K self-assigned this Aug 18, 2024
@constambeys
Copy link
Contributor Author

Yes,

I have the following configuration for an LED strip:

Thing UID: http:url:2bcdb351df
Base URL: http://192.168.10.11/
....
Channel UID: http:url:2bcdb351df:led0
State URL Extension: state
Command URL Extension: set?status=%2$s
On Value: 1
Off Value: 0
Increase/Decrease Step 1
Color Mode RGB

And 3 items bound to the channel

  • Switch
  • Dimmer
  • Color

@J-N-K
Copy link
Member

J-N-K commented Aug 19, 2024

Why do you need three items for that? The Color item accepts all commands that Switch or Dimmer accept.

@constambeys
Copy link
Contributor Author

In the color item I see only three bars for Hue, Saturation, Brightness how can I do the rest?

@constambeys constambeys changed the title [org.openhab.binding.http] autorefesh after sending command to update… [http] autorefesh after sending command to update… Aug 22, 2024
@J-N-K
Copy link
Member

J-N-K commented Aug 28, 2024

Which UI?

@constambeys
Copy link
Contributor Author

Am not sure is the default UI !

  - component: oh-toggle-card
    config:
      item: Backlight_LED

 - component: oh-slider-card
    config:
      item: Backlight_LED_Dimmer
      label: true
      scale: true
      scaleSubSteps: 5

  - component: oh-colorpicker-card
    config:
      item: Backlight_LED_Color
      sliderLabel: true

@J-N-K
Copy link
Member

J-N-K commented Aug 30, 2024

I didn't check, but can't you link Backlight_LED_Color in the oh-toggle-card? That should work. If it is not possible, that's an UI bug.

@constambeys
Copy link
Contributor Author

My friend, I have checked what you have suggested and it works the same.

However when triggering a command the state of the channel is not updated (a refresh command has to be fired)
e.g. from off to on the color and brightness items do not know the exact value since the command triggered is only "turn on" !

Anyway the refresh ability is already implemented what I have suggested is to trigger it quicker than waiting the timeout timer to be passed ! Other protocols like Tuya do the same thing, a feedback from the device is updating the state after a command is fired check my repo: https://github.com/constambeys/openhab-addons-tuya

@J-N-K
Copy link
Member

J-N-K commented Aug 31, 2024

I still don't understand why this is necessary, but we can add it. However, it should be configurable with a default behavior that is the same as the current one.

@constambeys constambeys requested a review from J-N-K as a code owner December 31, 2024 11:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement An enhancement or new feature for an existing add-on
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants