- Platform information:
- Hardware: Raspberry Pi 2
- OS: Openhabian
- Java Runtime Environment: which java platform is used and what version
- openHAB 2.1:
- Issue of the topic: isolate events from UI versus from hardware
I have a question regarding the running of a rule only when changes to the item via the UI as opposed to changes to the item from the hardware.
Let’s say I have the following situation:
Dimmer mydimmer “My Dimmer”
Slider item=mydimmer “My Dimmer Slider”
rule "mydimmer Changed Rule only when mydimmer item is changed on the UI and no other way"
when “Item mydimmer is changed on UI only” //plain English of what I want to accomplish
then LightingProcessorSend.sendCommand( “DIMMERVALUE:” + String.valueOf(mydimmer.state))
Is there an easy way of doing this?
My problem is that I am executing the “sendCommand” function when either the lighting processor updates the item, or the UI updates the item, this is causing problems. If the lighting processor updates the dimmer value, there is no need to send the updated information back to the lighting processor. However, if the user updates the dimmer value via the UI, then it should send the updated value to the lighting processor.
Asked another way, is this the difference between?:
“when item mydimmer received update” - ???Is this only via the binding???
“when item mydimmer received command” - ???Is this only via the UI???
“when item mydimmer changed” - ???Is this via both depending on if the value of mydimmer changes???