I’ve added “Selection” elements in my sitemap for Wled playlists, presets, effects and palettes. The selection values are autmatically pulled from my wled controller.
The only annoying issue with the selections is that when I e.g select a different effect in the selection list the selected value stays on the old value. If I again select yet another effect it now displays the previously selected effect. Only if I select the same effect twice it displays the correct active effect. Also when the device is polled (e.g. every 60 seconds) the correct value is displayed.
The same thing happens when selecting presets.
When selecting playlists the value always shows -1, the selected value is never displayed.
The only selection that show’s up correctly after selecting is the palette selection.
Is there a reason for this behaviour of could this be fixed?
What browser are you using to run Basic UI?
It is certainly not a general issue but rather something specific to your item or binding channel. What is the binding channel involved?
I’m using Chrome, but it is the same in Firefox and also in the Android app. I also suspect this to be an issue related to the wled binding and not a general issue.
In this case I selected the item with the id 26. The item is updated to 26, but shorty after it is set back to the previous value. (in this case 1)
Any idea what could be the problem? I will also try to test this in a development environment, but at the moment something is broken with the eclipse development.
So this is not a problem of Basic UI.
The problem is why the wled binding is restoring the old state ?
I assume you have no rule changing the item state?
Enabling wled binding TRACE logs could maybe provide interesting information for binding maintainer.
You could then create a GitHub issue related to wled binding providing maximum of information for the binding developer.
I got my development environment working again and this is what I found out:
Preset and Playlist:
Current situation: The binding calls setPreset to send the new preset to the wled controller and requests the new values back. Sadly the wled controller here always returns the previous preset value and the playlist value is always -1.
Current situation: The binding first calls the function setGlobalOn which turns on the lights. This command also receives all the current values back from the wled controller. The values are then reflected to the item’s in openhab. After that the setEffect function is called which sends the effect to the wled controller, but here no values are received from the controller so the item is not updated to the new effect.
Suggestion: Send the ON command and the requested effect in a single json message to the wled controller and then process the new values from the controller. I’ve tested this on the latest WLED release 0.15.0 and it worked perfectly. I’ve uploaded a code example on my GitHub fork here: Fix when changing effect · TheNetStriker/openhab-addons@6885ea6 · GitHub