I happily use the fritzbox_callmonitor integration to show calls in a home feed card.
I have two ideas on how to improve the usability of this integration:
-
To show the phone calls once its finished, an automation is triggered when the state changes from “talking” to “idle”. Unfortunately the information if this call was outgoing or ingoing is missing at this point because in the state “talking” only the attributes “with”,“device”,“accepted”,“with_name” are available. Currently I solve it with a variable which is set in two automations triggered by state change from either “ringing” or “dialing” to “talking”. From my perspective an additional attribute in state “talking” called “type” (with possible values “ingoing” and “outgoing”) like in state “ringing” or “dialing” would increase usability and no further variable in HA is necessary.
-
Usually I would like to display the name of the caller if it is available and otherwise the number.
In a Jinja2 template this currently looks like the following:{% if states.sensor.fritz_box_call_monitor.attributes.from_name == 'unknown' %} {{ states.sensor.fritz_box_call_monitor.attributes.from }} {% else %} {{ states.sensor.fritz_box_call_monitor.attributes.from_name }} {% endif %}
A shorter way would be with Jinja default template like
{{ states.sensor.fritz_box_call_monitor.attributes.from |default(states.sensor.fritz_box_call_monitor.attributes.from_name)}}
But this is only possible if the attribute “from” is not contained at all or is set to an empty string which evaluates to false. Thus the proposed change is to change the value of a unknown user to the empty string instead of the string “unkown”.
What do you think about those changes?