i am trying to get a rule working when a number on the FritzBox is coming in.
The item is defined as “Call fritzActiveCall” and the number incoming is " **10##**21 ".
i cant get the if clause to work with if (fritzActiveCall == **10##**21)
How do i have to use the number **10##**21 ? with hyphens, etc.
Items are complicated objects, with label, icon, type etc. properties.
When you do comparisons in a rule, you’ll generally be interested in the Item state., like fritzActiveCall.state
Call type Items are special though (special enough not to appear in openHAB docs, which is frustrating).
Call Item type state is a kind of list, so you’ll need to select the list entry before comparing to anything.
That’a about as much as I know about Call, but see examples -
thnx for the quick answer.
I tried with “fritzActiveCall.state” but there was no difference.
The item is defined like this: Call fritzActiveCall "Active Call [%s]" and shows " **10##**21 " when displayed. I will have a look at the links you posted and will try further on.
What i wanted to be sure of is if i have to put the **10##**21 into something like this ’ **10##**21’ or " **10##**21" in the rule. So that the * symbol dont confuse the rule.
Maybe the best way is to get the call item value into a string item first. And check the string item, not the call item.
Your help is much appreciated. i will post if i find a solution.
I don’t see why, nor how that would be particularly easy.
Look at the examples, see how to extract individual from Call ‘list’ within a rule.
There isn’t much guidance for this Item type.
This looks like something of interest to you, from the second example
extPartyNumber = (fboxIncomingCall.state as StringListType).getValue(1) // get caller number
Yes of course, like any collection of characters you’d want to treat as a string.