Control of led and switch at the same time

Dear All
I have a led strips which are controled by Number - from 0 to 255 by setpoint.
Now I want to add a switch item to control this (same) light only On or Off (as other lights).
I have no problem when i do a rule to set Number to 255 if on or 0 if off. But I also want to have a back compability - if I change a setpoint from 0 to any value - I want switch to be on and off if from any value to 0. But if I do it light begin to flash constantly. How I can change a state of Switch without fireing its item change rules? Or it is another solution?
I try to use sendCommand and postUpdate - no difference.

How about a proxy item?

The best approach is the proxy item as Markus points out. However, to answer your specific question:

  • sendCommand will cause the bindings/channels linked to an Item to receive a command to do something.
  • postUpdate only causes the Item to change its state without forwarding that on to the linked bindings/channels

With that explanation there are a number of ways to trigger a rule: I wish I had a way to make a good table:

Trigger            postUpdate        sendCommand  Note
received update        X                  X
received command                          X
changed                X                  X       Only if the new state is different

If there is an X in the column that means that the rule will trigger when the Item’s state is changed or updated using the indicated action. So, as you can see, if you do not want your rules to trigger you need to use postUpdate for making the state change and received command for the rule trigger.

1 Like

Perfect! Now it is working!
Thank you!!!