How to create a history of missed calls via e.g. the caller monitor integration

Hi everyone,

I already installed the fritzbox call monitor in my home assitant instance and it works fine :+1: .
I can also create a sensor (template) to show the current state and who actually calls.

Now, I want a history of ingoing, outgoing, and missed calls in my dashboard.

For displaying the history I use the lovelace home feed card.
What I’m currently missing is the possibility to decide when a call is not answered (missed) which is actually a transition from
the state idle to ringing and back to idle. When the call is accepted, then it will show the states ringing → talking → idle.

Actually, I wanted to create a template sensor as shown in a topic about the caller monitor extension
but this is not possible because I would also need the previous state within the value_template to determine if it is a missed call (e.g. state ringing before idle).
And as shown in another topic about sensor templates
this is not possible out of the box.

What approach should I take to create a sensor which has the information about missed calls that can be shown in the home feed card?
I do not need code but just an idea on how I should proceed. Maybe some of you have already a working solution.

Best regards
Sven

Hi,

I solved something similar (missed call notifications) with two seperate automations:

The first one sets a helper element to the current caller whenever the phone starts ringing.

alias: callMon_setLastCaller
description: ''
trigger:
  - platform: state
    entity_id: sensor.fritz_box_7520_ui_call_monitor_google
    to: ringing
condition: []
action:
  - service: input_text.set_value
    target:
      entity_id: input_text.callmon_lastcaller
    data:
      value: >-
        {{ state_attr("sensor.fritz_box_7520_ui_call_monitor_google", "from")}} 
        ({{ state_attr("sensor.fritz_box_7520_ui_call_monitor_google", "from_name") }})
mode: single

The second one sends a notification containing these information whenever the status transitions from ringing directly to idle.

alias: callmon_notify
description: ''
trigger:
  - platform: state
    entity_id: sensor.fritz_box_7520_ui_call_monitor_google
    from: ringing
    to: idle
condition: []
action:
  - service: notify.notify_all
    data:
      message: 'Missed Call: {{ states.input_text.callmon_lastcaller.state }}'
mode: single

However, this feels a bit clunky and maybe someone has a better idea how to access the old state.

Cheers, Jörg

1 Like

Anybody else get a Fritz Call history to a card, maybe calls of the day as a list?

I try something with var custom intergration, but this did not work …

Yepp, some kind of list helper with add/remove/purge service would be really neat for that.

1 Like

Hi I found a solution with custom Logbook card. Is working out of the box like a charm if I creat a Input_text with all caller data and show this with the custom card:

https://github.com/royto/logbook-card

1 Like

Hi SteffenDE,

can you tell me how you get it to work?
I see calls but i never see it is missed or talking etc.
Iam very new at HA the codes are mostly copy & paste.
Have you a tutorial for a noob ?

Configuration

#Fritzbox Callmonitor sensor.callmon
var:
  callmon_name:
    restore: true
    icon: mdi:phone-classic
    friendly_name: 'Anrufername'
    value_template: '{{ states.sensor.callmon.attributes.from_name }}'
  callmon_number:
    restore: true
    icon: mdi:call-missed
    friendly_name: 'Anrufernummer'
    value_template: '{{ states.sensor.callmon.attributes.from }}'
  callmon_time:
    restore: true
    icon: mdi:clock-time-three-outline
    friendly_name: 'Anrufzeit'
    value_template: '{{ now().strftime("%H:%M") }}'
  callmon_date:
    restore: true
    icon: mdi:calendar-today
    friendly_name: 'Anrufdatum'
    value_template: '{{ now().strftime("%d.%m.%Y") }}'
    

automation

alias: Callomon
description: ""
trigger:
  - platform: state
    entity_id:
      - sensor.callmon
    from: idle
    to: ringing
condition: []
action:
  - service: var.update
    data:
      entity_id: var.callmon_number
  - service: var.update
    data:
      entity_id: var.callmon_time
  - service: var.update
    data:
      entity_id: var.callmon_date
mode: single

card

