Hello, I got a few problems with the autoupdate=“false” function. The scripts are just for testing, exec-binding works great. The problem is, the switch that I want to be a button doesnt work. When its pressed, it changes his state to ON, wich the autoupdate function should prevent. What causes this? Any help is appreciated!
Sitemap:
I cleared the events.log and restartet the service. I pressed the switch once, it stays ON
2019-09-04 13:36:31.629 [ItemChannelLinkAddedEvent ] - Link 'exec_command_ledon_input_run-exec:command:ledon:input:run' has been added.
2019-09-04 13:36:31.634 [ItemChannelLinkAddedEvent ] - Link 'exec_command_ledon_input-exec:command:ledon:input' has been added.
2019-09-04 13:37:03.473 [ItemCommandEvent ] - Item 'led1' received command ON
When clicking again, its state changes to OFF
2019-09-04 13:36:31.629 [ItemChannelLinkAddedEvent ] - Link 'exec_command_ledon_input_run-exec:command:ledon:input:run' has been added.
2019-09-04 13:36:31.634 [ItemChannelLinkAddedEvent ] - Link 'exec_command_ledon_input-exec:command:ledon:input' has been added.
2019-09-04 13:37:03.473 [ItemCommandEvent ] - Item 'led1' received command ON
2019-09-04 13:37:39.733 [ItemCommandEvent ] - Item 'led1' received command OFF
Your log doesn’t show that your item state has been changed, but just that item have received the command. Which client you are using for sitemap? Autoupdate binding will auto update item state to match the command, so when autoupdate is disabled, command doesn’t change the state. And this what also can be seen from your log.
Switch in basicui doesn’t know anything about the autoupdate, so switch state will change the state in the ui when you click it. You can query your item state from karaf console after command sending to see the real state?
Sitemaps have also mappings functionality, where switch is button rather than on/off slider.
Please be aware that you may have to restart openHAB before UI is properly updated after you pressed the button. Please also be aware that it might take some seconds for the button to reset.