[ CODE ] Fritz!Box call log plugin v0.3

The first example is most correct. Change the quotes to straight quotes (ASCII 34)–wherever you copied that code from/through has bitten you with a typographical change. Make sure the single quotes are just the keyboard single quotes as well (you can change them all to either keyboarded single quotes or keyboarded double quotes; either will work, but be consistent throughout).

local action = luup.variable_get( "urn:hek:serviceId:FritzBox1", "Action", 9)
1 Like

That was the error! Now it works as expected.

The next step I’m trying to realize is to turn on a LED while the phone is ringing and to turn off the LED if the call is either accepted or the ringing stops.

I’ve created a scene which starts whenever a call is recognized (“Incoming call”). This scene starts the following code:

R_LED_Value(3) -- set LED level to 3
while (FritzboxAction == "RING") do
  FritzboxAction = luup.variable_get( "urn:hek:serviceId:FritzBox1", "Action", Fritzbox)
end
R_LED_Value(0) -- set LED level to 0

The LED is turned on correctly if a call is recognized, but the problem seems to be that if the ringing is cancelled or accepted the action stays still at “RING” so the loop never stops and the LED stays on.

How can i realize that the LED ist turned off when the the ringing stops? Another two scenes which are triggered by “Connect” or “Call ended” could work but maybe there is a more elegant way.