type: custom:logbook-card
entity: var.callmon_number
icon: mdi:call-missed
hidden_state:
  - ''
show:
  state: true
  duration: false
  start_date: true
  end_date: false
  separator: false
title: Anrufe in Abwesenheit
max_items: 3
desc: true
date_format: DD.MM.YYYY HH:MM
history: 5
card_mod:
  style: |
    ha-icon { color: red !important}

best
badrandolph

Hi,
I do only show missed calls and I use a automation to fill a input_text with the nedded data:

  trigger:
    - platform: state
      entity_id:
        - sensor.fritz_box_7590_call_monitor_privat
  condition:
    condition: template
    value_template: >-
      {{ state_attr('sensor.fritz_box_7590_call_monitor_privat','type') == 'incoming'}}
  action:
    - service: input_text.set_value
      target:
        entity_id:
          - input_text.it_fritz_lastcaller
      data_template:
        value: >-
{{- state_attr('sensor.fritz_box_7590_call_monitor_privat','from_name') + " (" + state_attr('sensor.fritz_box_7590_call_monitor_privat','from') + ")\nâ–ş " + state_attr('sensor.fritz_box_7590_call_monitor_privat','to') -}}

So I have a input_text getting always the last missed caller data and using the custom lookbook I can show the missed calls of the last 3 days.

Steffen

Hello,

Did anybody succeed to show the number of missed calls on a card ?
I also have a fritzbox … I would like to diaplsy if there are lissed calls and eventually be able to acknowledge them …

Something like this :

Many Thanks !

Hi,
everything is explained in the post.

You need the Call Monitor integration and a automation to set a numeric input.

What exactly is unclear to you?

Steffen

Well, what is not clear is HOW I save the list of phone numbers and WHERE, then how to display the list.
Some people suggest to use a template sensor, all I am able to do for the moment is catch the calling phone number and put it in a text helper, then I can use it in a notification or whatever. I can also “count” the number of phone calls.

But what I am missing is where to store the LIST of for example the last 3 numbers who called - then display them.

I share my actual automation in here :

alias: Nouvelle automatisation
description: ""
trigger:
  - platform: state
    entity_id: sensor.fritz_box_7530_ax_call_monitor_repertoire_telephonique
    to: ringing
condition: []
action:
  - service: persistent_notification.create
    data:
      message: >-
        Un appel est Ă©mis de        
        {{state_attr("sensor.fritz_box_7530_ax_call_monitor_repertoire_telephonique",
        "from")}}      
  - service: input_text.set_value
    target:
      entity_id: input_text.dernier_appelant_fritzbox
    data:
      value: >-
        {{
        state_attr("sensor.fritz_box_7530_ax_call_monitor_repertoire_telephonique",
        "from")}}
  - wait_for_trigger:
      - platform: state
        entity_id: sensor.fritz_box_7530_ax_call_monitor_repertoire_telephonique
        from: ringing
        to: idle
  - service: persistent_notification.create
    data:
      message: >-
        Appel manqué ou raccroché de {{
        states("counter.nombre_d_appels_manques") }} + {{
        states("input_text.dernier_appelant_fritzbox") }} +
        {{state_attr("sensor.fritz_box_7530_ax_call_monitor_repertoire_telephonique",    
        "from")}} "- Nombre d'appels manqués ou raccrochés :" {{
        states("counter.nombre_d_appels_manques") }}
  - service: counter.increment
    metadata: {}
    data: {}
    target:
      entity_id: counter.nombre_d_appels_manques
mode: single

… so that I have for the moment is the text helper with the last missed phone number,
and on the dashboard, the number of missed called (ringing → idle) :

image

Many Thanks !

You’re missing, that this is not a list as you might think. What @SteffenDE does, is as follows:

  • call comes in
  • he takes the number and writes it to a text input
  • the history of that text input IS the list

That’s why the Logbook card is used. This card displays all entries in the log for one specific entity, in this case the text input. So what you get is technically not a list of calls, but rather a list of history entries from a text field.

In your case go to the history of your sensor (input_text.dernier_appelant_fritzbox), you’ll see the “list”.