Closed Technikessenz closed 3 weeks ago
Hey there @cdce8p, mind taking a look at this issue as it has been labeled with an integration (fritzbox_callmonitor
) you are listed as a code owner for? Thanks!
(message by CodeOwnersMention)
fritzbox_callmonitor documentation fritzbox_callmonitor source (message by IssueLinks)
The sensor always sets the from_name
. For unknown callers it's just unknown
. Therefore your if statement never get's to the second condition. Try something like:
{% if state_attr('sensor.fritz_box_call_monitor_phonebook', 'from_name') != 'unknown' %}
Call from {{ state_attr('sensor.fritz_box_call_monitor_phonebook', 'from_name') }}
{% else %}
Call from number {{ state_attr('sensor.fritz_box_call_monitor_phonebook', 'from') }}
{% endif %}
Thanks for your quick answer. I tried it now. Now it doesn't say: call from unknown. But now it says nothing, if there is no fritz!box phonebook entry available.
So my original plan was, to let home assistant say, call from name or call from number if a fritz!box phonebook entry is available and if no fritz!box phonebook entry is available, to say call from number or if there is no number information available, to say call from unknown.
Is this possible or is it only possible if a fritz!box phonebook entry exists?
Thanks in advance
I tried it now. Now it doesn't say: call from unknown. But now it says nothing, if there is no fritz!box phonebook entry available.
Are you sure / have you deleted the elif
clause?
Have you tried debugging the template using the Developer tools? Please check the States
tab in both cases (known and unknown number). Also try the Template
tab.
Yes. I have replaced my script part with yours and then restarted home assistant completely. There is no elif clause anymore.
I looked at the trace from my test calls when the automation run.
You are right. The phone number is therefore transmitted. See:
params: domain: tts service: speak service_data: message: Call from number 0** media_player_entity_id: media_player.homepod_all cache: true entity_id:
Therefore i think it must have something to do with the piper tts addon which apparently cannot read out the number.
I will take a look at this.
This is strange. If i manually let the piper tts addon speak out the phrase Call from number 0** it works. But this behavior has nothing to do with the fritz!box callmonitor integration i think. i'll have to test and check again myself. thanks anyway.
The problem
Hello,
i integrated the fritzbox_callmonitor integration into my home assistant os setup.
with this script wich i use in a home assistant automation, i want to spell the callers name (if it is in the phonebook) or if not available spell the callers phone number. As result of my research i found that this should be done with the 'from' attribute, but i can't get it to work. Every time a caller is not in the fritz!box phonebook it spells call from unknown.
Am I doing something wrong? Or is the 'from' attribut not available anymore?
See the complete home assistant automation script below.
Thanks in advance
Bye
What version of Home Assistant Core has the issue?
core-2024.10.3
What was the last working version of Home Assistant Core?
No response
What type of installation are you running?
Home Assistant OS
Integration causing the issue
fritzbox_callmonitor
Link to integration documentation on our website
https://www.home-assistant.io/integrations/fritzbox_callmonitor
Diagnostics information
No response
Example YAML snippet
Anything in the logs that might be useful for us?
No response
Additional information
No response