So each ButtonPress belongs to a Switch, so i have 8 switches…with Fibaro’s Keyfob it will be even more. Is this the smartest way to do so. I have my doubts. I hope there is a way to simply have one item that is handled via rules…so if swithc is pressed and scene is 1…and so on.
If not, no problem, only wanted to know if really the way i do it is the correct one.
related to your “…the only optin available in OH1”…how can this be better integrated in OH2.
I’ve already a “thing” for my KeyFOBs and already an item that posts the correct scene number depending what button you press.
So is here again a rule required that “checks for an update of scene umber” + does an if-else depending on the value…?
is there any switch/case kind of way to program this, to not requre if-else’s…
Yes - you need a rule to process a scene. I guess the rule itself will differ depending on what rule processor you’re using. IF you’re using the XText rules (ie the ‘old’ format) then there’s a switch statement -:
when
Item KeyFOB_SceneNumber received an update
then
switch KeyFOB_SceneNumber {
case 1: Switch1.sendcommand(ON);
case 2: Switch2.sendcommand(OFF);
case 3: Switch3.sendcommand(ON);
end
}
what would be a different way, is there a 2.0 way to write rules? interoperable?