Hello,
I’m trying to find a solution, to make switch item that sends a pulse of 1 then 0, which is used to turn on/off lights. I’ve had solutions to it, but it leads to the issue of icon not showing the state of the lights. Is it possible to write a rule for icon, or is there a workaround?
Thanks in advance.
1 Like
Where have you searched? (Hint: try the official documentation.)
rlkoshak
(Rich Koshak)
February 13, 2020, 4:44pm
3
You need to post your Items and Rules that didn’t work. You can’t control the icon from a Rule but you can control the Item based on the Item’s state. See https://www.openhab.org/docs/configuration/items.html#dynamic-icons . For something like a momentary button, mappings is also useful. See https://www.openhab.org/docs/configuration/sitemaps.html#mappings . You can command the Item to 1 when the button is pressed and use a Rule to toggle it back to 0 after the desired amount of time.
I think Concepts could be useful too.
rossko57
(Rossko57)
February 13, 2020, 10:41pm
5
Pulse relay control thread (use two Items)
Hello, everyone.
I try to make a push button whose state changes when pressed.
The problem is that I press the push button for only 200 milseconds and then go back to the off state.
This to do a real push button.
So my push button is always off. I want him to change status every time it’s pushd
Here are my config files
Items
Group Verlichting
Switch keuken1 “keuken1” { gpio=“pin:17 debounce:10 activelow:no” }
Rule
rule "keuken1 is a switch"
when
Item keuken1 received command
then
…
So, the final answer was for the OP to search first.